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


Loading…
Cancel
Save