Revert "possible fix emoji picker flashing"

This reverts commit 1933de3c71.
This commit is contained in:
12aw 2024-03-01 15:35:51 +01:00
parent 10a5a923b1
commit eccbdaec31

View file

@ -4722,12 +4722,6 @@ public class ConversationFragment extends XmppFragment
} else if (activity != null && binding.emojiButton.getVisibility() == VISIBLE) { } else if (activity != null && binding.emojiButton.getVisibility() == VISIBLE) {
binding.emojiPicker.setVisibility(GONE); binding.emojiPicker.setVisibility(GONE);
binding.keyboardButton.setVisibility(GONE); binding.keyboardButton.setVisibility(GONE);
} else if (activity != null && binding.keyboardButton.getVisibility() == VISIBLE) {
binding.emojiPicker.setVisibility(VISIBLE);
} else {
binding.emojiButton.setVisibility(VISIBLE);
binding.emojiPicker.setVisibility(GONE);
binding.keyboardButton.setVisibility(GONE);
} }
if (activity != null && activity.xmppConnectionService != null && isKeyboardVisible && activity.xmppConnectionService.showTextFormatting()) { if (activity != null && activity.xmppConnectionService != null && isKeyboardVisible && activity.xmppConnectionService.showTextFormatting()) {
showTextFormat(me); showTextFormat(me);
@ -4743,7 +4737,7 @@ public class ConversationFragment extends XmppFragment
public void onKeyboardHeightChanged(int keyboardHeight, boolean keyboardOpen, boolean isLandscape) { public void onKeyboardHeightChanged(int keyboardHeight, boolean keyboardOpen, boolean isLandscape) {
Log.i("keyboard listener", "keyboardHeight: " + keyboardHeight + " keyboardOpen: " + keyboardOpen + " isLandscape: " + isLandscape); Log.i("keyboard listener", "keyboardHeight: " + keyboardHeight + " keyboardOpen: " + keyboardOpen + " isLandscape: " + isLandscape);
if (activity != null && keyboardOpen && !(secondaryFragment instanceof ConversationFragment)) { if (activity != null && keyboardOpen && !(secondaryFragment instanceof ConversationFragment)) {
EmojiPickerView emojipickerview = binding.emojiPicker; EmojiPickerView emojipickerview = (EmojiPickerView) activity.findViewById(R.id.emoji_picker);
binding.keyboardButton.setVisibility(GONE); binding.keyboardButton.setVisibility(GONE);
binding.emojiButton.setVisibility(VISIBLE); binding.emojiButton.setVisibility(VISIBLE);
ViewGroup.LayoutParams params = emojipickerview.getLayoutParams(); ViewGroup.LayoutParams params = emojipickerview.getLayoutParams();
@ -4751,24 +4745,15 @@ public class ConversationFragment extends XmppFragment
emojipickerview.setLayoutParams(params); emojipickerview.setLayoutParams(params);
binding.emojiPicker.setVisibility(VISIBLE); binding.emojiPicker.setVisibility(VISIBLE);
} else if (activity != null && keyboardOpen) { } else if (activity != null && keyboardOpen) {
EmojiPickerView emojipickerview = binding.emojiPicker; EmojiPickerView emojipickerview = (EmojiPickerView) activity.findViewById(R.id.emoji_picker);
binding.keyboardButton.setVisibility(GONE); binding.keyboardButton.setVisibility(GONE);
binding.emojiButton.setVisibility(VISIBLE); binding.emojiButton.setVisibility(VISIBLE);
ViewGroup.LayoutParams params = emojipickerview.getLayoutParams(); ViewGroup.LayoutParams params = emojipickerview.getLayoutParams();
params.height = keyboardHeight - 150; params.height = keyboardHeight - 150;
emojipickerview.setLayoutParams(params); emojipickerview.setLayoutParams(params);
binding.emojiPicker.setVisibility(VISIBLE); binding.emojiPicker.setVisibility(VISIBLE);
} else if (activity != null && binding.emojiButton.getVisibility() == VISIBLE) {
binding.emojiPicker.setVisibility(GONE);
binding.keyboardButton.setVisibility(GONE);
} else if (activity != null && binding.keyboardButton.getVisibility() == VISIBLE) {
binding.emojiPicker.setVisibility(VISIBLE);
} else if (activity != null ) { } else if (activity != null ) {
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
} else {
binding.emojiButton.setVisibility(VISIBLE);
binding.emojiPicker.setVisibility(GONE);
binding.keyboardButton.setVisibility(GONE);
} }
if (activity != null && !keyboardOpen && binding.emojiButton.getVisibility() == VISIBLE) { if (activity != null && !keyboardOpen && binding.emojiButton.getVisibility() == VISIBLE) {
binding.emojiPicker.setVisibility(GONE); binding.emojiPicker.setVisibility(GONE);