Updated MOTD

This commit is contained in:
M66B 2024-05-25 14:44:16 +02:00
parent abc0755e28
commit ec94247fcc
6 changed files with 35 additions and 27 deletions

View File

@ -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)

View File

@ -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());

View File

@ -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

View File

@ -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);
}

View File

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

View File

@ -19,9 +19,10 @@
<string name="app_download">Downloaded from: %1$s</string>
<string name="app_dmarc" translatable="false">DMARC</string>
<string name="app_mod1">
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!
<string name="app_motd">
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!
</string>
<string name="channel_service">Monitor</string>