From 665e35d33c447ded59403a103c005bae7ef6d62b Mon Sep 17 00:00:00 2001 From: NekoInverter <42698724+NekoInverter@users.noreply.github.com> Date: Sat, 7 Mar 2020 17:21:29 +0800 Subject: [PATCH] Hide more settings by default --- .../nekogram/NekoSettingsActivity.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java index c69142801..7b11fec49 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java @@ -575,9 +575,9 @@ public class NekoSettingsActivity extends BaseFragment { forceTabletRow = rowCount++; openArchiveOnPullRow = rowCount++; nameOrderRow = rowCount++; - eventTypeRow = rowCount++; - newYearRow = rowCount++; - actionBarDecorationRow = rowCount++; + eventTypeRow = NekoConfig.showHiddenFeature ? rowCount++ : -1; + newYearRow = NekoConfig.showHiddenFeature ? rowCount++ : -1; + actionBarDecorationRow = NekoConfig.showHiddenFeature ? rowCount++ : -1; needRestartRow = rowCount++; experimentRow = rowCount++; smoothKeyboardRow = !AndroidUtilities.isTablet() ? rowCount++ : -1; @@ -691,7 +691,7 @@ public class NekoSettingsActivity extends BaseFragment { linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL); linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); - int count = 10; + int count = NekoConfig.showHiddenFeature ? 10 : 9; for (int a = 0; a < count; a++) { TextCheckCell textCell = new TextCheckCell(context); switch (a) { @@ -716,25 +716,25 @@ public class NekoSettingsActivity extends BaseFragment { break; } case 5: { - textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, false); - break; - } - case 6: { textCell.setTextAndCheck(LocaleController.getString("Translate", R.string.Translate), NekoConfig.showTranslate, false); break; } - case 7: { + case 6: { textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport, false); break; } - case 8: { + case 7: { textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions, false); break; } - case 9: { + case 8: { textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions, false); break; } + case 9: { + textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, false); + break; + } } textCell.setTag(a); textCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); @@ -768,30 +768,30 @@ public class NekoSettingsActivity extends BaseFragment { break; } case 5: { - NekoConfig.toggleShowMessageDetails(); - textCell.setChecked(NekoConfig.showMessageDetails); - break; - } - case 6: { NekoConfig.toggleShowTranslate(); textCell.setChecked(NekoConfig.showTranslate); break; } - case 7: { + case 6: { NekoConfig.toggleShowReport(); textCell.setChecked(NekoConfig.showReport); break; } - case 8: { + case 7: { NekoConfig.toggleShowAdminActions(); textCell.setChecked(NekoConfig.showAdminActions); break; } - case 9: { + case 8: { NekoConfig.toggleShowChangePermissions(); textCell.setChecked(NekoConfig.showChangePermissions); break; } + case 9: { + NekoConfig.toggleShowMessageDetails(); + textCell.setChecked(NekoConfig.showMessageDetails); + break; + } } }); } @@ -941,7 +941,7 @@ public class NekoSettingsActivity extends BaseFragment { value = LocaleController.getString("FirstLast", R.string.FirstLast); break; } - textCell.setTextAndValue(LocaleController.getString("NameOrder", R.string.NameOrder), value, true); + textCell.setTextAndValue(LocaleController.getString("NameOrder", R.string.NameOrder), value, eventTypeRow != -1); } else if (position == mapPreviewRow) { String value; switch (NekoConfig.mapPreviewProvider) {