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);