Prepare edit message for beta run.
This commit is contained in:
parent
d0a232d86a
commit
f23e5bdb44
5 changed files with 37 additions and 2 deletions
|
@ -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";
|
||||
|
||||
|
|
|
@ -6116,6 +6116,15 @@
|
|||
|
||||
<!-- Title shown at top of bottom sheet dialog for displaying a message\'s edit history -->
|
||||
<string name="EditMessageHistoryDialog_title">Edit history</string>
|
||||
<!-- Title of dialog shown alerting user that edit message is in beta only -->
|
||||
<string name="SendingEditMessageBetaOnlyDialog_title">Signal beta only</string>
|
||||
<!-- Body of dialog shown alerting user that edit message is in beta only and only sent to beta users. -->
|
||||
<string name="SendingEditMessageBetaOnlyDialog_body">Editing messages is available to Signal beta users only. If you edit a message, it will only be visible to people who are on the latest version of Signal beta.</string>
|
||||
<!-- Button to cancel sending edit message as it is beta only -->
|
||||
<string name="SendingEditMessageBetaOnlyDialog_cancel">Cancel</string>
|
||||
<!-- Button to continue sending edit message despite it being beta only -->
|
||||
<string name="SendingEditMessageBetaOnlyDialog_send">Send</string>
|
||||
|
||||
|
||||
<!-- CallLinkDetailsFragment -->
|
||||
<!-- Displayed in action bar at the top of the fragment -->
|
||||
|
|
Loading…
Add table
Reference in a new issue