Remove GIFs from attachment keyboard.

This commit is contained in:
Cody Henthorne
2021-06-03 13:05:38 -04:00
committed by GitHub
parent a3a4b10f83
commit 84e27e7bff
7 changed files with 33 additions and 15 deletions

View File

@@ -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();

View File

@@ -28,7 +28,6 @@ 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,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),

View File

@@ -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();

View File

@@ -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);
}
}