diff --git a/app/src/main/java/eu/faircode/email/ActivityError.java b/app/src/main/java/eu/faircode/email/ActivityError.java index 9a87bb5376..635700a0f8 100644 --- a/app/src/main/java/eu/faircode/email/ActivityError.java +++ b/app/src/main/java/eu/faircode/email/ActivityError.java @@ -42,18 +42,31 @@ public class ActivityError extends ActivityBase { TextView tvTitle = view.findViewById(R.id.tvTitle); TextView tvMessage = view.findViewById(R.id.tvMessage); + ImageButton ibSetting = view.findViewById(R.id.ibSetting); ImageButton ibInfo = view.findViewById(R.id.ibInfo); Intent intent = getIntent(); String type = intent.getStringExtra("type"); String title = intent.getStringExtra("title"); String message = intent.getStringExtra("message"); + long account = intent.getLongExtra("account", -1L); int faq = intent.getIntExtra("faq", -1); tvTitle.setText(title); tvMessage.setMovementMethod(LinkMovementMethod.getInstance()); tvMessage.setText(message); + ibSetting.setVisibility(account < 0 ? View.GONE : View.VISIBLE); + ibSetting.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(view.getContext(), ActivitySetup.class) + .setAction("target:accounts") + .putExtra("target", "accounts"); + startActivity(intent); + } + }); + ibInfo.setVisibility(faq > 0 ? View.VISIBLE : View.GONE); ibInfo.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index a8de713baf..c9f9b8c2e6 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -4902,6 +4902,7 @@ class Core { intent.putExtra("type", channel); intent.putExtra("title", title); intent.putExtra("message", message); + intent.putExtra("account", account.id); intent.putExtra("faq", 22); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntentCompat.getActivity( diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6fbff8fcda..2e80b4338a 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1171,6 +1171,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences intent.putExtra("type", "alert"); intent.putExtra("title", title); intent.putExtra("message", message); + intent.putExtra("account", account.id); intent.putExtra("faq", 23); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piAlert = PendingIntentCompat.getActivity( diff --git a/app/src/main/res/layout/activity_error.xml b/app/src/main/res/layout/activity_error.xml index 0458bc30dc..ebc54ab464 100644 --- a/app/src/main/res/layout/activity_error.xml +++ b/app/src/main/res/layout/activity_error.xml @@ -41,6 +41,9 @@ android:id="@+id/tvTitle" android:layout_width="0dp" android:layout_height="wrap_content" + android:drawableStart="@drawable/twotone_warning_24" + android:drawablePadding="6dp" + android:drawableTint="?attr/colorError" android:text="Error" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textColor="?android:attr/textColorPrimary" @@ -53,7 +56,7 @@ android:id="@+id/tvMessage" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginTop="12dp" + android:layout_marginTop="24dp" android:autoLink="all" android:text="Error" android:textAppearance="@style/TextAppearance.AppCompat.Small" @@ -64,11 +67,22 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvTitle" /> + +