Update "GIFs moved" education tooltip.

This commit is contained in:
Greyson Parrelli
2021-06-03 20:34:53 -04:00
parent d0e2fbf8e7
commit 1475a77260
5 changed files with 20 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ public class AttachmentKeyboard extends FrameLayout implements InputAwareLayout.
private static final List<AttachmentKeyboardButton> DEFAULT_BUTTONS = Arrays.asList(
AttachmentKeyboardButton.GALLERY,
AttachmentKeyboardButton.GIF,
AttachmentKeyboardButton.FILE,
AttachmentKeyboardButton.PAYMENT,
AttachmentKeyboardButton.CONTACT,

View File

@@ -8,6 +8,7 @@ import org.thoughtcrime.securesms.R;
public enum AttachmentKeyboardButton {
GALLERY(R.string.AttachmentKeyboard_gallery, R.drawable.ic_photo_album_outline_32),
GIF(R.string.AttachmentKeyboard_gif, R.drawable.ic_gif_outline_32),
FILE(R.string.AttachmentKeyboard_file, R.drawable.ic_file_outline_32),
PAYMENT(R.string.AttachmentKeyboard_payment, R.drawable.ic_payments_32),
CONTACT(R.string.AttachmentKeyboard_contact, R.drawable.ic_contact_circle_outline_32),

View File

@@ -1104,7 +1104,15 @@ public class ConversationActivity extends PassphraseRequiredActivity
case GALLERY:
AttachmentManager.selectGallery(this, MEDIA_SENDER, recipient.get(), composeText.getTextTrimmed(), sendButton.getSelectedTransport());
break;
case FILE:
case GIF:
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.ConversationActivity_gifs_have_moved)
.setMessage(R.string.ConversationActivity_look_for_gifs_next_to_emoji_and_stickers)
.setPositiveButton(android.R.string.ok, null)
.setOnDismissListener(unused -> inputPanel.showGifMovedTooltip())
.show();
break;
case FILE:
AttachmentManager.selectDocument(this, PICK_DOCUMENT);
break;
case CONTACT:
@@ -1422,16 +1430,6 @@ public class ConversationActivity extends PassphraseRequiredActivity
container.show(composeText, attachmentKeyboardStub.get());
viewModel.onAttachmentKeyboardOpen();
if (!SignalStore.tooltips().hasSeenGifsHaveMoved()) {
new MaterialAlertDialogBuilder(this)
.setTitle(R.string.ConversationActivity_gifs_have_moved)
.setMessage(R.string.ConversationActivity_look_for_gifs_next_to_emoji_and_stickers)
.setPositiveButton(android.R.string.ok, null)
.setOnDismissListener(unused -> inputPanel.showGifMovedTooltip())
.show();
SignalStore.tooltips().markGifsHaveMovedSeen();
}
}
} else {
handleManualMmsRequired();

View File

@@ -12,7 +12,6 @@ public class TooltipValues extends SignalStoreValues {
private static final String BLUR_HUD_ICON = "tooltip.blur_hud_icon";
private static final String GROUP_CALL_SPEAKER_VIEW = "tooltip.group_call_speaker_view";
private static final String GROUP_CALL_TOOLTIP_DISPLAY_COUNT = "tooltip.group_call_tooltip_display_count";
private static final String GIFS_HAVE_MOVED = "tooltip.gifs_have_moved";
TooltipValues(@NonNull KeyValueStore store) {
@@ -55,12 +54,4 @@ public class TooltipValues extends SignalStoreValues {
public void markGroupCallingLobbyEntered() {
putInteger(GROUP_CALL_TOOLTIP_DISPLAY_COUNT, Integer.MAX_VALUE);
}
public boolean hasSeenGifsHaveMoved() {
return getBoolean(GIFS_HAVE_MOVED, false);
}
public void markGifsHaveMovedSeen() {
putBoolean(GIFS_HAVE_MOVED, true);
}
}