Updated MOTD

pull/215/head
M66B 1 year ago
parent abc0755e28
commit ec94247fcc

@ -859,9 +859,7 @@ public class ApplicationEx extends Application
if (Helper.isGoogle()) if (Helper.isGoogle())
editor.putBoolean("mod", true); editor.putBoolean("mod", true);
} else if (version < 2170) { } else if (version < 2170) {
if (Build.PRODUCT == null || !Build.PRODUCT.endsWith("_beta") || editor.putBoolean("mod", false);
Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
editor.putBoolean("mod", false);
} else if (version < 2180) { } else if (version < 2180) {
if (Helper.isAndroid15()) if (Helper.isAndroid15())
editor.putInt("last_sdk", 0); editor.putInt("last_sdk", 0);
@ -870,6 +868,8 @@ public class ApplicationEx extends Application
editor.putBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE); editor.putBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE);
if (!prefs.contains("delete_unseen")) if (!prefs.contains("delete_unseen"))
editor.putBoolean("delete_unseen", false); editor.putBoolean("delete_unseen", false);
if (Helper.isPixelBeta())
editor.putBoolean("motd", true);
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)

@ -259,7 +259,7 @@ public class FragmentMessages extends FragmentBase
private ImageButton ibHintSelect; private ImageButton ibHintSelect;
private ImageButton ibHintJunk; private ImageButton ibHintJunk;
private TextView tvMod; private TextView tvMod;
private ImageButton ibMod; private ImageButton ibMotd;
private TextView tvNoEmail; private TextView tvNoEmail;
private TextView tvNoEmailHint; private TextView tvNoEmailHint;
private FixedRecyclerView rvMessage; private FixedRecyclerView rvMessage;
@ -285,7 +285,7 @@ public class FragmentMessages extends FragmentBase
private Group grpHintSwipe; private Group grpHintSwipe;
private Group grpHintSelect; private Group grpHintSelect;
private Group grpHintJunk; private Group grpHintJunk;
private Group grpMod; private Group grpMotd;
private Group grpReady; private Group grpReady;
private Group grpOutbox; private Group grpOutbox;
private FloatingActionButton fabReply; private FloatingActionButton fabReply;
@ -583,8 +583,8 @@ public class FragmentMessages extends FragmentBase
ibHintSwipe = view.findViewById(R.id.ibHintSwipe); ibHintSwipe = view.findViewById(R.id.ibHintSwipe);
ibHintSelect = view.findViewById(R.id.ibHintSelect); ibHintSelect = view.findViewById(R.id.ibHintSelect);
ibHintJunk = view.findViewById(R.id.ibHintJunk); ibHintJunk = view.findViewById(R.id.ibHintJunk);
tvMod = view.findViewById(R.id.tvMod); tvMod = view.findViewById(R.id.tvMotd);
ibMod = view.findViewById(R.id.ibMod); ibMotd = view.findViewById(R.id.ibMotd);
tvNoEmail = view.findViewById(R.id.tvNoEmail); tvNoEmail = view.findViewById(R.id.tvNoEmail);
tvNoEmailHint = view.findViewById(R.id.tvNoEmailHint); tvNoEmailHint = view.findViewById(R.id.tvNoEmailHint);
rvMessage = view.findViewById(R.id.rvMessage); rvMessage = view.findViewById(R.id.rvMessage);
@ -611,7 +611,7 @@ public class FragmentMessages extends FragmentBase
grpHintSwipe = view.findViewById(R.id.grpHintSwipe); grpHintSwipe = view.findViewById(R.id.grpHintSwipe);
grpHintSelect = view.findViewById(R.id.grpHintSelect); grpHintSelect = view.findViewById(R.id.grpHintSelect);
grpHintJunk = view.findViewById(R.id.grpHintJunk); grpHintJunk = view.findViewById(R.id.grpHintJunk);
grpMod = view.findViewById(R.id.grpMod); grpMotd = view.findViewById(R.id.grpMotd);
grpReady = view.findViewById(R.id.grpReady); grpReady = view.findViewById(R.id.grpReady);
grpOutbox = view.findViewById(R.id.grpOutbox); grpOutbox = view.findViewById(R.id.grpOutbox);
@ -729,14 +729,14 @@ public class FragmentMessages extends FragmentBase
} }
}); });
if (Helper.isGoogle()) if (Helper.isPixelBeta())
tvMod.setText(getString(R.string.app_mod1)); tvMod.setText(getString(R.string.app_motd));
ibMod.setOnClickListener(new View.OnClickListener() { ibMotd.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
prefs.edit().putBoolean("mod", false).apply(); prefs.edit().putBoolean("motd", false).apply();
grpMod.setVisibility(View.GONE); grpMotd.setVisibility(View.GONE);
} }
}); });
@ -5228,14 +5228,14 @@ public class FragmentMessages extends FragmentBase
boolean message_swipe = prefs.getBoolean("message_swipe", false); boolean message_swipe = prefs.getBoolean("message_swipe", false);
boolean message_select = prefs.getBoolean("message_select", false); boolean message_select = prefs.getBoolean("message_select", false);
boolean message_junk = prefs.getBoolean("message_junk", 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); boolean send_pending = prefs.getBoolean("send_pending", true);
grpHintSupport.setVisibility(app_support || !hints || junk ? View.GONE : View.VISIBLE); grpHintSupport.setVisibility(app_support || !hints || junk ? View.GONE : View.VISIBLE);
grpHintSwipe.setVisibility(message_swipe || !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); grpHintSelect.setVisibility(message_select || !hints || junk ? View.GONE : View.VISIBLE);
grpHintJunk.setVisibility(message_junk || !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()); final DB db = DB.getInstance(getContext());

