improve settings

This commit is contained in:
NekoInverter 2020-01-29 20:13:59 +08:00
parent e6f35f2ab8
commit 71bd50e700
1 changed files with 13 additions and 18 deletions

View File

@ -453,18 +453,12 @@ public class NekoSettingsActivity extends BaseFragment {
return; return;
} }
Context context = getParentActivity(); Context context = getParentActivity();
BottomSheet.Builder builder = new BottomSheet.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setApplyTopPadding(false); builder.setTitle(LocaleController.getString("MessageMenu", R.string.MessageMenu));
builder.setApplyBottomPadding(false);
LinearLayout linearLayout = new LinearLayout(context); LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(LinearLayout.VERTICAL); linearLayout.setOrientation(LinearLayout.VERTICAL);
HeaderCell headerCell = new HeaderCell(context, true, 23, 15, false);
headerCell.setHeight(47);
headerCell.setText(LocaleController.getString("MessageMenu", R.string.MessageMenu));
linearLayout.addView(headerCell);
LinearLayout linearLayoutInviteContainer = new LinearLayout(context); LinearLayout linearLayoutInviteContainer = new LinearLayout(context);
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));
@ -474,39 +468,39 @@ public class NekoSettingsActivity extends BaseFragment {
TextCheckCell textCell = new TextCheckCell(context); TextCheckCell textCell = new TextCheckCell(context);
switch (a) { switch (a) {
case 0: { case 0: {
textCell.setTextAndCheck(LocaleController.getString("AddToSavedMessages", R.string.AddToSavedMessages), NekoConfig.showAddToSavedMessages, true); textCell.setTextAndCheck(LocaleController.getString("AddToSavedMessages", R.string.AddToSavedMessages), NekoConfig.showAddToSavedMessages, false);
break; break;
} }
case 1: { case 1: {
textCell.setTextAndCheck(LocaleController.getString("Prpr", R.string.Prpr), NekoConfig.showPrPr, true); textCell.setTextAndCheck(LocaleController.getString("Prpr", R.string.Prpr), NekoConfig.showPrPr, false);
break; break;
} }
case 2: { case 2: {
textCell.setTextAndCheck(LocaleController.getString("ViewHistory", R.string.ViewHistory), NekoConfig.showViewHistory, true); textCell.setTextAndCheck(LocaleController.getString("ViewHistory", R.string.ViewHistory), NekoConfig.showViewHistory, false);
break; break;
} }
case 3: { case 3: {
textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport, true); textCell.setTextAndCheck(LocaleController.getString("ReportChat", R.string.ReportChat), NekoConfig.showReport, false);
break; break;
} }
case 4: { case 4: {
textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions, true); textCell.setTextAndCheck(LocaleController.getString("EditAdminRights", R.string.EditAdminRights), NekoConfig.showAdminActions, false);
break; break;
} }
case 5: { case 5: {
textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions, true); textCell.setTextAndCheck(LocaleController.getString("ChangePermissions", R.string.ChangePermissions), NekoConfig.showChangePermissions, false);
break; break;
} }
case 6: { case 6: {
textCell.setTextAndCheck(LocaleController.getString("DeleteDownloadedFile", R.string.DeleteDownloadedFile), NekoConfig.showDeleteDownloadedFile, true); textCell.setTextAndCheck(LocaleController.getString("DeleteDownloadedFile", R.string.DeleteDownloadedFile), NekoConfig.showDeleteDownloadedFile, false);
break; break;
} }
case 7: { case 7: {
textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, true); textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, false);
break; break;
} }
case 8: { case 8: {
textCell.setTextAndValueAndCheck(LocaleController.getString("MessageDetails", R.string.Translate), LocaleController.getString("ServiceByGoogle", R.string.ServiceByGoogle), NekoConfig.showTranslate, false, false); textCell.setTextAndValueAndCheck(LocaleController.getString("Translate", R.string.Translate), LocaleController.getString("ServiceByGoogle", R.string.ServiceByGoogle), NekoConfig.showTranslate, false, false);
break; break;
} }
} }
@ -564,7 +558,8 @@ public class NekoSettingsActivity extends BaseFragment {
} }
}); });
} }
builder.setCustomView(linearLayout); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
builder.setView(linearLayout);
showDialog(builder.create()); showDialog(builder.create());
} }