Added message of the day

This commit is contained in:
M66B 2024-03-13 18:59:57 +01:00
parent 9d0cf73bcf
commit dc63e31380
4 changed files with 67 additions and 1 deletions

View File

@ -854,6 +854,9 @@ public class ApplicationEx extends Application
} else if (version < 2162) {
if (!BuildConfig.DEBUG)
editor.putBoolean("tabular_unread_bg", false);
} else if (version < 2168) {
if (Helper.isGoogle())
editor.putBoolean("mod", true);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)

View File

@ -255,6 +255,8 @@ public class FragmentMessages extends FragmentBase
private ImageButton ibHintSwipe;
private ImageButton ibHintSelect;
private ImageButton ibHintJunk;
private TextView tvMod;
private ImageButton ibMod;
private TextView tvNoEmail;
private TextView tvNoEmailHint;
private FixedRecyclerView rvMessage;
@ -280,6 +282,7 @@ public class FragmentMessages extends FragmentBase
private Group grpHintSwipe;
private Group grpHintSelect;
private Group grpHintJunk;
private Group grpMod;
private Group grpReady;
private Group grpOutbox;
private FloatingActionButton fabReply;
@ -577,6 +580,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);
tvNoEmail = view.findViewById(R.id.tvNoEmail);
tvNoEmailHint = view.findViewById(R.id.tvNoEmailHint);
rvMessage = view.findViewById(R.id.rvMessage);
@ -603,6 +608,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);
grpReady = view.findViewById(R.id.grpReady);
grpOutbox = view.findViewById(R.id.grpOutbox);
@ -719,6 +725,17 @@ public class FragmentMessages extends FragmentBase
}
});
if (Helper.isGoogle())
tvMod.setText(getString(R.string.app_mod1));
ibMod.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putBoolean("mod", false).apply();
grpMod.setVisibility(View.GONE);
}
});
rvMessage.setHasFixedSize(false);
rvMessage.setItemViewCacheSize(ITEM_CACHE_SIZE);
@ -5182,12 +5199,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 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);
final DB db = DB.getInstance(getContext());

View File

@ -270,6 +270,39 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHintJunk" />
<TextView
android:id="@+id/tvMod"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="36dp"
android:padding="6dp"
android:text="Message of the day"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibMod"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintJunk" />
<ImageButton
android:id="@+id/ibMod"
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_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvMod"
app:srcCompat="@drawable/twotone_close_24" />
<View
android:id="@+id/vSeparatorMod"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMod" />
<include
android:id="@+id/inGroup"
layout="@layout/item_group"
@ -277,7 +310,7 @@
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintJunk" />
app:layout_constraintTop_toBottomOf="@id/vSeparatorMod" />
<eu.faircode.email.ViewTextDelayed
android:id="@+id/tvNoEmail"
@ -559,6 +592,12 @@
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintJunk,ibHintJunk,vSeparatorHintJunk" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpMod"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvMod,ibMod,vSeparatorMod" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpReady"
android:layout_width="0dp"

View File

@ -19,6 +19,11 @@
<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>
<string name="channel_service">Monitor</string>
<string name="channel_send">Send</string>
<string name="channel_notification">Email</string>