@ -325,7 +325,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"redmi_note", "redmi_note",
"accept_space", "accept_unsupported", "accept_space", "accept_unsupported",
"junk_hint", "junk_hint",
"last_update_check", "last_announcement_check" "last_update_check", "last_announcement_check",
"motd"
}; };
@Override @Override

@ -1521,6 +1521,12 @@ public class Helper {
return "Google".equalsIgnoreCase(Build.MANUFACTURER); 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() { static boolean isSamsung() {
return "Samsung".equalsIgnoreCase(Build.MANUFACTURER); return "Samsung".equalsIgnoreCase(Build.MANUFACTURER);
} }

@ -271,7 +271,7 @@
app:layout_constraintTop_toBottomOf="@id/tvHintJunk" /> app:layout_constraintTop_toBottomOf="@id/tvHintJunk" />
<TextView <TextView
android:id="@+id/tvMod" android:id="@+id/tvMotd"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
@ -279,20 +279,20 @@
android:padding="6dp" android:padding="6dp"
android:text="Message of the day" android:text="Message of the day"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibMod" app:layout_constraintEnd_toStartOf="@+id/ibMotd"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintJunk" /> app:layout_constraintTop_toBottomOf="@id/vSeparatorHintJunk" />
<ImageButton <ImageButton
android:id="@+id/ibMod" android:id="@+id/ibMotd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_close_hint" android:contentDescription="@string/title_legend_close_hint"
android:padding="9dp" android:padding="9dp"
app:layout_constraintBottom_toBottomOf="@id/tvMod" app:layout_constraintBottom_toBottomOf="@id/tvMotd"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvMod" app:layout_constraintTop_toTopOf="@id/tvMotd"
app:srcCompat="@drawable/twotone_close_24" /> app:srcCompat="@drawable/twotone_close_24" />
<View <View
@ -301,7 +301,7 @@
android:layout_height="1dp" android:layout_height="1dp"
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMod" /> app:layout_constraintTop_toBottomOf="@id/tvMotd" />
<include <include
android:id="@+id/inGroup" android:id="@+id/inGroup"
@ -597,10 +597,10 @@
app:constraint_referenced_ids="tvHintJunk,ibHintJunk,vSeparatorHintJunk" /> app:constraint_referenced_ids="tvHintJunk,ibHintJunk,vSeparatorHintJunk" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpMod" android:id="@+id/grpMotd"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvMod,ibMod,vSeparatorMod" /> app:constraint_referenced_ids="tvMotd,ibMotd,vSeparatorMod" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpReady" android:id="@+id/grpReady"

@ -19,9 +19,10 @@
<string name="app_download">Downloaded from: %1$s</string> <string name="app_download">Downloaded from: %1$s</string>
<string name="app_dmarc" translatable="false">DMARC</string> <string name="app_dmarc" translatable="false">DMARC</string>
<string name="app_mod1"> <string name="app_motd">
The March security update is causing \'App not responding\' messages, exclusively on Google Pixel devices. With Android 14/15 beta, \'App not responding\' notifications occasionally occur.
Please do not blame the app for this, only Google can solve this! Google is working on a fix.
Please do not blame the app for this Android problem!
</string> </string>
<string name="channel_service">Monitor</string> <string name="channel_service">Monitor</string>

Loading…
Cancel
Save