Added progress bar to importing dialog

pull/214/head
M66B 1 year ago
parent 571e7c9913
commit bf07a65ee9

@ -49,6 +49,7 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
@ -651,6 +652,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
final int colorWarning = Helper.resolveColor(context, R.attr.colorWarning);
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_import_progress, null);
ProgressBar pbWait = dview.findViewById(R.id.pbWait);
TextView tvLog = dview.findViewById(R.id.tvLog);
tvLog.setText(null);
@ -697,6 +699,11 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
new SimpleTask<Void>() {
private SpannableStringBuilder ssb = new SpannableStringBuilderEx();
@Override
protected void onPreExecute(Bundle args) {
pbWait.setVisibility(View.VISIBLE);
}
@Override
protected void onProgress(CharSequence status, Bundle data) {
ssb.append(status).append("\n");
@ -705,6 +712,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
@Override
protected void onPostExecute(Bundle args) {
pbWait.setVisibility(View.GONE);
ok.setEnabled(true);
}

@ -12,15 +12,26 @@
<TextView
android:id="@+id/tvCaption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:drawableStart="@drawable/twotone_unarchive_24"
android:drawablePadding="6dp"
android:text="@string/title_setup_import"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toStartOf="@+id/pbWait"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbWait"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="24dp"
android:layout_height="24dp"
android:indeterminate="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvLog"
android:layout_width="0dp"

Loading…
Cancel
Save