1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-12-02 15:22:57 +01:00

Allow hide Repeat from message menu

for those who are willing to lose the human nature
This commit is contained in:
NekoInverter 2020-02-16 11:20:27 +08:00
parent 77fae32f94
commit 3cb0c0e76d
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
3 changed files with 22 additions and 2 deletions

View File

@ -13966,7 +13966,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
boolean allowRepeat = currentUser != null
|| (currentChat != null && ChatObject.canSendMessages(currentChat));
if (allowRepeat) {
if (allowRepeat && NekoConfig.showRepeat) {
items.add(LocaleController.getString("Repeat", R.string.Repeat));
options.add(94);
icons.add(R.drawable.msg_repeat);

View File

@ -35,6 +35,7 @@ public class NekoConfig {
public static boolean showDeleteDownloadedFile = true;
public static boolean showMessageDetails = false;
public static boolean showTranslate = true;
public static boolean showRepeat = true;
public static boolean xmas = false;
public static boolean newYear = false;
@ -75,6 +76,7 @@ public class NekoConfig {
editor.putBoolean("showDeleteDownloadedFile", showDeleteDownloadedFile);
editor.putBoolean("showMessageDetails", showMessageDetails);
editor.putBoolean("showTranslate", showTranslate);
editor.putBoolean("showRepeat", showRepeat);
editor.putBoolean("xmas", xmas);
editor.putBoolean("newYear", newYear);
editor.putBoolean("newYearEve", newYearEve);
@ -117,6 +119,7 @@ public class NekoConfig {
showDeleteDownloadedFile = preferences.getBoolean("showDeleteDownloadedFile", true);
showMessageDetails = preferences.getBoolean("showMessageDetails", false);
showTranslate = preferences.getBoolean("showTranslate", true);
showRepeat = preferences.getBoolean("showRepeat", true);
xmas = preferences.getBoolean("xmas", false);
newYear = preferences.getBoolean("newYear", false);
newYearEve = preferences.getBoolean("newYearEve", false);
@ -193,6 +196,14 @@ public class NekoConfig {
editor.commit();
}
public static void toggleShowRepeat() {
showRepeat = !showRepeat;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("showRepeat", showRepeat);
editor.commit();
}
public static void toggleIPv6() {
useIPv6 = !useIPv6;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE);

View File

@ -595,7 +595,7 @@ public class NekoSettingsActivity extends BaseFragment {
linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL);
linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
int count = 9;
int count = 10;
for (int a = 0; a < count; a++) {
TextCheckCell textCell = new TextCheckCell(context);
switch (a) {
@ -635,6 +635,10 @@ public class NekoSettingsActivity extends BaseFragment {
textCell.setTextAndCheck(LocaleController.getString("Translate", R.string.Translate), NekoConfig.showTranslate, false);
break;
}
case 9: {
textCell.setTextAndCheck(LocaleController.getString("Repeat", R.string.Repeat), NekoConfig.showRepeat, false);
break;
}
}
textCell.setTag(a);
textCell.setBackgroundDrawable(Theme.getSelectorDrawable(false));
@ -687,6 +691,11 @@ public class NekoSettingsActivity extends BaseFragment {
textCell.setChecked(NekoConfig.showTranslate);
break;
}
case 9: {
NekoConfig.toggleShowRepeat();
textCell.setChecked(NekoConfig.showRepeat);
break;
}
}
});
}