mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 06:01:12 +00:00
Added hint about message synchronization
This commit is contained in:
parent
39717470a3
commit
35b7db5a59
3 changed files with 58 additions and 3 deletions
|
@ -43,10 +43,12 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
public class FragmentFolders extends FragmentEx {
|
||||
private ImageButton ibHintActions;
|
||||
private ImageButton ibHintSync;
|
||||
private ToggleButton tbShowHidden;
|
||||
private RecyclerView rvFolder;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
private Group grpHintActions;
|
||||
private Group grpHintSync;
|
||||
private Group grpReady;
|
||||
private FloatingActionButton fab;
|
||||
|
||||
|
@ -69,16 +71,19 @@ public class FragmentFolders extends FragmentEx {
|
|||
|
||||
// Get controls
|
||||
ibHintActions = view.findViewById(R.id.ibHintActions);
|
||||
ibHintSync = view.findViewById(R.id.ibHintSync);
|
||||
tbShowHidden = view.findViewById(R.id.tbShowHidden);
|
||||
rvFolder = view.findViewById(R.id.rvFolder);
|
||||
pbWait = view.findViewById(R.id.pbWait);
|
||||
grpHintActions = view.findViewById(R.id.grpHintActions);
|
||||
grpHintSync = view.findViewById(R.id.grpHintSync);
|
||||
grpReady = view.findViewById(R.id.grpReady);
|
||||
fab = view.findViewById(R.id.fab);
|
||||
|
||||
// Wire controls
|
||||
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
ibHintActions.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -87,6 +92,14 @@ public class FragmentFolders extends FragmentEx {
|
|||
}
|
||||
});
|
||||
|
||||
ibHintSync.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
prefs.edit().putBoolean("folder_sync", true).apply();
|
||||
grpHintSync.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
tbShowHidden.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
|
@ -130,6 +143,7 @@ public class FragmentFolders extends FragmentEx {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
grpHintActions.setVisibility(prefs.getBoolean("folder_actions", false) ? View.GONE : View.VISIBLE);
|
||||
grpHintSync.setVisibility(prefs.getBoolean("folder_sync", false) ? View.GONE : View.VISIBLE);
|
||||
|
||||
DB db = DB.getInstance(getContext());
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
app:layout_constraintTop_toTopOf="@id/tvHintActions" />
|
||||
|
||||
<View
|
||||
android:id="@+id/vSeparator"
|
||||
android:id="@+id/vSeparatorActions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="6dp"
|
||||
|
@ -45,6 +45,40 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvHintActions" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHintSync"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
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_sync"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibHintSync"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorActions" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibHintSync"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/baseline_close_24"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvHintSync"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvHintSync" />
|
||||
|
||||
<View
|
||||
android:id="@+id/vSeparatorSync"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="?attr/colorSeparator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvHintSync" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbShowHidden"
|
||||
style="@style/buttonStyleSmall"
|
||||
|
@ -56,7 +90,7 @@
|
|||
android:textOn="@string/title_hide_folders"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparator" />
|
||||
app:layout_constraintTop_toBottomOf="@id/vSeparatorSync" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvFolder"
|
||||
|
@ -84,7 +118,13 @@
|
|||
android:id="@+id/grpHintActions"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparator" />
|
||||
app:constraint_referenced_ids="tvHintActions,ibHintActions,vSeparatorActions" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpHintSync"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="tvHintSync,ibHintSync,vSeparatorSync" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpReady"
|
||||
|
|
|
@ -387,6 +387,7 @@
|
|||
<string name="title_legend_download_fetch">Number of message bodies downloaded / headers fetched</string>
|
||||
|
||||
<string name="title_hint_folder_actions">Long press for options</string>
|
||||
<string name="title_hint_folder_sync">To limit battery and network usage not all folders and not all messages will be synchronized by default</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_selection">Long press a message to start selecting multiple messages</string>
|
||||
|
|
Loading…
Reference in a new issue