From 716ed251bca520c678052e3e0eed5089512a7f97 Mon Sep 17 00:00:00 2001 From: Mikhail Klementyev Date: Sat, 6 Aug 2016 04:49:25 +0300 Subject: [PATCH] Use gravity instead of calculations For avoid freezes when trying to add an attachment Fixes #5583 Closes #5601 // FREEBIE --- .../securesms/components/AttachmentTypeSelector.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/components/AttachmentTypeSelector.java b/src/org/thoughtcrime/securesms/components/AttachmentTypeSelector.java index 43cca287f9..0898f51e62 100644 --- a/src/org/thoughtcrime/securesms/components/AttachmentTypeSelector.java +++ b/src/org/thoughtcrime/securesms/components/AttachmentTypeSelector.java @@ -90,8 +90,7 @@ public class AttachmentTypeSelector extends PopupWindow { public void show(@NonNull Activity activity, final @NonNull View anchor) { this.currentAnchor = anchor; - int screenHeight = activity.getWindowManager().getDefaultDisplay().getHeight(); - showAtLocation(anchor, Gravity.NO_GRAVITY, 0, screenHeight - getHeight()); + showAtLocation(anchor, Gravity.BOTTOM, 0, 0); getContentView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override