From f2409ed95e74ffa340009e11222fdcc3c7c08f21 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 3 Jul 2017 19:55:21 +0200 Subject: [PATCH] set focusable=false instead of enabled=false for rooms w/o voice --- .../conversations/ui/ConversationFragment.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index fe973f8b..fb434b31 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -904,9 +904,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } this.conversation = conversation; - boolean canWrite = this.conversation.getMode() == Conversation.MODE_SINGLE || this.conversation.getMucOptions().participating(); - this.mEditMessage.setEnabled(canWrite); - this.mSendButton.setEnabled(canWrite); this.mEditMessage.setKeyboardListener(null); this.mEditMessage.setText(""); this.mEditMessage.append(this.conversation.getNextMessage()); @@ -1112,7 +1109,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa if (!activity.isConversationsOverviewVisable() || !activity.isConversationsOverviewHideable()) { activity.sendReadMarkerIfNecessary(conversation); } - this.updateSendButton(); + updateSendButton(); + updateEditablity(); } } } @@ -1229,6 +1227,14 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa return activity.getThemeResource(R.attr.ic_send_text_offline, R.drawable.ic_send_text_offline); } + private void updateEditablity() { + boolean canWrite = this.conversation.getMode() == Conversation.MODE_SINGLE || this.conversation.getMucOptions().participating(); + this.mEditMessage.setFocusable(canWrite); + this.mEditMessage.setFocusableInTouchMode(canWrite); + this.mSendButton.setEnabled(canWrite); + this.mEditMessage.setCursorVisible(canWrite); + } + public void updateSendButton() { final Conversation c = this.conversation; final SendButtonAction action;