Refine pressTitleToOpenAllChats

This commit is contained in:
luvletter2333 2021-04-25 15:40:52 +08:00
parent e38ef93fad
commit f82978c683
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
3 changed files with 16 additions and 19 deletions

View File

@ -1555,7 +1555,7 @@ public class FilterTabsView extends FrameLayout {
return listView;
}
public boolean showAllChatsTab = false;
public boolean showAllChatsTab = !NekoConfig.hideAllTab;
public void toggleAllTabs(boolean show) {
if (show == showAllChatsTab)

View File

@ -2099,15 +2099,13 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
actionBar.setTitle(LocaleController.getString("SelectChat", R.string.SelectChat));
}
actionBar.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefault));
if (NekoConfig.hideAllTab) {
actionBar.setOnLongClickListener(v -> {
if (NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
filterTabsView.toggleAllTabs(true);
filterTabsView.selectFirstTab();
}
return false;
});
}
actionBar.setOnLongClickListener(v -> {
if (NekoConfig.hideAllTab && NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
filterTabsView.toggleAllTabs(true);
filterTabsView.selectFirstTab();
}
return false;
});
} else {
if (searchString != null || folderId != 0) {
actionBar.setBackButtonDrawable(backDrawable = new BackDrawable(false));
@ -2119,15 +2117,13 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
actionBar.setTitle(LocaleController.getString("ArchivedChats", R.string.ArchivedChats));
} else {
actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (NekoConfig.hideAllTab) {
actionBar.setOnLongClickListener(v -> {
if (NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
filterTabsView.toggleAllTabs(true);
filterTabsView.selectFirstTab();
}
return false;
});
}
actionBar.setOnLongClickListener(v -> {
if (NekoConfig.hideAllTab && NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
filterTabsView.toggleAllTabs(true);
filterTabsView.selectFirstTab();
}
return false;
});
}
if (folderId == 0) {
actionBar.setSupportsHolidayImage(true);

View File

@ -211,6 +211,7 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(NekoConfig.pressTitleToOpenAllChats);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated);
} else if (position == tabsTitleTypeRow) {
PopupBuilder builder = new PopupBuilder(view);