Added hint about compact view

pull/147/head
M66B 6 years ago
parent 95ced56549
commit 854dd85588

@ -81,6 +81,7 @@ public class FragmentMessages extends FragmentEx {
private ImageButton ibHintSupport;
private ImageButton ibHintSwipe;
private ImageButton ibHintSelect;
private ImageButton ibHintCompact;
private TextView tvNoEmail;
private RecyclerView rvMessage;
private BottomNavigationView bottom_navigation;
@ -89,6 +90,7 @@ public class FragmentMessages extends FragmentEx {
private Group grpHintSupport;
private Group grpHintSwipe;
private Group grpHintSelect;
private Group grpHintCompact;
private Group grpReady;
private FloatingActionButton fab;
private FloatingActionButton fabMore;
@ -174,6 +176,7 @@ public class FragmentMessages extends FragmentEx {
ibHintSupport = view.findViewById(R.id.ibHintSupport);
ibHintSwipe = view.findViewById(R.id.ibHintSwipe);
ibHintSelect = view.findViewById(R.id.ibHintSelect);
ibHintCompact = view.findViewById(R.id.ibHintCompact);
tvNoEmail = view.findViewById(R.id.tvNoEmail);
rvMessage = view.findViewById(R.id.rvFolder);
bottom_navigation = view.findViewById(R.id.bottom_navigation);
@ -182,6 +185,7 @@ public class FragmentMessages extends FragmentEx {
grpHintSupport = view.findViewById(R.id.grpHintSupport);
grpHintSwipe = view.findViewById(R.id.grpHintSwipe);
grpHintSelect = view.findViewById(R.id.grpHintSelect);
grpHintCompact = view.findViewById(R.id.grpHintCompact);
grpReady = view.findViewById(R.id.grpReady);
fab = view.findViewById(R.id.fab);
fabMore = view.findViewById(R.id.fabMore);
@ -267,6 +271,14 @@ public class FragmentMessages extends FragmentEx {
}
});
ibHintSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("app_support", true).apply();
grpHintSupport.setVisibility(View.GONE);
}
});
ibHintSwipe.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -283,11 +295,11 @@ public class FragmentMessages extends FragmentEx {
}
});
ibHintSupport.setOnClickListener(new View.OnClickListener() {
ibHintCompact.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("app_support", true).apply();
grpHintSupport.setVisibility(View.GONE);
prefs.edit().putBoolean("message_compact", true).apply();
grpHintCompact.setVisibility(View.GONE);
}
});
@ -1215,10 +1227,12 @@ public class FragmentMessages extends FragmentEx {
selectionTracker.onRestoreInstanceState(savedInstanceState);
}
boolean hints = (viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
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);
grpHintSupport.setVisibility(prefs.getBoolean("app_support", false) || !hints ? View.GONE : View.VISIBLE);
grpHintSwipe.setVisibility(prefs.getBoolean("message_swipe", false) || !hints ? View.GONE : View.VISIBLE);
grpHintSelect.setVisibility(prefs.getBoolean("message_select", false) || !hints ? View.GONE : View.VISIBLE);
grpHintCompact.setVisibility(prefs.getBoolean("message_compact", false) || !hints ? View.GONE : View.VISIBLE);
final DB db = DB.getInstance(getContext());

@ -136,6 +136,37 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibHintSelect" />
<TextView
android:id="@+id/tvHintCompact"
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_compact"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/ibHintCompact"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
<ImageButton
android:id="@+id/ibHintCompact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_close_24"
app:layout_constraintBottom_toBottomOf="@id/tvHintCompact"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintCompact" />
<View
android:id="@+id/vSeparatorHintCompact"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ibHintCompact" />
<TextView
android:id="@+id/tvNoEmail"
android:layout_width="wrap_content"
@ -145,7 +176,7 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintCompact" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFolder"
@ -156,7 +187,7 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintSelect" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintCompact" />
<ProgressBar
android:id="@+id/pbWait"
@ -206,6 +237,12 @@
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintSelect,ibHintSelect,vSeparatorHintSelect" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintCompact"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintCompact,ibHintCompact,vSeparatorHintCompact" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpReady"
android:layout_width="0dp"

@ -332,6 +332,7 @@
<string name="title_hint_support">Als u een vraag of een probleem heeft, gebruik dan het menu ondersteuning om hulp te krijgen</string>
<string name="title_hint_message_actions">Veeg naar links om weg te gooien; veeg naar rechts om te archiveren (indien beschikbaar)</string>
<string name="title_hint_message_selection">Druk lang op een bericht om te beginnen met het selecteren van meerdere berichten</string>
<string name="title_hint_message_compact">U kunt een compactere berichtweergave in de geavanceerde opties selecteren</string>
<string name="title_hint_sync">Het downloaden van berichten kan enige tijd duren, afhankelijk van de snelheid van de provider, de internet-verbinding en het apparaat en van het aantal berichten. Tijdens het downloaden van berichten kan de app trager reageren.</string>
<string name="title_open_link">Link openen</string>
<string name="title_select_app">Selecteer app</string>

@ -378,6 +378,7 @@
<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_selection">Long press a message to start selecting multiple messages</string>
<string name="title_hint_message_compact">You can select a more compact message view in the advanced options</string>
<string name="title_hint_sync">Downloading messages can take some time, depending on the speed of the provider, internet connection and device and on the number of messages. While downloading messages the app might respond slower.</string>
<string name="title_open_link">Open link</string>

Loading…
Cancel
Save