1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-04 11:13:36 +00:00

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; return listView;
} }
public boolean showAllChatsTab = false; public boolean showAllChatsTab = !NekoConfig.hideAllTab;
public void toggleAllTabs(boolean show) { public void toggleAllTabs(boolean show) {
if (show == showAllChatsTab) 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.setTitle(LocaleController.getString("SelectChat", R.string.SelectChat));
} }
actionBar.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefault)); actionBar.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefault));
if (NekoConfig.hideAllTab) { actionBar.setOnLongClickListener(v -> {
actionBar.setOnLongClickListener(v -> { if (NekoConfig.hideAllTab && NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
if (NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) { filterTabsView.toggleAllTabs(true);
filterTabsView.toggleAllTabs(true); filterTabsView.selectFirstTab();
filterTabsView.selectFirstTab(); }
} return false;
return false; });
});
}
} else { } else {
if (searchString != null || folderId != 0) { if (searchString != null || folderId != 0) {
actionBar.setBackButtonDrawable(backDrawable = new BackDrawable(false)); 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)); actionBar.setTitle(LocaleController.getString("ArchivedChats", R.string.ArchivedChats));
} else { } else {
actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX));
if (NekoConfig.hideAllTab) { actionBar.setOnLongClickListener(v -> {
actionBar.setOnLongClickListener(v -> { if (NekoConfig.hideAllTab && NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) {
if (NekoConfig.pressTitleToOpenAllChats && filterTabsView != null && filterTabsView.getCurrentTabId() != Integer.MAX_VALUE) { filterTabsView.toggleAllTabs(true);
filterTabsView.toggleAllTabs(true); filterTabsView.selectFirstTab();
filterTabsView.selectFirstTab(); }
} return false;
return false; });
});
}
} }
if (folderId == 0) { if (folderId == 0) {
actionBar.setSupportsHolidayImage(true); actionBar.setSupportsHolidayImage(true);

View File

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