diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 3946496d03..9d12ec27ae 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -4886,6 +4886,13 @@ public class AdapterMessage extends RecyclerView.Adapter list = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList(); @@ -4543,18 +4568,43 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. return true; } + private boolean onBody(Context context) { + int expanded = (values.containsKey("expanded") ? values.get("expanded").size() : 0); + if (expanded != 1) + return false; + long id = values.get("expanded").get(0); + int pos = adapter.getPositionForKey(id); + if (pos == NO_POSITION) + return false; + AdapterMessage.ViewHolder holder = + (AdapterMessage.ViewHolder) rvMessage.findViewHolderForAdapterPosition(pos); + if (holder == null) + return false; + adapter.focusBody(holder, pos); + return true; + } + private boolean onArchive(Context context) { - if (bottom_navigation == null) + if (viewType != AdapterMessage.ViewType.THREAD) + return false; + if (bottom_navigation == null || + !bottom_navigation.isEnabled() || + bottom_navigation.getVisibility() != View.VISIBLE) return false; MenuItem archive = bottom_navigation.getMenu().findItem(R.id.action_archive); if (archive == null || !archive.isVisible() || !archive.isEnabled()) return false; bottom_navigation.getMenu().performIdentifierAction(R.id.action_archive, 0); return true; + } private boolean onDelete(Context context) { - if (bottom_navigation == null) + if (viewType != AdapterMessage.ViewType.THREAD) + return false; + if (bottom_navigation == null || + !bottom_navigation.isEnabled() || + bottom_navigation.getVisibility() != View.VISIBLE) return false; MenuItem delete = bottom_navigation.getMenu().findItem(R.id.action_delete); if (delete == null || !delete.isVisible() || !delete.isEnabled()) @@ -4576,6 +4626,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. fabCompose.performClick(); return true; } + + private boolean onMore(Context context) { + if (!fabMore.isOrWillBeShown()) + return false; + fabMore.performClick(); + return true; + } }; @Override