mirror of https://github.com/M66B/FairEmail.git
Restored horizontal message action bar
This commit is contained in:
parent
d5991a8106
commit
779d9f6935
|
@ -111,6 +111,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
|
@ -223,7 +225,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
));
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements
|
||||
View.OnClickListener, View.OnLongClickListener, View.OnKeyListener {
|
||||
View.OnClickListener, View.OnLongClickListener, BottomNavigationView.OnNavigationItemSelectedListener, View.OnKeyListener {
|
||||
private View view;
|
||||
private View vwRipple;
|
||||
|
||||
|
@ -290,20 +292,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private Button btnDownloadAttachments;
|
||||
private TextView tvNoInternetAttachments;
|
||||
|
||||
private View vSeparatorBody;
|
||||
private BottomNavigationView bnvActions;
|
||||
|
||||
private ImageButton ibExpander;
|
||||
private ImageButton ibFull;
|
||||
private ImageButton ibImages;
|
||||
private ImageButton ibDecrypt;
|
||||
|
||||
private ImageButton ibReply;
|
||||
private ImageButton ibForward;
|
||||
private ImageButton ibArchive;
|
||||
private ImageButton ibMove;
|
||||
private ImageButton ibDelete;
|
||||
private ImageButton ibMore;
|
||||
|
||||
private TextView tvBody;
|
||||
private ContentLoadingProgressBar pbBody;
|
||||
private TextView tvNoInternetBody;
|
||||
|
@ -432,20 +426,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
btnDownloadAttachments = attachments.findViewById(R.id.btnDownloadAttachments);
|
||||
tvNoInternetAttachments = attachments.findViewById(R.id.tvNoInternetAttachments);
|
||||
|
||||
vSeparatorBody = vsBody.findViewById(R.id.vSeparatorBody);
|
||||
bnvActions = vsBody.findViewById(R.id.bnvActions);
|
||||
if (compact) {
|
||||
bnvActions.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);
|
||||
ViewGroup.LayoutParams lparam = bnvActions.getLayoutParams();
|
||||
lparam.height = dp36;
|
||||
bnvActions.setLayoutParams(lparam);
|
||||
}
|
||||
|
||||
ibExpander = vsBody.findViewById(R.id.ibExpander);
|
||||
ibFull = vsBody.findViewById(R.id.ibFull);
|
||||
ibImages = vsBody.findViewById(R.id.ibImages);
|
||||
ibDecrypt = vsBody.findViewById(R.id.ibDecrypt);
|
||||
|
||||
ibReply = vsBody.findViewById(R.id.ibReply);
|
||||
ibForward = vsBody.findViewById(R.id.ibForward);
|
||||
ibArchive = vsBody.findViewById(R.id.ibArchive);
|
||||
ibMove = vsBody.findViewById(R.id.ibMove);
|
||||
ibDelete = vsBody.findViewById(R.id.ibDelete);
|
||||
ibMore = vsBody.findViewById(R.id.ibMore);
|
||||
|
||||
tvBody = vsBody.findViewById(R.id.tvBody);
|
||||
pbBody = vsBody.findViewById(R.id.pbBody);
|
||||
tvNoInternetBody = vsBody.findViewById(R.id.tvNoInternetBody);
|
||||
|
@ -508,18 +500,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
btnSaveAttachments.setOnClickListener(this);
|
||||
btnDownloadAttachments.setOnClickListener(this);
|
||||
|
||||
ibExpander.setOnClickListener(this);
|
||||
bnvActions.setOnNavigationItemSelectedListener(this);
|
||||
|
||||
ibFull.setOnClickListener(this);
|
||||
ibImages.setOnClickListener(this);
|
||||
ibDecrypt.setOnClickListener(this);
|
||||
|
||||
ibReply.setOnClickListener(this);
|
||||
ibForward.setOnClickListener(this);
|
||||
ibArchive.setOnClickListener(this);
|
||||
ibMove.setOnClickListener(this);
|
||||
ibDelete.setOnClickListener(this);
|
||||
ibMore.setOnClickListener(this);
|
||||
|
||||
btnCalendarAccept.setOnClickListener(this);
|
||||
btnCalendarDecline.setOnClickListener(this);
|
||||
btnCalendarMaybe.setOnClickListener(this);
|
||||
|
@ -546,18 +532,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
btnSaveAttachments.setOnClickListener(null);
|
||||
btnDownloadAttachments.setOnClickListener(null);
|
||||
|
||||
ibExpander.setOnClickListener(null);
|
||||
bnvActions.setOnNavigationItemSelectedListener(null);
|
||||
|
||||
ibFull.setOnClickListener(null);
|
||||
ibImages.setOnClickListener(null);
|
||||
ibDecrypt.setOnClickListener(null);
|
||||
|
||||
ibReply.setOnClickListener(null);
|
||||
ibForward.setOnClickListener(null);
|
||||
ibArchive.setOnClickListener(null);
|
||||
ibMove.setOnClickListener(null);
|
||||
ibDelete.setOnClickListener(null);
|
||||
ibMore.setOnClickListener(null);
|
||||
|
||||
btnCalendarAccept.setOnClickListener(null);
|
||||
btnCalendarDecline.setOnClickListener(null);
|
||||
btnCalendarMaybe.setOnClickListener(null);
|
||||
|
@ -895,20 +875,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
btnDownloadAttachments.setVisibility(View.GONE);
|
||||
tvNoInternetAttachments.setVisibility(View.GONE);
|
||||
|
||||
vSeparatorBody.setVisibility(View.GONE);
|
||||
bnvActions.setVisibility(View.GONE);
|
||||
|
||||
ibExpander.setVisibility(View.GONE);
|
||||
ibFull.setVisibility(View.GONE);
|
||||
ibImages.setVisibility(View.GONE);
|
||||
ibDecrypt.setVisibility(View.GONE);
|
||||
|
||||
ibReply.setVisibility(View.GONE);
|
||||
ibForward.setVisibility(View.GONE);
|
||||
ibArchive.setVisibility(View.GONE);
|
||||
ibMove.setVisibility(View.GONE);
|
||||
ibDelete.setVisibility(View.GONE);
|
||||
ibMore.setVisibility(View.GONE);
|
||||
|
||||
tvBody.setVisibility(View.GONE);
|
||||
pbBody.setVisibility(View.GONE);
|
||||
tvNoInternetBody.setVisibility(View.GONE);
|
||||
|
@ -970,20 +942,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
grpAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE);
|
||||
|
||||
vSeparatorBody.setVisibility(View.VISIBLE);
|
||||
|
||||
initToolbar(message);
|
||||
bnvActions.setVisibility(View.VISIBLE);
|
||||
for (int i = 0; i < bnvActions.getMenu().size(); i++)
|
||||
bnvActions.getMenu().getItem(i).setVisible(false);
|
||||
|
||||
ibFull.setVisibility(View.GONE);
|
||||
ibImages.setVisibility(View.GONE);
|
||||
|
||||
ibReply.setVisibility(View.GONE);
|
||||
ibForward.setVisibility(View.GONE);
|
||||
ibArchive.setVisibility(View.GONE);
|
||||
ibMove.setVisibility(View.GONE);
|
||||
ibDelete.setVisibility(View.GONE);
|
||||
ibMove.setVisibility(View.GONE);
|
||||
|
||||
if (textSize != 0)
|
||||
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
|
||||
|
@ -1124,32 +1089,32 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
delete = (inTrash || !hasTrash || inOutbox);
|
||||
|
||||
ibReply.setEnabled(message.content);
|
||||
ibReply.setVisibility(!inOutbox ? View.VISIBLE : View.GONE);
|
||||
|
||||
ibForward.setEnabled(message.content);
|
||||
ibForward.setVisibility(!inOutbox ? View.VISIBLE : View.GONE);
|
||||
bnvActions.getMenu().findItem(R.id.action_more).setVisible(!inOutbox);
|
||||
|
||||
if (!message.folderReadOnly) {
|
||||
ibArchive.setVisibility(
|
||||
message.uid != null && (inJunk || (!inArchive && hasArchive))
|
||||
? View.VISIBLE : View.GONE);
|
||||
ibArchive.setImageResource(
|
||||
inJunk ? R.drawable.baseline_inbox_24 : R.drawable.baseline_archive_24);
|
||||
bnvActions.getMenu().findItem(R.id.action_delete).setVisible(debug ||
|
||||
(inTrash && (message.uid != null || message.msgid != null)) ||
|
||||
(!inTrash && hasTrash && message.uid != null));
|
||||
bnvActions.getMenu().findItem(R.id.action_delete).setTitle(
|
||||
delete ? R.string.title_delete : R.string.title_trash);
|
||||
|
||||
ibMove.setVisibility(
|
||||
message.uid != null || inOutbox
|
||||
? View.VISIBLE : View.GONE);
|
||||
ibMove.setImageResource(
|
||||
bnvActions.getMenu().findItem(R.id.action_move).setVisible(
|
||||
message.uid != null || inOutbox);
|
||||
bnvActions.getMenu().findItem(R.id.action_move).setTitle(
|
||||
inOutbox ? R.string.title_folder_drafts : R.string.title_move);
|
||||
bnvActions.getMenu().findItem(R.id.action_move).setIcon(
|
||||
inOutbox ? R.drawable.baseline_drafts_24 : R.drawable.baseline_folder_24);
|
||||
|
||||
ibDelete.setVisibility(debug ||
|
||||
(inTrash && (message.uid != null || message.msgid != null)) ||
|
||||
(!inTrash && hasTrash && message.uid != null)
|
||||
? View.VISIBLE : View.GONE);
|
||||
bnvActions.getMenu().findItem(R.id.action_archive).setVisible(
|
||||
message.uid != null && (inJunk || (!inArchive && hasArchive)));
|
||||
bnvActions.getMenu().findItem(R.id.action_archive).setTitle(
|
||||
inJunk ? R.string.title_folder_inbox : R.string.title_archive);
|
||||
bnvActions.getMenu().findItem(R.id.action_archive).setIcon(
|
||||
inJunk ? R.drawable.baseline_inbox_24 : R.drawable.baseline_archive_24);
|
||||
}
|
||||
|
||||
ibMore.setVisibility(!inOutbox ? View.VISIBLE : View.GONE);
|
||||
bnvActions.getMenu().findItem(R.id.action_reply).setEnabled(message.content);
|
||||
bnvActions.getMenu().findItem(R.id.action_reply).setVisible(!inOutbox);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1474,49 +1439,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
onDownloadAttachments(message);
|
||||
break;
|
||||
|
||||
case R.id.ibExpander:
|
||||
onToggleToolbar(message);
|
||||
break;
|
||||
case R.id.ibFull:
|
||||
onShowFull(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibImages:
|
||||
onShowImages(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibDecrypt:
|
||||
onActionDecrypt(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
|
||||
case R.id.ibReply:
|
||||
onActionReplyMenu(message);
|
||||
break;
|
||||
case R.id.ibForward:
|
||||
onActionForward(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibArchive:
|
||||
if (EntityFolder.JUNK.equals(message.folderType))
|
||||
onActionMoveJunk(message);
|
||||
else
|
||||
onActionArchive(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibMove:
|
||||
if (EntityFolder.OUTBOX.equals(message.folderType))
|
||||
onActionMoveOutbox(message);
|
||||
else
|
||||
onActionMove(message, false);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibDelete:
|
||||
onActionDelete(message);
|
||||
autoToolbar(message);
|
||||
break;
|
||||
case R.id.ibMore:
|
||||
onActionMore(message);
|
||||
break;
|
||||
|
||||
case R.id.btnCalendarAccept:
|
||||
|
@ -1603,6 +1533,39 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||
final TupleMessageEx message = getMessage();
|
||||
if (message == null)
|
||||
return false;
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_more:
|
||||
onActionMore(message);
|
||||
return true;
|
||||
case R.id.action_delete:
|
||||
onActionDelete(message);
|
||||
return true;
|
||||
case R.id.action_move:
|
||||
if (EntityFolder.OUTBOX.equals(message.folderType))
|
||||
onActionMoveOutbox(message);
|
||||
else
|
||||
onActionMove(message, false);
|
||||
return true;
|
||||
case R.id.action_archive:
|
||||
if (EntityFolder.JUNK.equals(message.folderType))
|
||||
onActionMoveJunk(message);
|
||||
else
|
||||
onActionArchive(message);
|
||||
return true;
|
||||
case R.id.action_reply:
|
||||
onActionReplyMenu(message);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
final TupleMessageEx message = getMessage();
|
||||
|
@ -1941,77 +1904,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
.putExtra("id", message.id));
|
||||
}
|
||||
|
||||
private void onToggleToolbar(TupleMessageEx message) {
|
||||
boolean toolbar = !properties.getValue("toolbar", message.id);
|
||||
properties.setValue("toolbar", message.id, toolbar);
|
||||
initToolbar(message);
|
||||
}
|
||||
|
||||
private void initToolbar(TupleMessageEx message) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean cards = prefs.getBoolean("cards", true);
|
||||
|
||||
boolean toolbar = properties.getValue("toolbar", message.id);
|
||||
|
||||
ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) ibExpander.getLayoutParams();
|
||||
lparam.setMarginEnd(cards ? 0 : Helper.dp2pixels(ibExpander.getContext(), 6));
|
||||
ibExpander.setLayoutParams(lparam);
|
||||
|
||||
ibExpander.setImageLevel(toolbar ? 0 /* less */ : 1 /* more */);
|
||||
ibExpander.setVisibility(View.VISIBLE);
|
||||
|
||||
if (toolbar) {
|
||||
expand(ibFull, cards);
|
||||
expand(ibImages, cards);
|
||||
expand(ibDecrypt, cards);
|
||||
expand(ibMore, cards);
|
||||
expand(ibDelete, cards);
|
||||
expand(ibMove, cards);
|
||||
expand(ibArchive, cards);
|
||||
expand(ibForward, cards);
|
||||
expand(ibReply, cards);
|
||||
} else {
|
||||
collapse(ibFull);
|
||||
collapse(ibImages);
|
||||
collapse(ibDecrypt);
|
||||
collapse(ibMore);
|
||||
collapse(ibDelete);
|
||||
collapse(ibMove);
|
||||
collapse(ibArchive);
|
||||
collapse(ibForward);
|
||||
collapse(ibReply);
|
||||
}
|
||||
}
|
||||
|
||||
private void autoToolbar(TupleMessageEx message) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean autotoolbar = prefs.getBoolean("autotoolbar", false);
|
||||
if (autotoolbar) {
|
||||
properties.setValue("toolbar", message.id, false);
|
||||
initToolbar(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void expand(View view, boolean cards) {
|
||||
int dp6 = Helper.dp2pixels(view.getContext(), 6);
|
||||
int dp36 = Helper.dp2pixels(view.getContext(), 36);
|
||||
view.setPadding(dp6, dp6, dp6, dp6);
|
||||
ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) view.getLayoutParams();
|
||||
lparam.width = dp36;
|
||||
lparam.height = dp36;
|
||||
lparam.setMarginEnd(cards ? 0 : dp6);
|
||||
view.setLayoutParams(lparam);
|
||||
}
|
||||
|
||||
private void collapse(View view) {
|
||||
view.setPadding(0, 0, 0, 0);
|
||||
ConstraintLayout.LayoutParams lparam = (ConstraintLayout.LayoutParams) view.getLayoutParams();
|
||||
lparam.width = 0;
|
||||
lparam.height = 0;
|
||||
lparam.setMarginEnd(0);
|
||||
view.setLayoutParams(lparam);
|
||||
}
|
||||
|
||||
private void onShowFull(final TupleMessageEx message) {
|
||||
boolean show_images = properties.getValue("images", message.id);
|
||||
|
||||
|
@ -2155,7 +2047,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
return;
|
||||
}
|
||||
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibReply);
|
||||
View anchor = bnvActions.findViewById(R.id.action_reply);
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, anchor);
|
||||
popupMenu.inflate(R.menu.menu_reply);
|
||||
popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setVisible(recipients.length > 0);
|
||||
popupMenu.getMenu().findItem(R.id.menu_reply_list).setVisible(message.list_post != null);
|
||||
|
@ -2165,7 +2058,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem target) {
|
||||
autoToolbar(message);
|
||||
switch (target.getItemId()) {
|
||||
case R.id.menu_reply_to_sender:
|
||||
onMenuReply(message, "reply");
|
||||
|
@ -2227,7 +2119,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
});
|
||||
snackbar.show();
|
||||
} else {
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibReply);
|
||||
View anchor = bnvActions.findViewById(R.id.action_reply);
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, anchor);
|
||||
|
||||
int order = 0;
|
||||
for (EntityAnswer answer : answers)
|
||||
|
@ -2371,9 +2264,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
private void onActionMore(TupleMessageEx message) {
|
||||
boolean show_headers = properties.getValue("headers", message.id);
|
||||
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, ibMore);
|
||||
View anchor = bnvActions.findViewById(R.id.action_more);
|
||||
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, powner, anchor);
|
||||
popupMenu.inflate(R.menu.menu_message);
|
||||
|
||||
popupMenu.getMenu().findItem(R.id.menu_forward).setEnabled(message.content);
|
||||
popupMenu.getMenu().findItem(R.id.menu_editasnew).setEnabled(message.content);
|
||||
|
||||
popupMenu.getMenu().findItem(R.id.menu_unseen).setEnabled(message.uid != null && !message.folderReadOnly);
|
||||
|
@ -2407,8 +2302,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem target) {
|
||||
autoToolbar(message);
|
||||
switch (target.getItemId()) {
|
||||
case R.id.menu_forward:
|
||||
onActionForward(message);
|
||||
return true;
|
||||
case R.id.menu_editasnew:
|
||||
onMenuEditAsNew(message);
|
||||
return true;
|
||||
|
|
|
@ -1127,10 +1127,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
return values.get(name).contains(id);
|
||||
else if ("addresses".equals(name))
|
||||
return !addresses;
|
||||
else if ("toolbar".equals(name)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return !prefs.getBoolean("autotoolbar", false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
private SwitchCompat swAutoScroll;
|
||||
private SwitchCompat swSwipeNav;
|
||||
private SwitchCompat swDoubleTap;
|
||||
private SwitchCompat swAutoToolbar;
|
||||
private SwitchCompat swAutoExpand;
|
||||
private SwitchCompat swAutoClose;
|
||||
private Spinner spOnClose;
|
||||
|
@ -54,7 +53,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
private SwitchCompat swDisableTracking;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"pull", "autoscroll", "swipenav", "doubletap", "autotoolbar", "autoexpand", "autoclose", "onclose",
|
||||
"pull", "autoscroll", "swipenav", "doubletap", "autoexpand", "autoclose", "onclose",
|
||||
"collapse", "autoread", "automove", "authentication", "disable_tracking"
|
||||
};
|
||||
|
||||
|
@ -72,7 +71,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swAutoScroll = view.findViewById(R.id.swAutoScroll);
|
||||
swSwipeNav = view.findViewById(R.id.swSwipeNav);
|
||||
swDoubleTap = view.findViewById(R.id.swDoubleTap);
|
||||
swAutoToolbar = view.findViewById(R.id.swAutoToolbar);
|
||||
swAutoExpand = view.findViewById(R.id.swAutoExpand);
|
||||
swAutoClose = view.findViewById(R.id.swAutoClose);
|
||||
spOnClose = view.findViewById(R.id.spOnClose);
|
||||
|
@ -116,13 +114,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
}
|
||||
});
|
||||
|
||||
swAutoToolbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("autotoolbar", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAutoExpand.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
@ -239,7 +230,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swAutoScroll.setChecked(prefs.getBoolean("autoscroll", false));
|
||||
swSwipeNav.setChecked(prefs.getBoolean("swipenav", true));
|
||||
swDoubleTap.setChecked(prefs.getBoolean("doubletap", false));
|
||||
swAutoToolbar.setChecked(prefs.getBoolean("autotoolbar", false));
|
||||
swAutoExpand.setChecked(prefs.getBoolean("autoexpand", true));
|
||||
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
||||
|
||||
|
|
|
@ -64,17 +64,6 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/swSwipeNav"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swAutoToolbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_autotoolbar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDoubleTap"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swAutoExpand"
|
||||
android:layout_width="0dp"
|
||||
|
@ -84,7 +73,7 @@
|
|||
android:text="@string/title_advanced_autoexpand"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swAutoToolbar"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDoubleTap"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -28,13 +28,11 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/inHeaders" />
|
||||
|
||||
<View
|
||||
android:id="@+id/vSeparatorBody"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
<include
|
||||
android:id="@+id/inNavigation"
|
||||
layout="@layout/include_message_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/inAttachments" />
|
||||
|
||||
|
@ -47,7 +45,7 @@
|
|||
android:padding="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorBody" />
|
||||
app:layout_constraintTop_toBottomOf="@id/inNavigation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNoInternetBody"
|
||||
|
@ -58,7 +56,7 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorBody" />
|
||||
app:layout_constraintTop_toBottomOf="@id/inNavigation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBody"
|
||||
|
@ -72,174 +70,10 @@
|
|||
android:paddingBottom="6dp"
|
||||
android:text="Body"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibFull"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNoInternetBody" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibExpander"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/title_legend_expander"
|
||||
android:padding="6dp"
|
||||
android:rotation="90"
|
||||
android:src="@drawable/expander"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvBody" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibFull"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_legend_show_full"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_fullscreen_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_legend_show_full"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ibExpander" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibImages"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_legend_show_images"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_image_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_legend_show_images"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ibFull" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibDecrypt"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_decrypt"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_no_encryption_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_decrypt"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ibImages" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibMore"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_more"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_more_horiz_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ibDecrypt" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibDelete"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_trash"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_delete_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_trash"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ibMore" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibMove"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_move"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_folder_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_move"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ibDelete" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibArchive"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_archive"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_archive_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_archive"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ibMove" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibForward"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_forward"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_forward_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_forward"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ibArchive" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibReply"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
android:contentDescription="@string/title_reply"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:src="@drawable/baseline_reply_24"
|
||||
android:tint="@color/bottomnav_foreground"
|
||||
android:tooltipText="@string/title_reply"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ibForward" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="tvBody,ibReply" />
|
||||
|
||||
<include
|
||||
android:id="@+id/InCalendar"
|
||||
layout="@layout/include_message_calendar"
|
||||
|
@ -247,7 +81,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_body" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBody" />
|
||||
|
||||
<include
|
||||
android:id="@+id/inAttachmentsAlt"
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bnvActions"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
app:itemIconTint="@color/bottomnav_foreground"
|
||||
app:itemTextColor="@color/bottomnav_foreground"
|
||||
app:labelVisibilityMode="labeled"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:menu="@menu/action_message" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibDecrypt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/title_decrypt"
|
||||
android:src="@drawable/baseline_no_encryption_24"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibImages"
|
||||
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibImages"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/title_legend_show_images"
|
||||
android:src="@drawable/baseline_image_24"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibFull"
|
||||
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibFull"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/title_legend_show_full"
|
||||
android:src="@drawable/baseline_fullscreen_24"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_more"
|
||||
android:icon="@drawable/baseline_more_vert_24"
|
||||
android:title="@string/title_more" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_delete"
|
||||
android:icon="@drawable/baseline_delete_24"
|
||||
android:title="@string/title_trash" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_move"
|
||||
android:icon="@drawable/baseline_folder_24"
|
||||
android:title="@string/title_move" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_archive"
|
||||
android:icon="@drawable/baseline_archive_24"
|
||||
android:title="@string/title_archive" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_reply"
|
||||
android:icon="@drawable/baseline_reply_24"
|
||||
android:title="@string/title_reply" />
|
||||
</menu>
|
|
@ -1,5 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_forward"
|
||||
android:title="@string/title_forward" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_editasnew"
|
||||
android:title="@string/title_editasnew" />
|
||||
|
|
|
@ -240,7 +240,6 @@
|
|||
<string name="title_advanced_autoscroll">Scroll to top on receiving new messages</string>
|
||||
<string name="title_advanced_swipenav">Swipe left/right to go to next/previous conversation</string>
|
||||
<string name="title_advanced_double_tap">Double tap to mark message read/unread</string>
|
||||
<string name="title_advanced_autotoolbar">Automatically hide message actions</string>
|
||||
<string name="title_advanced_autoexpand">Automatically expand messages</string>
|
||||
<string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string>
|
||||
<string name="title_advanced_autoclose">Automatically close conversations</string>
|
||||
|
|
Loading…
Reference in New Issue