Added error title

pull/168/head
M66B 5 years ago
parent 44dd58d0d1
commit 4625f39035

@ -138,6 +138,7 @@ public class FragmentAccount extends FragmentBase {
private Group grpAuthorize;
private Group grpAdvanced;
private Group grpFolders;
private Group grpError;
private long id = -1;
private long copy = -1;
@ -238,6 +239,7 @@ public class FragmentAccount extends FragmentBase {
grpAuthorize = view.findViewById(R.id.grpAuthorize);
grpAdvanced = view.findViewById(R.id.grpAdvanced);
grpFolders = view.findViewById(R.id.grpFolders);
grpError = view.findViewById(R.id.grpError);
// Wire controls
@ -435,7 +437,6 @@ public class FragmentAccount extends FragmentBase {
pbSave.setVisibility(View.GONE);
cbIdentity.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -445,6 +446,7 @@ public class FragmentAccount extends FragmentBase {
grpAuthorize.setVisibility(View.GONE);
grpAdvanced.setVisibility(View.GONE);
grpFolders.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
return view;
}
@ -513,7 +515,7 @@ public class FragmentAccount extends FragmentBase {
tvIdle.setVisibility(View.GONE);
tvUtf8.setVisibility(View.GONE);
grpFolders.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -738,7 +740,7 @@ public class FragmentAccount extends FragmentBase {
getActivity().invalidateOptionsMenu();
Helper.setViewsEnabled(view, false);
pbSave.setVisibility(View.VISIBLE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -1148,7 +1150,7 @@ public class FragmentAccount extends FragmentBase {
private void showError(Throwable ex) {
tvError.setText(Helper.formatThrowable(ex, false));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
final EmailProvider provider = (EmailProvider) spProvider.getSelectedItem();
if (provider != null && provider.link != null) {

@ -47,6 +47,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import java.util.ArrayList;
import java.util.Date;
@ -66,6 +67,7 @@ public class FragmentGmail extends FragmentBase {
private ContentLoadingProgressBar pbSelect;
private TextView tvError;
private Group grpError;
@Override
@Nullable
@ -84,6 +86,7 @@ public class FragmentGmail extends FragmentBase {
pbSelect = view.findViewById(R.id.pbSelect);
tvError = view.findViewById(R.id.tvError);
grpError = view.findViewById(R.id.grpError);
List<String> permissions = new ArrayList<>();
permissions.add(Manifest.permission.READ_CONTACTS); // profile
@ -105,11 +108,11 @@ public class FragmentGmail extends FragmentBase {
String name = etName.getText().toString().trim();
if (TextUtils.isEmpty(name)) {
tvError.setText(R.string.title_no_name);
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
return;
}
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
startActivityForResult(
Helper.getChooser(getContext(), newChooseAccountIntent(
@ -128,7 +131,7 @@ public class FragmentGmail extends FragmentBase {
// Initialize
Helper.setViewsEnabled(view, false);
pbSelect.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
boolean granted = true;
for (String permission : permissions)
@ -240,7 +243,7 @@ public class FragmentGmail extends FragmentBase {
} catch (Throwable ex) {
Log.e(ex);
tvError.setText(Helper.formatThrowable(ex));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
new Handler().post(new Runnable() {
@Override
@ -401,7 +404,7 @@ public class FragmentGmail extends FragmentBase {
tvError.setText(ex.getMessage());
else
tvError.setText(Helper.formatThrowable(ex));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
new Handler().post(new Runnable() {
@Override

@ -120,6 +120,7 @@ public class FragmentIdentity extends FragmentBase {
private Group grpAuthorize;
private Group grpAdvanced;
private Group grpError;
private long id = -1;
private long copy = -1;
@ -201,6 +202,7 @@ public class FragmentIdentity extends FragmentBase {
grpAuthorize = view.findViewById(R.id.grpAuthorize);
grpAdvanced = view.findViewById(R.id.grpAdvanced);
grpError = view.findViewById(R.id.grpError);
// Wire controls
@ -209,7 +211,7 @@ public class FragmentIdentity extends FragmentBase {
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
grpAuthorize.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
if (position == 0) {
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -428,13 +430,13 @@ public class FragmentIdentity extends FragmentBase {
btnSave.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
grpAuthorize.setVisibility(View.GONE);
grpAdvanced.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
return view;
}
@ -530,7 +532,7 @@ public class FragmentIdentity extends FragmentBase {
getActivity().invalidateOptionsMenu();
Helper.setViewsEnabled(view, false);
pbSave.setVisibility(View.VISIBLE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -803,7 +805,7 @@ public class FragmentIdentity extends FragmentBase {
private void showError(Throwable ex) {
tvError.setText(Helper.formatThrowable(ex, false));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
final EmailProvider provider = (EmailProvider) spProvider.getSelectedItem();
if (provider != null && provider.link != null) {

@ -43,6 +43,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Lifecycle;
import com.google.android.material.snackbar.Snackbar;
@ -77,6 +78,7 @@ public class FragmentPop extends FragmentBase {
private Button btnSave;
private ContentLoadingProgressBar pbSave;
private TextView tvError;
private Group grpError;
private ContentLoadingProgressBar pbWait;
@ -125,6 +127,7 @@ public class FragmentPop extends FragmentBase {
pbSave = view.findViewById(R.id.pbSave);
tvError = view.findViewById(R.id.tvError);
grpError = view.findViewById(R.id.grpError);
pbWait = view.findViewById(R.id.pbWait);
@ -165,7 +168,7 @@ public class FragmentPop extends FragmentBase {
tilPassword.setEndIconMode(id < 0 ? END_ICON_PASSWORD_TOGGLE : END_ICON_NONE);
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
return view;
}
@ -195,7 +198,7 @@ public class FragmentPop extends FragmentBase {
saving = true;
getActivity().invalidateOptionsMenu();
Helper.setViewsEnabled(view, false);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
}
@Override
@ -398,7 +401,7 @@ public class FragmentPop extends FragmentBase {
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
else {
tvError.setText(Helper.formatThrowable(ex, false));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
new Handler().post(new Runnable() {
@Override

@ -73,6 +73,7 @@ public class FragmentQuickSetup extends FragmentBase {
private ContentLoadingProgressBar pbSave;
private Group grpSetup;
private Group grpError;
@Override
@Nullable
@ -101,6 +102,7 @@ public class FragmentQuickSetup extends FragmentBase {
pbSave = view.findViewById(R.id.pbSave);
grpSetup = view.findViewById(R.id.grpSetup);
grpError = view.findViewById(R.id.grpError);
// Wire controls
@ -149,12 +151,12 @@ public class FragmentQuickSetup extends FragmentBase {
// Initialize
pbCheck.setVisibility(View.GONE);
pbSave.setVisibility(View.GONE);
tvError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
tvInstructions.setMovementMethod(LinkMovementMethod.getInstance());
grpSetup.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
return view;
}
@ -200,7 +202,7 @@ public class FragmentQuickSetup extends FragmentBase {
Helper.setViewsEnabled(view, false);
pbCheck.setVisibility(check ? View.VISIBLE : View.GONE);
pbSave.setVisibility(check ? View.GONE : View.VISIBLE);
tvError.setVisibility(View.GONE);
grpError.setVisibility(View.GONE);
btnHelp.setVisibility(View.GONE);
btnSupport.setVisibility(View.GONE);
tvInstructions.setVisibility(View.GONE);
@ -376,7 +378,7 @@ public class FragmentQuickSetup extends FragmentBase {
if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException) {
tvError.setText(ex.getMessage());
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
new Handler().post(new Runnable() {
@Override
@ -386,7 +388,7 @@ public class FragmentQuickSetup extends FragmentBase {
});
} else {
tvError.setText(Helper.formatThrowable(ex, false));
tvError.setVisibility(View.VISIBLE);
grpError.setVisibility(View.VISIBLE);
if (args.containsKey("link")) {
Uri uri = Uri.parse(args.getString("link"));

@ -786,17 +786,28 @@
app:layout_constraintTop_toBottomOf="@id/btnSave" />
<TextView
android:id="@+id/tvError"
android:id="@+id/tvErrorTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_error"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbIdentity" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error"
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/cbIdentity" />
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<Button
android:id="@+id/btnHelp"
@ -884,5 +895,11 @@
tvJunk,spJunk,
vSeparatorSwipe,tvLeft,spLeft,tvRight,spRight,
vSeparatorMove,tvMove,spMove" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -85,16 +85,33 @@
app:layout_constraintTop_toTopOf="@id/btnSelect" />
<TextView
android:id="@+id/tvError"
android:id="@+id/tvErrorTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_error"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSelect" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error"
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/btnSelect" />
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -594,17 +594,28 @@
app:layout_constraintTop_toTopOf="@id/btnSave" />
<TextView
android:id="@+id/tvError"
android:id="@+id/tvErrorTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_error"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSave" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error"
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/btnSave" />
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<Button
android:id="@+id/btnHelp"
@ -675,5 +686,11 @@
cbSynchronize,cbPrimary,
cbSenderExtra,tvSenderExtra,etSenderExtra,tvSenderExtraHint,
tvReplyTo,etReplyTo,tvBcc,etBcc" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -323,17 +323,28 @@
app:layout_constraintTop_toTopOf="@id/btnSave" />
<TextView
android:id="@+id/tvError"
android:id="@+id/tvErrorTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_error"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSave" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error"
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/btnSave" />
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbWait"
@ -345,5 +356,11 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -94,17 +94,28 @@
app:layout_constraintTop_toTopOf="@id/btnCheck" />
<TextView
android:id="@+id/tvError"
android:id="@+id/tvErrorTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_error"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCheck" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="error"
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/btnCheck" />
app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />
<Button
android:id="@+id/btnHelp"
@ -206,5 +217,11 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvImapTitle,tvImap,tvSmtpTitle,tvSmtp,btnSave" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpError"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvErrorTitle,tvError" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -167,6 +167,7 @@
<string name="title_setup_go">Go</string>
<string name="title_setup_to_do">To do</string>
<string name="title_setup_done">Done</string>
<string name="title_setup_error">Error</string>
<string name="title_setup_export">Export settings</string>
<string name="title_setup_import">Import settings</string>

Loading…
Cancel
Save