From 4c75d9487ac6f0b260fe83f5de49c70a7ebbf3bf Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Oct 2018 16:29:55 +0000 Subject: [PATCH] Added multiple select hint --- .../eu/faircode/email/FragmentMessages.java | 31 +++++++--- app/src/main/res/layout/fragment_folders.xml | 4 +- app/src/main/res/layout/fragment_messages.xml | 61 +++++++++++++++---- app/src/main/res/values/strings.xml | 1 + 4 files changed, 74 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 17994b24..be58b3de 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -78,14 +78,16 @@ public class FragmentMessages extends FragmentEx { private View popupAnchor; private TextView tvSupport; private ImageButton ibHintSupport; - private ImageButton ibHintActions; + private ImageButton ibHintSwipe; + private ImageButton ibHintSelect; private TextView tvNoEmail; private RecyclerView rvMessage; private BottomNavigationView bottom_navigation; private ProgressBar pbWait; private Group grpSupport; private Group grpHintSupport; - private Group grpHintActions; + private Group grpHintSwipe; + private Group grpHintSelect; private Group grpReady; private FloatingActionButton fab; private FloatingActionButton fabMove; @@ -154,14 +156,16 @@ public class FragmentMessages extends FragmentEx { popupAnchor = view.findViewById(R.id.popupAnchor); tvSupport = view.findViewById(R.id.tvSupport); ibHintSupport = view.findViewById(R.id.ibHintSupport); - ibHintActions = view.findViewById(R.id.ibHintActions); + ibHintSwipe = view.findViewById(R.id.ibHintSwipe); + ibHintSelect = view.findViewById(R.id.ibHintSelect); tvNoEmail = view.findViewById(R.id.tvNoEmail); rvMessage = view.findViewById(R.id.rvFolder); bottom_navigation = view.findViewById(R.id.bottom_navigation); pbWait = view.findViewById(R.id.pbWait); grpSupport = view.findViewById(R.id.grpSupport); grpHintSupport = view.findViewById(R.id.grpHintSupport); - grpHintActions = view.findViewById(R.id.grpHintActions); + grpHintSwipe = view.findViewById(R.id.grpHintSwipe); + grpHintSelect = view.findViewById(R.id.grpHintSelect); grpReady = view.findViewById(R.id.grpReady); fab = view.findViewById(R.id.fab); fabMove = view.findViewById(R.id.fabMove); @@ -179,11 +183,19 @@ public class FragmentMessages extends FragmentEx { } }); - ibHintActions.setOnClickListener(new View.OnClickListener() { + ibHintSwipe.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - prefs.edit().putBoolean("message_actions", true).apply(); - grpHintActions.setVisibility(View.GONE); + prefs.edit().putBoolean("message_swipe", true).apply(); + grpHintSwipe.setVisibility(View.GONE); + } + }); + + ibHintSelect.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + prefs.edit().putBoolean("message_select", true).apply(); + grpHintSelect.setVisibility(View.GONE); } }); @@ -685,8 +697,9 @@ public class FragmentMessages extends FragmentEx { } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - grpHintSupport.setVisibility(prefs.getBoolean("app_support", false) ? View.GONE : View.VISIBLE); - grpHintActions.setVisibility(prefs.getBoolean("message_actions", false) || viewType != AdapterMessage.ViewType.THREAD ? View.GONE : View.VISIBLE); + grpHintSupport.setVisibility(prefs.getBoolean("app_support", false) || viewType != AdapterMessage.ViewType.UNIFIED ? View.GONE : View.VISIBLE); + grpHintSwipe.setVisibility(prefs.getBoolean("message_swipe", false) || viewType == AdapterMessage.ViewType.THREAD ? View.GONE : View.VISIBLE); + grpHintSelect.setVisibility(prefs.getBoolean("message_select", false) || viewType != AdapterMessage.ViewType.FOLDER ? View.GONE : View.VISIBLE); final DB db = DB.getInstance(getContext()); diff --git a/app/src/main/res/layout/fragment_folders.xml b/app/src/main/res/layout/fragment_folders.xml index dedbb4bb..9a9af6dc 100644 --- a/app/src/main/res/layout/fragment_folders.xml +++ b/app/src/main/res/layout/fragment_folders.xml @@ -10,9 +10,9 @@ android:id="@+id/tvHintActions" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginEnd="6dp" android:layout_marginStart="6dp" android:layout_marginTop="6dp" + android:layout_marginEnd="6dp" android:gravity="center_vertical" android:minHeight="33dp" android:text="@string/title_hint_folder_actions" @@ -45,8 +45,8 @@ style="@style/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minHeight="0dp" android:minWidth="0dp" + android:minHeight="0dp" android:textOff="@string/title_show_folders" android:textOn="@string/title_hide_folders" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index 98d41ebe..9927e120 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -70,7 +70,7 @@ app:layout_constraintTop_toBottomOf="@id/ibHintSupport" /> + app:layout_constraintTop_toTopOf="@id/tvHintSwipe" /> + app:layout_constraintTop_toBottomOf="@id/tvHintSwipe" /> + + + + + + + app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" /> + app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" /> + + + app:constraint_referenced_ids="tvHintSelect,ibHintSelect,vSeparatorHintSelect" /> Long press for options If you have a question or a problem, please use the support menu to get help Swipe left to trash; swipe right to archive (if available) + Long press a message to start selecting multiple messages Downloading messages can take some time, depending on the number of messages, the speed of your internet connection and your email provider Open link