From 44df1128affd259c175c7f7387bd0c727cb640a1 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Wed, 8 Jul 2015 17:33:03 -0700 Subject: [PATCH] Disable quick capture on popup Closes #3568 // FREEBIE --- .../securesms/ConversationActivity.java | 18 +++++++++--------- .../securesms/ConversationPopupActivity.java | 1 + .../components/camera/HidingImageButton.java | 7 +++++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index a2f81bf938..48bc9c28cd 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -174,14 +174,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity private View composePanel; private View composeBubble; - private AttachmentTypeSelectorAdapter attachmentAdapter; - private AttachmentManager attachmentManager; - private BroadcastReceiver securityUpdateReceiver; - private BroadcastReceiver groupUpdateReceiver; - private Optional emojiPopup = Optional.absent(); - private EmojiToggle emojiToggle; - private HidingImageButton quickAttachmentToggle; - private QuickAttachmentDrawer quickAttachmentDrawer; + private AttachmentTypeSelectorAdapter attachmentAdapter; + private AttachmentManager attachmentManager; + private BroadcastReceiver securityUpdateReceiver; + private BroadcastReceiver groupUpdateReceiver; + private Optional emojiPopup = Optional.absent(); + private EmojiToggle emojiToggle; + protected HidingImageButton quickAttachmentToggle; + private QuickAttachmentDrawer quickAttachmentDrawer; private Recipients recipients; private long threadId; @@ -848,7 +848,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity quickAttachmentDrawer.setListener(this); quickAttachmentToggle.setOnClickListener(new QuickAttachmentToggleListener()); } else { - quickAttachmentToggle.setVisibility(View.GONE); + quickAttachmentToggle.disable(); } } diff --git a/src/org/thoughtcrime/securesms/ConversationPopupActivity.java b/src/org/thoughtcrime/securesms/ConversationPopupActivity.java index 96d79d7862..d2ce2dd041 100644 --- a/src/org/thoughtcrime/securesms/ConversationPopupActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationPopupActivity.java @@ -56,6 +56,7 @@ public class ConversationPopupActivity extends ConversationActivity { protected void onResume() { super.onResume(); composeText.requestFocus(); + quickAttachmentToggle.disable(); } @Override diff --git a/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java b/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java index e82eefd533..e07bac37e0 100644 --- a/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java +++ b/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java @@ -26,6 +26,7 @@ public class HidingImageButton extends ImageButton { } public void hide() { + if (!isEnabled()) return; final Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.slide_to_right); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) {} @@ -38,6 +39,7 @@ public class HidingImageButton extends ImageButton { } public void show() { + if (!isEnabled()) return; setVisibility(VISIBLE); animateWith(AnimationUtils.loadAnimation(getContext(), R.anim.slide_from_right)); } @@ -47,4 +49,9 @@ public class HidingImageButton extends ImageButton { animation.setInterpolator(new FastOutSlowInInterpolator()); startAnimation(animation); } + + public void disable() { + setVisibility(GONE); + setEnabled(false); + } }