mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-24 11:45:28 +00:00
Prepare edit message for beta run.
This commit is contained in:
@@ -4215,6 +4215,11 @@ public class ConversationParentFragment extends Fragment
|
||||
return;
|
||||
}
|
||||
|
||||
if (SignalStore.uiHints().hasNotSeenEditMessageBetaAlert()) {
|
||||
Dialogs.showEditMessageBetaDialog(requireContext(), this::handleSendEditMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageRecord editMessage = inputPanel.getEditMessage();
|
||||
if (editMessage == null) {
|
||||
Log.w(TAG, "No edit message found, forcing exit");
|
||||
|
||||
@@ -16,6 +16,7 @@ public class UiHints extends SignalStoreValues {
|
||||
private static final String HAS_SEEN_SCHEDULED_MESSAGES_INFO_ONCE = "uihints.has_seen_scheduled_messages_info_once";
|
||||
private static final String HAS_SEEN_USERNAME_EDUCATION = "uihints.has_seen_username_education";
|
||||
private static final String HAS_SEEN_TEXT_FORMATTING_ALERT = "uihints.text_formatting.has_seen_alert";
|
||||
private static final String HAS_NOT_SEEN_EDIT_MESSAGE_BETA_ALERT = "uihints.edit_message.has_not_seen_beta_alert";
|
||||
|
||||
UiHints(@NonNull KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -100,4 +101,12 @@ public class UiHints extends SignalStoreValues {
|
||||
public void markHasSeenTextFormattingAlert() {
|
||||
putBoolean(HAS_SEEN_TEXT_FORMATTING_ALERT, false);
|
||||
}
|
||||
|
||||
public boolean hasNotSeenEditMessageBetaAlert() {
|
||||
return getBoolean(HAS_NOT_SEEN_EDIT_MESSAGE_BETA_ALERT, true);
|
||||
}
|
||||
|
||||
public void markHasSeenEditMessageBetaAlert() {
|
||||
putBoolean(HAS_NOT_SEEN_EDIT_MESSAGE_BETA_ALERT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ public class Dialogs {
|
||||
.show();
|
||||
}
|
||||
|
||||
public static void showEditMessageBetaDialog(@NonNull Context context, @NonNull Runnable onSendAnyway) {
|
||||
new MaterialAlertDialogBuilder(context)
|
||||
.setTitle(R.string.SendingEditMessageBetaOnlyDialog_title)
|
||||
.setMessage(R.string.SendingEditMessageBetaOnlyDialog_body)
|
||||
.setNegativeButton(R.string.SendingEditMessageBetaOnlyDialog_cancel, null)
|
||||
.setPositiveButton(R.string.SendingEditMessageBetaOnlyDialog_send, (d, w) -> {
|
||||
SignalStore.uiHints().markHasSeenEditMessageBetaAlert();
|
||||
onSendAnyway.run();
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
public static void showUpgradeSignalDialog(@NonNull Context context) {
|
||||
new MaterialAlertDialogBuilder(context)
|
||||
.setTitle(R.string.UpdateSignalExpiredDialog__title)
|
||||
|
||||
@@ -105,8 +105,8 @@ public final class FeatureFlags {
|
||||
private static final String TEXT_FORMATTING = "android.textFormatting.2";
|
||||
private static final String ANY_ADDRESS_PORTS_KILL_SWITCH = "android.calling.fieldTrial.anyAddressPortsKillSwitch";
|
||||
private static final String AD_HOC_CALLING = "android.calling.ad.hoc.2";
|
||||
private static final String EDIT_MESSAGE_RECEIVE = "android.editMessage.receive";
|
||||
private static final String EDIT_MESSAGE_SEND = "android.editMessage.send";
|
||||
private static final String EDIT_MESSAGE_RECEIVE = "android.editMessage.receive.2";
|
||||
private static final String EDIT_MESSAGE_SEND = "android.editMessage.send.2";
|
||||
private static final String MAX_ATTACHMENT_COUNT = "android.attachments.maxCount";
|
||||
private static final String MAX_ATTACHMENT_SIZE_MB = "android.attachments.maxSize";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user