Added spinners to quick setup

This commit is contained in:
M66B 2019-07-28 14:11:42 +02:00
parent d6ba051e85
commit b01c75679b
2 changed files with 36 additions and 0 deletions

View File

@ -74,6 +74,7 @@ public class FragmentQuickSetup extends FragmentBase {
private EditText etEmail; private EditText etEmail;
private TextInputLayout tilPassword; private TextInputLayout tilPassword;
private Button btnCheck; private Button btnCheck;
private ContentLoadingProgressBar pbCheck;
private TextView tvError; private TextView tvError;
private Button btnHelp; private Button btnHelp;
@ -82,6 +83,8 @@ public class FragmentQuickSetup extends FragmentBase {
private TextView tvImap; private TextView tvImap;
private TextView tvSmtp; private TextView tvSmtp;
private Button btnSave; private Button btnSave;
private ContentLoadingProgressBar pbSave;
private Group grpSetup; private Group grpSetup;
private static final int REQUEST_DONE = 1; private static final int REQUEST_DONE = 1;
@ -100,6 +103,7 @@ public class FragmentQuickSetup extends FragmentBase {
etEmail = view.findViewById(R.id.etEmail); etEmail = view.findViewById(R.id.etEmail);
tilPassword = view.findViewById(R.id.tilPassword); tilPassword = view.findViewById(R.id.tilPassword);
btnCheck = view.findViewById(R.id.btnCheck); btnCheck = view.findViewById(R.id.btnCheck);
pbCheck = view.findViewById(R.id.pbCheck);
tvError = view.findViewById(R.id.tvError); tvError = view.findViewById(R.id.tvError);
btnHelp = view.findViewById(R.id.btnHelp); btnHelp = view.findViewById(R.id.btnHelp);
@ -108,6 +112,8 @@ public class FragmentQuickSetup extends FragmentBase {
tvImap = view.findViewById(R.id.tvImap); tvImap = view.findViewById(R.id.tvImap);
tvSmtp = view.findViewById(R.id.tvSmtp); tvSmtp = view.findViewById(R.id.tvSmtp);
btnSave = view.findViewById(R.id.btnSave); btnSave = view.findViewById(R.id.btnSave);
pbSave = view.findViewById(R.id.pbSave);
grpSetup = view.findViewById(R.id.grpSetup); grpSetup = view.findViewById(R.id.grpSetup);
// Wire controls // Wire controls
@ -147,6 +153,8 @@ public class FragmentQuickSetup extends FragmentBase {
}); });
// Initialize // Initialize
pbCheck.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE); tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE); btnHelp.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE); tvInstructions.setVisibility(View.GONE);
@ -200,6 +208,8 @@ public class FragmentQuickSetup extends FragmentBase {
boolean check = args.getBoolean("check"); boolean check = args.getBoolean("check");
Helper.setViewsEnabled(view, false); Helper.setViewsEnabled(view, false);
pbCheck.setVisibility(check ? View.VISIBLE : View.GONE);
pbSave.setVisibility(check ? View.GONE : View.VISIBLE);
tvError.setVisibility(View.GONE); tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE); btnHelp.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE); tvInstructions.setVisibility(View.GONE);
@ -208,7 +218,11 @@ public class FragmentQuickSetup extends FragmentBase {
@Override @Override
protected void onPostExecute(Bundle args) { protected void onPostExecute(Bundle args) {
boolean check = args.getBoolean("check");
Helper.setViewsEnabled(view, true); Helper.setViewsEnabled(view, true);
pbCheck.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE);
} }
@Override @Override

View File

@ -86,6 +86,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHint" /> app:layout_constraintTop_toBottomOf="@id/tvHint" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbCheck"
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/btnCheck"
app:layout_constraintStart_toEndOf="@id/btnCheck"
app:layout_constraintTop_toTopOf="@id/btnCheck" />
<TextView <TextView
android:id="@+id/tvError" android:id="@+id/tvError"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -171,6 +182,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSmtp" /> app:layout_constraintTop_toBottomOf="@id/tvSmtp" />
<eu.faircode.email.ContentLoadingProgressBar
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/btnSave"
app:layout_constraintStart_toEndOf="@id/btnSave"
app:layout_constraintTop_toTopOf="@id/btnSave" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpSetup" android:id="@+id/grpSetup"
android:layout_width="0dp" android:layout_width="0dp"