Skip to content

Commit

Permalink
修复未显示对讲按钮问题
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Dec 10, 2022
1 parent 7e8f6b2 commit 1bbdf42
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1bbdf42

Please sign in to comment.