diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java b/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java index ce000529c7..7dff8c17fe 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/InputPanel.java @@ -431,6 +431,14 @@ public class InputPanel extends LinearLayout microphoneRecorderView.unlockAction(); } + public void showGifMovedTooltip() { + TooltipPopup.forTarget(mediaKeyboard) + .setBackgroundTint(ContextCompat.getColor(getContext(), R.color.signal_accent_primary)) + .setTextColor(getResources().getColor(R.color.core_white)) + .setText(R.string.ConversationActivity__gifs_are_now_here) + .show(TooltipPopup.POSITION_ABOVE); + } + public interface Listener { void onRecorderStarted(); void onRecorderLocked(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java index 0da7de992e..df843381a9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java @@ -28,7 +28,6 @@ public class AttachmentKeyboard extends FrameLayout implements InputAwareLayout. private static final List DEFAULT_BUTTONS = Arrays.asList( AttachmentKeyboardButton.GALLERY, - AttachmentKeyboardButton.GIF, AttachmentKeyboardButton.FILE, AttachmentKeyboardButton.PAYMENT, AttachmentKeyboardButton.CONTACT, diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButton.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButton.java index db3bcd1252..0c7f2ed7ab 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButton.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButton.java @@ -8,7 +8,6 @@ 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), diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 1b08c5fc6b..1046bae7c6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -84,6 +84,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.transition.Transition; import com.google.android.material.button.MaterialButton; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; @@ -1103,10 +1104,7 @@ public class ConversationActivity extends PassphraseRequiredActivity case GALLERY: AttachmentManager.selectGallery(this, MEDIA_SENDER, recipient.get(), composeText.getTextTrimmed(), sendButton.getSelectedTransport()); break; - case GIF: - AttachmentManager.selectGif(this, PICK_GIF, !isSecureText); - break; - case FILE: + case FILE: AttachmentManager.selectDocument(this, PICK_DOCUMENT); break; case CONTACT: @@ -1424,6 +1422,16 @@ 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(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/keyvalue/TooltipValues.java b/app/src/main/java/org/thoughtcrime/securesms/keyvalue/TooltipValues.java index 6db83250f5..5ff1c7dbbe 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/keyvalue/TooltipValues.java +++ b/app/src/main/java/org/thoughtcrime/securesms/keyvalue/TooltipValues.java @@ -12,6 +12,7 @@ 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) { @@ -54,4 +55,12 @@ 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); + } } diff --git a/app/src/main/res/drawable/ic_gif_outline_32.xml b/app/src/main/res/drawable/ic_gif_outline_32.xml deleted file mode 100644 index 03260f34fe..0000000000 --- a/app/src/main/res/drawable/ic_gif_outline_32.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bd532f13e5..9b0b722aea 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -287,6 +287,10 @@ Reported as spam and blocked. + GIFs have moved + Look for GIFs next to emoji and stickers. + GIFs are now here. + %d unread message