mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
show and hide ephemeral message entry in chat menu depending on experimental feature switch
This commit is contained in:
committed by
Alexander Krotov
parent
b13b03c56b
commit
6cb57a4227
@@ -39,4 +39,8 @@
|
||||
android:icon="?menu_map_icon"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item android:id="@+id/menu_ephemeral_messages"
|
||||
android:title="@string/pref_ephemeral_messages"
|
||||
android:visible="false" />
|
||||
|
||||
</menu>
|
||||
|
||||
@@ -444,6 +444,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
menu.findItem(R.id.menu_show_map).setVisible(false);
|
||||
}
|
||||
|
||||
if (Prefs.isEphemeralMessagesEnabled(this)) {
|
||||
menu.findItem(R.id.menu_ephemeral_messages).setVisible(true);
|
||||
}
|
||||
|
||||
if (isGroupConversation()) {
|
||||
if (isActiveGroup()) {
|
||||
inflater.inflate(R.menu.conversation_push_group_options, menu);
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Prefs {
|
||||
private static final String PROMPTED_DOZE_MSG_ID_PREF = "pref_prompted_doze_msg_id";
|
||||
private static final String IN_THREAD_NOTIFICATION_PREF = "pref_key_inthread_notifications";
|
||||
public static final String MESSAGE_BODY_TEXT_SIZE_PREF = "pref_message_body_text_size";
|
||||
public static final String EPHEMERAL_MESSAGES_PREF = "pref_ephemeral_messages";
|
||||
|
||||
public static final String NOTIFICATION_PRIVACY_PREF = "pref_notification_privacy";
|
||||
public static final String NOTIFICATION_PRIORITY_PREF = "pref_notification_priority";
|
||||
@@ -186,6 +187,10 @@ public class Prefs {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEphemeralMessagesEnabled(Context context) {
|
||||
return getBooleanPreference(context, EPHEMERAL_MESSAGES_PREF, false);
|
||||
}
|
||||
|
||||
// ringtone
|
||||
|
||||
public static @NonNull Uri getNotificationRingtone(Context context) {
|
||||
|
||||
Reference in New Issue
Block a user