mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #1674 from deltachat/tweak-menu
tweak chat-action-bar menu
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:title="@string/menu_resend"
|
||||
android:id="@+id/menu_context_resend"
|
||||
android:visible="false"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:title="@string/menu_reply"
|
||||
android:id="@+id/menu_context_reply"
|
||||
android:icon="?menu_reply_icon"
|
||||
@@ -38,5 +33,5 @@
|
||||
|
||||
<item android:title="@string/reply_privately"
|
||||
android:id="@+id/menu_context_reply_privately"
|
||||
app:showAsAction="collapseActionView" />
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
||||
@@ -473,9 +473,6 @@ public class ConversationFragment extends Fragment
|
||||
getActivity().overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
|
||||
}
|
||||
|
||||
private void handleResendMessage(final DcMsg message) {
|
||||
}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
private void handleReplyMessage(final DcMsg message) {
|
||||
if (getActivity() != null) {
|
||||
@@ -784,6 +781,7 @@ public class ConversationFragment extends Fragment
|
||||
setCorrectMenuVisibility(menu);
|
||||
ConversationAdaptiveActionsToolbar.adjustMenuActions(menu, 10, requireActivity().getWindow().getDecorView().getMeasuredWidth());
|
||||
actionMode.setTitle(String.valueOf(getListAdapter().getSelectedItems().size()));
|
||||
actionMode.setTitleOptionalHint(false); // the title represents important information, also indicating implicitly, more items can be selected
|
||||
}
|
||||
}
|
||||
else if(messageRecord.isSetupMessage()) {
|
||||
@@ -928,10 +926,6 @@ public class ConversationFragment extends Fragment
|
||||
handleForwardMessage(getListAdapter().getSelectedItems());
|
||||
actionMode.finish();
|
||||
return true;
|
||||
case R.id.menu_context_resend:
|
||||
handleResendMessage(getSelectedMessageRecord());
|
||||
actionMode.finish();
|
||||
return true;
|
||||
case R.id.menu_context_save_attachment:
|
||||
handleSaveAttachment(getSelectedMessageRecord());
|
||||
return true;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
public class ConversationAdaptiveActionsToolbar extends Toolbar {
|
||||
|
||||
private static final int NAVIGATION_DP = 56;
|
||||
private static final int TITLE_DP = 48; // estimated, only a number (if >1 items are selected there is more room anyway as there are fewer options)
|
||||
private static final int ACTION_VIEW_WIDTH_DP = 48;
|
||||
private static final int OVERFLOW_VIEW_WIDTH_DP = 36;
|
||||
|
||||
@@ -61,7 +62,7 @@ public class ConversationAdaptiveActionsToolbar extends Toolbar {
|
||||
}
|
||||
}
|
||||
|
||||
int widthAllowed = toolbarWidthPx - ViewUtil.dpToPx(NAVIGATION_DP);
|
||||
int widthAllowed = toolbarWidthPx - ViewUtil.dpToPx(NAVIGATION_DP + TITLE_DP);
|
||||
int nItemsToShow = Math.min(maxToShow, widthAllowed / ViewUtil.dpToPx(ACTION_VIEW_WIDTH_DP));
|
||||
|
||||
if (nItemsToShow < menuSize) {
|
||||
|
||||
Reference in New Issue
Block a user