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