From c7d2ed4f7d59268de308a1e462ce6cb4074bb55e Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Thu, 14 May 2015 14:57:47 -0700 Subject: [PATCH] Fix 2.3.x fragment LayoutParams issue. Closes #3167 // FREEBIE --- res/layout/conversation_activity.xml | 6 +++--- src/org/thoughtcrime/securesms/ConversationActivity.java | 2 +- .../securesms/components/emoji/EmojiDrawer.java | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/res/layout/conversation_activity.xml b/res/layout/conversation_activity.xml index 7a9fe546c8..584d735204 100644 --- a/res/layout/conversation_activity.xml +++ b/res/layout/conversation_activity.xml @@ -123,8 +123,8 @@ - + diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 844ca5a450..e4999e15e3 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -711,7 +711,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity EmojiDrawer emojiDrawerFragment = EmojiDrawer.newInstance(); emojiDrawerFragment.setComposeEditText(composeText); getSupportFragmentManager().beginTransaction() - .replace(R.id.emoji_drawer, emojiDrawerFragment) + .add(R.id.emoji_drawer, emojiDrawerFragment) .commit(); getSupportFragmentManager().executePendingTransactions(); emojiDrawer = Optional.of(emojiDrawerFragment); diff --git a/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java b/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java index 40bd7945c5..577e19984f 100644 --- a/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java +++ b/src/org/thoughtcrime/securesms/components/emoji/EmojiDrawer.java @@ -14,6 +14,7 @@ import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; @@ -86,7 +87,7 @@ public class EmojiDrawer extends Fragment { public void show() { int keyboardHeight = container.getKeyboardHeight(); Log.w("EmojiDrawer", "setting emoji drawer to height " + keyboardHeight); - container.setLayoutParams(new LinearLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, keyboardHeight)); + container.setLayoutParams(new FrameLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, keyboardHeight)); container.requestLayout(); container.setVisibility(View.VISIBLE); }