Browse Source

Added spinner to folder save

Deleting messages can take some time
main
M66B 6 years ago
parent
commit
f267d55d98
2 changed files with 16 additions and 0 deletions
  1. +5
    -0
      app/src/main/java/eu/faircode/email/FragmentFolder.java
  2. +11
    -0
      app/src/main/res/layout/fragment_folder.xml

+ 5
- 0
app/src/main/java/eu/faircode/email/FragmentFolder.java View File

@ -43,6 +43,7 @@ public class FragmentFolder extends FragmentEx {
private CheckBox cbSynchronize; private CheckBox cbSynchronize;
private EditText etAfter; private EditText etAfter;
private Button btnOk; private Button btnOk;
private ProgressBar pbSave;
private ProgressBar pbWait; private ProgressBar pbWait;
private Group grpReady; private Group grpReady;
@ -60,6 +61,7 @@ public class FragmentFolder extends FragmentEx {
// Get controls // Get controls
cbSynchronize = view.findViewById(R.id.cbSynchronize); cbSynchronize = view.findViewById(R.id.cbSynchronize);
etAfter = view.findViewById(R.id.etAfter); etAfter = view.findViewById(R.id.etAfter);
pbSave = view.findViewById(R.id.pbSave);
btnOk = view.findViewById(R.id.btnOk); btnOk = view.findViewById(R.id.btnOk);
pbWait = view.findViewById(R.id.pbWait); pbWait = view.findViewById(R.id.pbWait);
grpReady = view.findViewById(R.id.grpReady); grpReady = view.findViewById(R.id.grpReady);
@ -68,6 +70,7 @@ public class FragmentFolder extends FragmentEx {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
btnOk.setEnabled(false); btnOk.setEnabled(false);
pbSave.setVisibility(View.VISIBLE);
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("id", id); args.putLong("id", id);
@ -79,6 +82,7 @@ public class FragmentFolder extends FragmentEx {
}); });
// Initialize // Initialize
pbSave.setVisibility(View.GONE);
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);
@ -152,6 +156,7 @@ public class FragmentFolder extends FragmentEx {
getLoaderManager().destroyLoader(loader.getId()); getLoaderManager().destroyLoader(loader.getId());
btnOk.setEnabled(true); btnOk.setEnabled(true);
pbSave.setVisibility(View.GONE);
if (ex == null) if (ex == null)
getFragmentManager().popBackStack(); getFragmentManager().popBackStack();


+ 11
- 0
app/src/main/res/layout/fragment_folder.xml View File

@ -53,6 +53,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etAfter" /> app:layout_constraintTop_toBottomOf="@id/etAfter" />
<ProgressBar
android:id="@+id/pbSave"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="@id/btnOk"
app:layout_constraintStart_toEndOf="@id/btnOk"
app:layout_constraintTop_toTopOf="@id/btnOk" />
<ProgressBar <ProgressBar
android:id="@+id/pbWait" android:id="@+id/pbWait"
style="@style/Base.Widget.AppCompat.ProgressBar" style="@style/Base.Widget.AppCompat.ProgressBar"


Loading…
Cancel
Save