mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-03 07:36:31 +02:00
Added error title
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user