Browse Source

Added multiple select hint

main
M66B 6 years ago
parent
commit
4c75d9487a
4 changed files with 74 additions and 23 deletions
  1. +22
    -9
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  2. +2
    -2
      app/src/main/res/layout/fragment_folders.xml
  3. +49
    -12
      app/src/main/res/layout/fragment_messages.xml
  4. +1
    -0
      app/src/main/res/values/strings.xml

+ 22
- 9
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -78,14 +78,16 @@ public class FragmentMessages extends FragmentEx {
private View popupAnchor; private View popupAnchor;
private TextView tvSupport; private TextView tvSupport;
private ImageButton ibHintSupport; private ImageButton ibHintSupport;
private ImageButton ibHintActions;
private ImageButton ibHintSwipe;
private ImageButton ibHintSelect;
private TextView tvNoEmail; private TextView tvNoEmail;
private RecyclerView rvMessage; private RecyclerView rvMessage;
private BottomNavigationView bottom_navigation; private BottomNavigationView bottom_navigation;
private ProgressBar pbWait; private ProgressBar pbWait;
private Group grpSupport; private Group grpSupport;
private Group grpHintSupport; private Group grpHintSupport;
private Group grpHintActions;
private Group grpHintSwipe;
private Group grpHintSelect;
private Group grpReady; private Group grpReady;
private FloatingActionButton fab; private FloatingActionButton fab;
private FloatingActionButton fabMove; private FloatingActionButton fabMove;
@ -154,14 +156,16 @@ public class FragmentMessages extends FragmentEx {
popupAnchor = view.findViewById(R.id.popupAnchor); popupAnchor = view.findViewById(R.id.popupAnchor);
tvSupport = view.findViewById(R.id.tvSupport); tvSupport = view.findViewById(R.id.tvSupport);
ibHintSupport = view.findViewById(R.id.ibHintSupport); 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); tvNoEmail = view.findViewById(R.id.tvNoEmail);
rvMessage = view.findViewById(R.id.rvFolder); rvMessage = view.findViewById(R.id.rvFolder);
bottom_navigation = view.findViewById(R.id.bottom_navigation); bottom_navigation = view.findViewById(R.id.bottom_navigation);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpSupport = view.findViewById(R.id.grpSupport); grpSupport = view.findViewById(R.id.grpSupport);
grpHintSupport = view.findViewById(R.id.grpHintSupport); 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); grpReady = view.findViewById(R.id.grpReady);
fab = view.findViewById(R.id.fab); fab = view.findViewById(R.id.fab);
fabMove = view.findViewById(R.id.fabMove); 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 @Override
public void onClick(View v) { 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()); 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()); final DB db = DB.getInstance(getContext());


+ 2
- 2
app/src/main/res/layout/fragment_folders.xml View File

@ -10,9 +10,9 @@
android:id="@+id/tvHintActions" android:id="@+id/tvHintActions"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:layout_marginEnd="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="33dp" android:minHeight="33dp"
android:text="@string/title_hint_folder_actions" android:text="@string/title_hint_folder_actions"
@ -45,8 +45,8 @@
style="@style/buttonStyleSmall" style="@style/buttonStyleSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="0dp"
android:minWidth="0dp" android:minWidth="0dp"
android:minHeight="0dp"
android:textOff="@string/title_show_folders" android:textOff="@string/title_show_folders"
android:textOn="@string/title_hide_folders" android:textOn="@string/title_hide_folders"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"


+ 49
- 12
app/src/main/res/layout/fragment_messages.xml View File

@ -70,7 +70,7 @@
app:layout_constraintTop_toBottomOf="@id/ibHintSupport" /> app:layout_constraintTop_toBottomOf="@id/ibHintSupport" />
<TextView <TextView
android:id="@+id/tvHintActions"
android:id="@+id/tvHintSwipe"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
@ -79,26 +79,57 @@
android:text="@string/title_hint_message_actions" android:text="@string/title_hint_message_actions"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintActions"
app:layout_constraintEnd_toStartOf="@+id/ibHintSwipe"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSupport" /> app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSupport" />
<ImageButton <ImageButton
android:id="@+id/ibHintActions"
android:id="@+id/ibHintSwipe"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/baseline_close_24" android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintActions"
app:layout_constraintBottom_toBottomOf="@id/tvHintSwipe"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintActions" />
app:layout_constraintTop_toTopOf="@id/tvHintSwipe" />
<View <View
android:id="@+id/vSeparatorHintActions"
android:id="@+id/vSeparatorHintSwipe"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHintActions" />
app:layout_constraintTop_toBottomOf="@id/tvHintSwipe" />
<TextView
android:id="@+id/tvHintSelect"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="33dp"
android:padding="6dp"
android:text="@string/title_hint_message_selection"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintSwipe"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSwipe" />
<ImageButton
android:id="@+id/ibHintSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintSelect"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintSelect" />
<View
android:id="@+id/vSeparatorHintSelect"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibHintSelect" />
<TextView <TextView
android:id="@+id/tvNoEmail" android:id="@+id/tvNoEmail"
@ -109,7 +140,7 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation" app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFolder" android:id="@+id/rvFolder"
@ -120,7 +151,7 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation" app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintActions" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
<ProgressBar <ProgressBar
android:id="@+id/pbWait" android:id="@+id/pbWait"
@ -131,7 +162,7 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation" app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation" android:id="@+id/bottom_navigation"
@ -159,10 +190,16 @@
app:constraint_referenced_ids="tvHintSupport,ibHintSupport,vSeparatorHintSupport" /> app:constraint_referenced_ids="tvHintSupport,ibHintSupport,vSeparatorHintSupport" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpHintActions"
android:id="@+id/grpHintSwipe"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintSwipe,ibHintSwipe,vSeparatorHintSwipe" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintSelect"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparatorHintActions" />
app:constraint_referenced_ids="tvHintSelect,ibHintSelect,vSeparatorHintSelect" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpReady" android:id="@+id/grpReady"


+ 1
- 0
app/src/main/res/values/strings.xml View File

@ -269,6 +269,7 @@
<string name="title_hint_folder_actions">Long press for options</string> <string name="title_hint_folder_actions">Long press for options</string>
<string name="title_hint_support">If you have a question or a problem, please use the support menu to get help</string> <string name="title_hint_support">If you have a question or a problem, please use the support menu to get help</string>
<string name="title_hint_message_actions">Swipe left to trash; swipe right to archive (if available)</string> <string name="title_hint_message_actions">Swipe left to trash; swipe right to archive (if available)</string>
<string name="title_hint_message_selection">Long press a message to start selecting multiple messages</string>
<string name="title_hint_sync">Downloading messages can take some time, depending on the number of messages, the speed of your internet connection and your email provider</string> <string name="title_hint_sync">Downloading messages can take some time, depending on the number of messages, the speed of your internet connection and your email provider</string>
<string name="title_open_link">Open link</string> <string name="title_open_link">Open link</string>


Loading…
Cancel
Save