From 1bbdf42e6a0354520ca9a314622de26b908c1689 Mon Sep 17 00:00:00 2001 From: imndx Date: Sat, 10 Dec 2022 15:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E8=AE=B2=E6=8C=89=E9=92=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kit/conversation/ConversationInputPanel.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/uikit/src/main/java/cn/wildfire/chat/kit/conversation/ConversationInputPanel.java b/uikit/src/main/java/cn/wildfire/chat/kit/conversation/ConversationInputPanel.java index a0d4e9446..99434e47e 100644 --- a/uikit/src/main/java/cn/wildfire/chat/kit/conversation/ConversationInputPanel.java +++ b/uikit/src/main/java/cn/wildfire/chat/kit/conversation/ConversationInputPanel.java @@ -186,6 +186,13 @@ public void setupConversation(Conversation conversation) { } else { menuImageView.setVisibility(GONE); } + + SharedPreferences sp = fragment.getContext().getSharedPreferences(Config.SP_CONFIG_FILE_NAME, Context.MODE_PRIVATE); + boolean pttEnabled = sp.getBoolean("pttEnabled", true); + if (pttEnabled && PTTClient.checkAddress(ChatManager.Instance().getHost()) && conversation.type != Conversation.ConversationType.Channel) { + pttImageView.setVisibility(View.VISIBLE); + pttPanel = new PttPanel(getContext()); + } } private QuoteInfo quoteInfo; @@ -268,12 +275,6 @@ public void onRecordStateChanged(AudioRecorderPanel.RecordState state) { } } }); - SharedPreferences sp = fragment.getContext().getSharedPreferences(Config.SP_CONFIG_FILE_NAME, Context.MODE_PRIVATE); - boolean pttEnabled = sp.getBoolean("pttEnabled", true); - if (pttEnabled && PTTClient.checkAddress(ChatManager.Instance().getHost()) && conversation != null && conversation.type != Conversation.ConversationType.Channel) { - pttImageView.setVisibility(View.VISIBLE); - pttPanel = new PttPanel(getContext()); - } // emotion emotionLayout.setEmotionSelectedListener(this);