Show pinned menu only when needed

This commit is contained in:
NekoInverter 2020-06-08 19:36:14 +08:00
parent 1e7c67f3ba
commit c0a1b71a5a
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
1 changed files with 6 additions and 1 deletions

View File

@ -13420,9 +13420,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
pinned_msg_id = 0;
}
SharedPreferences preferences = MessagesController.getNotificationsSettings(currentAccount);
if (chatInfo == null && userInfo == null || pinned_msg_id == 0 || pinned_msg_id == preferences.getInt("pin_" + dialog_id, 0) || actionBar != null && (actionBar.isActionModeShowed() || actionBar.isSearchFieldVisible())) {
if (chatInfo == null && userInfo == null || pinned_msg_id == 0 || actionBar != null && (actionBar.isActionModeShowed() || actionBar.isSearchFieldVisible())) {
changed = hidePinnedMessageView(animated);
headerItem.hideSubItem(show_pinned);
} else if (pinned_msg_id == preferences.getInt("pin_" + dialog_id, 0)) {
changed = hidePinnedMessageView(animated);
headerItem.showSubItem(show_pinned);
} else {
headerItem.hideSubItem(show_pinned);
if (pinnedMessageObject != null) {
if (pinnedMessageView.getTag() != null) {
pinnedMessageView.setTag(null);