diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index af4b510aba..7941d311a4 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -859,9 +859,7 @@ public class ApplicationEx extends Application if (Helper.isGoogle()) editor.putBoolean("mod", true); } else if (version < 2170) { - if (Build.PRODUCT == null || !Build.PRODUCT.endsWith("_beta") || - Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) - editor.putBoolean("mod", false); + editor.putBoolean("mod", false); } else if (version < 2180) { if (Helper.isAndroid15()) editor.putInt("last_sdk", 0); @@ -870,6 +868,8 @@ public class ApplicationEx extends Application editor.putBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE); if (!prefs.contains("delete_unseen")) editor.putBoolean("delete_unseen", false); + if (Helper.isPixelBeta()) + editor.putBoolean("motd", true); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 8a40d94618..9e42a4ce8f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -259,7 +259,7 @@ public class FragmentMessages extends FragmentBase private ImageButton ibHintSelect; private ImageButton ibHintJunk; private TextView tvMod; - private ImageButton ibMod; + private ImageButton ibMotd; private TextView tvNoEmail; private TextView tvNoEmailHint; private FixedRecyclerView rvMessage; @@ -285,7 +285,7 @@ public class FragmentMessages extends FragmentBase private Group grpHintSwipe; private Group grpHintSelect; private Group grpHintJunk; - private Group grpMod; + private Group grpMotd; private Group grpReady; private Group grpOutbox; private FloatingActionButton fabReply; @@ -583,8 +583,8 @@ public class FragmentMessages extends FragmentBase ibHintSwipe = view.findViewById(R.id.ibHintSwipe); ibHintSelect = view.findViewById(R.id.ibHintSelect); ibHintJunk = view.findViewById(R.id.ibHintJunk); - tvMod = view.findViewById(R.id.tvMod); - ibMod = view.findViewById(R.id.ibMod); + tvMod = view.findViewById(R.id.tvMotd); + ibMotd = view.findViewById(R.id.ibMotd); tvNoEmail = view.findViewById(R.id.tvNoEmail); tvNoEmailHint = view.findViewById(R.id.tvNoEmailHint); rvMessage = view.findViewById(R.id.rvMessage); @@ -611,7 +611,7 @@ public class FragmentMessages extends FragmentBase grpHintSwipe = view.findViewById(R.id.grpHintSwipe); grpHintSelect = view.findViewById(R.id.grpHintSelect); grpHintJunk = view.findViewById(R.id.grpHintJunk); - grpMod = view.findViewById(R.id.grpMod); + grpMotd = view.findViewById(R.id.grpMotd); grpReady = view.findViewById(R.id.grpReady); grpOutbox = view.findViewById(R.id.grpOutbox); @@ -729,14 +729,14 @@ public class FragmentMessages extends FragmentBase } }); - if (Helper.isGoogle()) - tvMod.setText(getString(R.string.app_mod1)); + if (Helper.isPixelBeta()) + tvMod.setText(getString(R.string.app_motd)); - ibMod.setOnClickListener(new View.OnClickListener() { + ibMotd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - prefs.edit().putBoolean("mod", false).apply(); - grpMod.setVisibility(View.GONE); + prefs.edit().putBoolean("motd", false).apply(); + grpMotd.setVisibility(View.GONE); } }); @@ -5228,14 +5228,14 @@ public class FragmentMessages extends FragmentBase boolean message_swipe = prefs.getBoolean("message_swipe", false); boolean message_select = prefs.getBoolean("message_select", false); boolean message_junk = prefs.getBoolean("message_junk", false); - boolean mod = prefs.getBoolean("mod", false); + boolean motd = prefs.getBoolean("motd", false); boolean send_pending = prefs.getBoolean("send_pending", true); grpHintSupport.setVisibility(app_support || !hints || junk ? View.GONE : View.VISIBLE); grpHintSwipe.setVisibility(message_swipe || !hints || junk ? View.GONE : View.VISIBLE); grpHintSelect.setVisibility(message_select || !hints || junk ? View.GONE : View.VISIBLE); grpHintJunk.setVisibility(message_junk || !junk ? View.GONE : View.VISIBLE); - grpMod.setVisibility(mod ? View.VISIBLE : View.GONE); + grpMotd.setVisibility(motd ? View.VISIBLE : View.GONE); final DB db = DB.getInstance(getContext()); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 232c523f01..d4b2d35c61 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -325,7 +325,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc "redmi_note", "accept_space", "accept_unsupported", "junk_hint", - "last_update_check", "last_announcement_check" + "last_update_check", "last_announcement_check", + "motd" }; @Override diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 24d2c150b0..4f2e0f7971 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -1521,6 +1521,12 @@ public class Helper { return "Google".equalsIgnoreCase(Build.MANUFACTURER); } + static boolean isPixelBeta() { + return (isGoogle() && + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && + Build.PRODUCT != null && Build.PRODUCT.endsWith("_beta")); + } + static boolean isSamsung() { return "Samsung".equalsIgnoreCase(Build.MANUFACTURER); } diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index 70b1fadf61..2e7a639300 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -271,7 +271,7 @@ app:layout_constraintTop_toBottomOf="@id/tvHintJunk" /> + app:layout_constraintTop_toBottomOf="@id/tvMotd" /> + app:constraint_referenced_ids="tvMotd,ibMotd,vSeparatorMod" /> Downloaded from: %1$s DMARC - - The March security update is causing \'App not responding\' messages, exclusively on Google Pixel devices. - Please do not blame the app for this, only Google can solve this! + + With Android 14/15 beta, \'App not responding\' notifications occasionally occur. + Google is working on a fix. + Please do not blame the app for this Android problem! Monitor