Added quick setup error hints

pull/172/head
M66B 5 years ago
parent 7751c5ea6e
commit c369c51f4f

@ -66,6 +66,7 @@ public class FragmentQuickSetup extends FragmentBase {
private ContentLoadingProgressBar pbCheck;
private TextView tvError;
private TextView tvErrorHint;
private Button btnHelp;
private Button btnSupport;
private TextView tvInstructions;
@ -96,6 +97,7 @@ public class FragmentQuickSetup extends FragmentBase {
pbCheck = view.findViewById(R.id.pbCheck);
tvError = view.findViewById(R.id.tvError);
tvErrorHint = view.findViewById(R.id.tvErrorHint);
btnHelp = view.findViewById(R.id.btnHelp);
btnSupport = view.findViewById(R.id.btnSupport);
tvInstructions = view.findViewById(R.id.tvInstructions);
@ -402,6 +404,11 @@ public class FragmentQuickSetup extends FragmentBase {
protected void onException(final Bundle args, Throwable ex) {
Log.e(ex);
if (ex instanceof AuthenticationFailedException)
tvErrorHint.setText(R.string.title_setup_no_auth_hint);
else
tvErrorHint.setText(R.string.title_setup_no_settings_hint);
if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException) {
tvError.setText(ex.getMessage());
grpError.setVisibility(View.VISIBLE);
@ -409,7 +416,7 @@ public class FragmentQuickSetup extends FragmentBase {
new Handler().post(new Runnable() {
@Override
public void run() {
scroll.smoothScrollTo(0, tvError.getBottom());
scroll.smoothScrollTo(0, tvErrorHint.getBottom());
}
});
} else {

@ -121,13 +121,26 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error message"
android:text="Error message"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<TextView
android:id="@+id/tvErrorHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:autoLink="web"
android:text="Error hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textIsSelectable="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
<Button
android:id="@+id/btnHelp"
android:layout_width="wrap_content"
@ -138,7 +151,7 @@
android:textColor="?attr/colorInfoForeground"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
app:layout_constraintTop_toBottomOf="@id/tvErrorHint" />
<Button
android:id="@+id/btnSupport"
@ -150,7 +163,7 @@
android:textColor="?attr/colorInfoForeground"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" />
app:layout_constraintTop_toBottomOf="@id/tvErrorHint" />
<TextView
android:id="@+id/tvInstructions"
@ -233,6 +246,6 @@
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
app:constraint_referenced_ids="tvErrorTitle,tvError,tvErrorHint" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -161,6 +161,8 @@
<string name="title_setup_select_account">Select account</string>
<string name="title_setup_instructions">Setup instructions</string>
<string name="title_setup_no_settings">No settings found for domain \'%1$s\'</string>
<string name="title_setup_no_settings_hint">Please try to setup an account and identity in setup step 1 and 2 using the settings provided by your email provider</string>
<string name="title_setup_no_auth_hint">Please double check your email address and password and make sure external access (IMAP/SMTP) is enabled for your account</string>
<string name="title_setup_no_system_folders">Inbox or draft folder not found</string>
<string name="title_setup_quick_success">An account and an identity have successfully been added</string>
<string name="title_setup_quick_failed">You can try to configure an account and an identity below too</string>

Loading…
Cancel
Save