Hide more settings by default

This commit is contained in:
NekoInverter 2020-03-07 17:21:29 +08:00
parent 31072e7095
commit 665e35d33c
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9

View File

@ -575,9 +575,9 @@ public class NekoSettingsActivity extends BaseFragment {
forceTabletRow = rowCount++; forceTabletRow = rowCount++;
openArchiveOnPullRow = rowCount++; openArchiveOnPullRow = rowCount++;
nameOrderRow = rowCount++; nameOrderRow = rowCount++;
eventTypeRow = rowCount++; eventTypeRow = NekoConfig.showHiddenFeature ? rowCount++ : -1;
newYearRow = rowCount++; newYearRow = NekoConfig.showHiddenFeature ? rowCount++ : -1;
actionBarDecorationRow = rowCount++; actionBarDecorationRow = NekoConfig.showHiddenFeature ? rowCount++ : -1;
needRestartRow = rowCount++; needRestartRow = rowCount++;
experimentRow = rowCount++; experimentRow = rowCount++;
smoothKeyboardRow = !AndroidUtilities.isTablet() ? rowCount++ : -1; smoothKeyboardRow = !AndroidUtilities.isTablet() ? rowCount++ : -1;
@ -691,7 +691,7 @@ public class NekoSettingsActivity extends BaseFragment {
linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL); linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL);
linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); 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++) { for (int a = 0; a < count; a++) {
TextCheckCell textCell = new TextCheckCell(context); TextCheckCell textCell = new TextCheckCell(context);
switch (a) { switch (a) {
@ -716,25 +716,25 @@ public class NekoSettingsActivity extends BaseFragment {
break; break;
} }
case 5: { 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); textCell.setTextAndCheck(LocaleController.getString("Translate", R.string.Translate), NekoConfig.showTranslate, false);
break; break;
} }
case 7: { case 6: {
textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport, false); textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport, false);
break; break;
} }
case 8: { case 7: {
textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions, false); textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions, false);
break; break;
} }
case 9: { case 8: {
textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions, false); textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions, false);
break; break;
} }
case 9: {
textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, false);
break;
}
} }
textCell.setTag(a); textCell.setTag(a);
textCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); textCell.setBackgroundDrawable(Theme.getSelectorDrawable(false));
@ -768,30 +768,30 @@ public class NekoSettingsActivity extends BaseFragment {
break; break;
} }
case 5: { case 5: {
NekoConfig.toggleShowMessageDetails();
textCell.setChecked(NekoConfig.showMessageDetails);
break;
}
case 6: {
NekoConfig.toggleShowTranslate(); NekoConfig.toggleShowTranslate();
textCell.setChecked(NekoConfig.showTranslate); textCell.setChecked(NekoConfig.showTranslate);
break; break;
} }
case 7: { case 6: {
NekoConfig.toggleShowReport(); NekoConfig.toggleShowReport();
textCell.setChecked(NekoConfig.showReport); textCell.setChecked(NekoConfig.showReport);
break; break;
} }
case 8: { case 7: {
NekoConfig.toggleShowAdminActions(); NekoConfig.toggleShowAdminActions();
textCell.setChecked(NekoConfig.showAdminActions); textCell.setChecked(NekoConfig.showAdminActions);
break; break;
} }
case 9: { case 8: {
NekoConfig.toggleShowChangePermissions(); NekoConfig.toggleShowChangePermissions();
textCell.setChecked(NekoConfig.showChangePermissions); textCell.setChecked(NekoConfig.showChangePermissions);
break; 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); value = LocaleController.getString("FirstLast", R.string.FirstLast);
break; 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) { } else if (position == mapPreviewRow) {
String value; String value;
switch (NekoConfig.mapPreviewProvider) { switch (NekoConfig.mapPreviewProvider) {