some settings fixes
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static com.vk.bridges.AuthBridge.*;
|
||||
import static bruhcollective.itaysonlab.libvkx.client.LibVKXClient.isIntegrationEnabled;
|
||||
import static ru.vtosters.lite.f0x1d.VTVerifications.vtverif;
|
||||
import static ru.vtosters.lite.ui.PreferencesUtil.*;
|
||||
import static ru.vtosters.lite.ui.vkui.VBListBuilder.VBListItem;
|
||||
import static ru.vtosters.lite.ui.vkui.VBListBuilder.buildListOf;
|
||||
import static ru.vtosters.lite.ui.vkui.VBottomSheetBuilder.VBSContent;
|
||||
import static ru.vtosters.lite.utils.About.getBuildNumber;
|
||||
import static ru.vtosters.lite.utils.About.getCommitLink;
|
||||
import static ru.vtosters.lite.utils.CacheUtils.humanReadableByteCountBin;
|
||||
import static ru.vtosters.lite.utils.Globals.*;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
import static ru.vtosters.lite.utils.Globals.getDrawableFromUrl;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
@@ -17,8 +18,6 @@ import static ru.vtosters.lite.utils.Globals.getUserPhoto;
|
||||
import static ru.vtosters.lite.utils.Globals.getUsername;
|
||||
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
import static ru.vtosters.lite.utils.IconManager.icons;
|
||||
import static ru.vtosters.lite.utils.IconManager.iconsValues;
|
||||
import static ru.vtosters.lite.utils.Preferences.*;
|
||||
import static ru.vtosters.lite.utils.Preferences.DoNotUseOldIcons;
|
||||
import static ru.vtosters.lite.utils.Preferences.ads;
|
||||
@@ -47,7 +46,6 @@ import android.os.Bundle;
|
||||
import com.aefyr.tsg.g2.TelegramStickersService;
|
||||
import com.vk.about.AboutAppFragment;
|
||||
import com.vk.balance.BalanceFragment;
|
||||
import com.vk.bridges.AuthBridge;
|
||||
import com.vk.navigation.Navigator;
|
||||
import com.vk.notifications.settings.NotificationsSettingsFragment;
|
||||
import com.vk.webapp.fragments.PrivacyFragment;
|
||||
@@ -62,17 +60,13 @@ import com.vtosters.lite.general.fragments.SettingsGeneralFragment;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.ui.PreferencesUtil;
|
||||
import ru.vtosters.lite.ui.dialogs.OTADialog;
|
||||
import ru.vtosters.lite.ui.fragments.dockbar.AdapterHelper;
|
||||
import ru.vtosters.lite.ui.fragments.dockbar.DockBarEditorFragment;
|
||||
import ru.vtosters.lite.ui.fragments.dockbar.DockBarManager;
|
||||
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
|
||||
import ru.vtosters.lite.ui.vkui.VBottomSheetBuilder;
|
||||
import ru.vtosters.lite.utils.CacheUtils;
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
import ru.vtosters.lite.utils.IconManager;
|
||||
import ru.vtosters.lite.utils.Preferences;
|
||||
import ru.vtosters.lite.utils.SSFS;
|
||||
import ru.vtosters.lite.utils.VKUIwrapper;
|
||||
|
||||
@@ -140,32 +134,32 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
public void onCreate(Bundle bundle){
|
||||
super.onCreate(bundle);
|
||||
|
||||
String feedsumm = getValAsString("vtlfeedsumm", ads());
|
||||
String docksumm = getDocksumm();
|
||||
String msgsumm = getValAsString("vtlmsgsumm", vkme());
|
||||
String activitysumm = getValAsString("vtlactivitysumm", offline());
|
||||
String themessumm = getValAsString("vtlthemessumm", navbar());
|
||||
String tgssumm = getTGSsumm();
|
||||
String superapp = getSuperappsumm();
|
||||
String mediasumm = getValAsString("vtlinterfacesumm", shortinfo());
|
||||
String interfacesumm = getValAsString("showstories", stories());
|
||||
String proxysumm = getProxysumm();
|
||||
String othersumm = getValAsString("vtlothersumm", vtverif());
|
||||
String ssfs = getSSFSsumm();
|
||||
String about = "Commit: " + getBuildNumber();
|
||||
var feedsumm = getValAsString("vtlfeedsumm", ads());
|
||||
var docksumm = getDocksumm();
|
||||
var msgsumm = getValAsString("vtlmsgsumm", vkme());
|
||||
var activitysumm = getValAsString("vtlactivitysumm", offline());
|
||||
var themessumm = getValAsString("vtlthemessumm", navbar());
|
||||
var tgssumm = getTGSsumm();
|
||||
var superapp = getSuperappsumm();
|
||||
var mediasumm = getValAsString("vtlinterfacesumm", shortinfo());
|
||||
var interfacesumm = getValAsString("showstories", stories());
|
||||
var proxysumm = getProxysumm();
|
||||
var othersumm = getValAsString("vtlothersumm", vtverif());
|
||||
var ssfs = getSSFSsumm();
|
||||
var about = "Commit: " + getBuildNumber();
|
||||
|
||||
int vtosterXml = getIdentifier("empty", "xml");
|
||||
this.addPreferencesFromResource(vtosterXml);
|
||||
|
||||
PreferencesUtil.addPreferenceDrawable(this, "", "Аккаунты", getUsername() + (hasVerification() ? Globals.getString("thanksfordonate") : Globals.getString("getdonate")), getDrawableFromUrl(getUserPhoto(), "ic_user_circle_outline_28", true, true), preference -> {
|
||||
addPreferenceDrawable(this, "", "Аккаунты", getUsername() + (hasVerification() ? Globals.getString("thanksfordonate") : Globals.getString("getdonate")), getDrawableFromUrl(getUserPhoto(), "ic_user_circle_outline_28", true, true), preference -> {
|
||||
logout();
|
||||
restartApplication();
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("vtsettdarktheme"));
|
||||
addPreferenceCategory(this, Globals.getString("vtsettdarktheme"));
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "isdark", Globals.getString("vtsettdarktheme"), "", !DoNotUseOldIcons() ? "ic_palette_24" : "ic_palette_outline_28", false, (preference, o) -> {
|
||||
addMaterialSwitchPreference(this, "isdark", Globals.getString("vtsettdarktheme"), "", !DoNotUseOldIcons() ? "ic_palette_24" : "ic_palette_outline_28", false, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
if (!value) { // inverted
|
||||
@@ -179,7 +173,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 28 && false) { // TODO refactoring system theme
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "systemtheme", Globals.getString("appearance_theme_use_system"), Globals.getString("appearance_theme_use_system_summary"), !DoNotUseOldIcons() ? "ic_recent_24" : "ic_recent_outline_28", true, (preference, o) -> {
|
||||
addMaterialSwitchPreference(this, "systemtheme", Globals.getString("appearance_theme_use_system"), Globals.getString("appearance_theme_use_system_summary"), !DoNotUseOldIcons() ? "ic_recent_24" : "ic_recent_outline_28", true, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
edit().putBoolean("systemtheme", value).commit();
|
||||
@@ -188,7 +182,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
}
|
||||
|
||||
if (!isGmsInstalled()) {
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("installgms"), "", "ic_warning_24", preference -> {
|
||||
addPreference(this, "", Globals.getString("installgms"), "", "ic_warning_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(InstallGMSFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -198,9 +192,9 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
}
|
||||
|
||||
if (devmenu()) {
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("sett_debug"));
|
||||
addPreferenceCategory(this, Globals.getString("sett_debug"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("sett_debug"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("sett_debug"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsDebugFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -208,16 +202,16 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "ssl", Globals.getString("debug_developer_force_ssl"), Globals.getString("debug_developer_force_ssl_summary"), !DoNotUseOldIcons() ? "ic_globe_20" : "ic_globe_outline_28", true, (preference, o) -> {
|
||||
addMaterialSwitchPreference(this, "ssl", Globals.getString("debug_developer_force_ssl"), Globals.getString("debug_developer_force_ssl_summary"), !DoNotUseOldIcons() ? "ic_globe_20" : "ic_globe_outline_28", true, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
edit().putBoolean("ssl", value).commit();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("vtsettaccount"));
|
||||
addPreferenceCategory(this, Globals.getString("vtsettaccount"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vkconnect"), "", !DoNotUseOldIcons() ? "ic_tags_24" : "ic_user_circle_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vkconnect"), "", !DoNotUseOldIcons() ? "ic_tags_24" : "ic_user_circle_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
VKUIwrapper.officalLinks("account");
|
||||
Intent a2 = new Navigator(VKUIwrapper.class).b(context);
|
||||
@@ -226,7 +220,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("privacy_settings"), "", !DoNotUseOldIcons() ? "ic_privacy_24" : "ic_privacy_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("privacy_settings"), "", !DoNotUseOldIcons() ? "ic_privacy_24" : "ic_privacy_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(PrivacyFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -234,7 +228,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("sett_account"), "", !DoNotUseOldIcons() ? "ic_user_24" : "ic_user_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("sett_account"), "", !DoNotUseOldIcons() ? "ic_user_24" : "ic_user_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsAccountFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -242,7 +236,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("bugs"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("bugs"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
VKUIwrapper.officalLinks("bugs");
|
||||
Intent a2 = new Navigator(VKUIwrapper.class).b(context);
|
||||
@@ -251,7 +245,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtssfs"), ssfs, !DoNotUseOldIcons() ? "ic_link_24" : "ic_link_circle_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtssfs"), ssfs, !DoNotUseOldIcons() ? "ic_link_24" : "ic_link_circle_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
VKUIwrapper.setLink(SSFS.getSSFSLink());
|
||||
Intent a2 = new Navigator(VKUIwrapper.class).b(context);
|
||||
@@ -260,9 +254,9 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("notification_settings"));
|
||||
addPreferenceCategory(this, Globals.getString("notification_settings"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("sett_general"), "", !DoNotUseOldIcons() ? "ic_settings_24" : "ic_settings_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("sett_general"), "", !DoNotUseOldIcons() ? "ic_settings_24" : "ic_settings_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsGeneralFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -270,7 +264,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("blacklist"), "", !DoNotUseOldIcons() ? "ic_users_24" : "ic_users_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("blacklist"), "", !DoNotUseOldIcons() ? "ic_users_24" : "ic_users_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(BlacklistFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -278,7 +272,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("sett_notifications"), "", !DoNotUseOldIcons() ? "ic_notification_24" : "ic_menu_notification_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("sett_notifications"), "", !DoNotUseOldIcons() ? "ic_notification_24" : "ic_menu_notification_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(NotificationsSettingsFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -287,7 +281,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
});
|
||||
|
||||
if (VKAccountManager.d().isMusicSubs()) {
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("subscription_music"), "", !DoNotUseOldIcons() ? "ic_music_24" : "ic_music_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("subscription_music"), "", !DoNotUseOldIcons() ? "ic_music_24" : "ic_music_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MusicSubscriptionControlFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -296,7 +290,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("votes"), "", !DoNotUseOldIcons() ? "ic_coins_24" : "ic_coins_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("votes"), "", !DoNotUseOldIcons() ? "ic_coins_24" : "ic_coins_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(BalanceFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -304,10 +298,10 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("vtsettmod"));
|
||||
addPreferenceCategory(this, Globals.getString("vtsettmod"));
|
||||
|
||||
if (!vkme()) {
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlfeed"), feedsumm, !DoNotUseOldIcons() ? "ic_newsfeed_24" : "ic_newsfeed_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlfeed"), feedsumm, !DoNotUseOldIcons() ? "ic_newsfeed_24" : "ic_newsfeed_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(FeedFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -315,7 +309,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("dockbar_editor"), docksumm, !DoNotUseOldIcons() ? "ic_list_24" : "ic_list_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("dockbar_editor"), docksumm, !DoNotUseOldIcons() ? "ic_list_24" : "ic_list_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(DockBarEditorFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -324,7 +318,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlmedia"), mediasumm, "ic_media_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlmedia"), mediasumm, "ic_media_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MediaFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -332,7 +326,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlmessages"), msgsumm, !DoNotUseOldIcons() ? "ic_message_24" : "ic_message_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlmessages"), msgsumm, !DoNotUseOldIcons() ? "ic_message_24" : "ic_message_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MessagesFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -340,7 +334,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlactivity"), activitysumm, !DoNotUseOldIcons() ? "ic_write_24" : "ic_write_outline_28_new_accent", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlactivity"), activitysumm, !DoNotUseOldIcons() ? "ic_write_24" : "ic_write_outline_28_new_accent", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ActivityFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -348,7 +342,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlthemes"), themessumm, !DoNotUseOldIcons() ? "ic_palette_24" : "ic_write_outline_24", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlthemes"), themessumm, !DoNotUseOldIcons() ? "ic_palette_24" : "ic_write_outline_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ThemesFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -356,7 +350,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtltgs"), tgssumm, !DoNotUseOldIcons() ? "ic_telegram_24" : "ic_telegram_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtltgs"), tgssumm, !DoNotUseOldIcons() ? "ic_telegram_24" : "ic_telegram_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(StickersFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -364,7 +358,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlinterface"), interfacesumm, !DoNotUseOldIcons() ? "ic_interface_24" : "ic_interface_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlinterface"), interfacesumm, !DoNotUseOldIcons() ? "ic_interface_24" : "ic_interface_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(InterfaceFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -373,13 +367,13 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
});
|
||||
|
||||
if (milkshake() && superapp()) {
|
||||
PreferencesUtil.addPreference(this, "", "Настроить Superapp", superapp, "ic_explore_outline_28", (preference) -> {
|
||||
addPreference(this, "", "Настроить Superapp", superapp, "ic_explore_outline_28", (preference) -> {
|
||||
callEditorPopup();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlproxy"), proxysumm, !DoNotUseOldIcons() ? "ic_globe_20" : "ic_globe_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlproxy"), proxysumm, !DoNotUseOldIcons() ? "ic_globe_20" : "ic_globe_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ProxySettingsFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -387,13 +381,13 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addListPreferenceIcon(this, "clearcache", "Default", Globals.getString("autoclearcache"), !DoNotUseOldIcons() ? "ic_delete_24" : "ic_delete_outline_28", getCachesumm(), new CharSequence[] {
|
||||
addListPreferenceIcon(this, "clearcache", "Default", Globals.getString("autoclearcache"), !DoNotUseOldIcons() ? "ic_delete_24" : "ic_delete_outline_28", getCachesumm(), new CharSequence[] {
|
||||
Globals.getString("autoclearcachedisabled"), "100 MB", "500 MB", "1 GB", "2 GB", "5 GB"
|
||||
}, new String[] {
|
||||
"Default", "100mb", "500mb", "1gb", "2gb", "5gb"
|
||||
}, null);
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtlother"), othersumm, !DoNotUseOldIcons() ? "ic_more_24" : "ic_more_horizontal_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtlother"), othersumm, !DoNotUseOldIcons() ? "ic_more_24" : "ic_more_horizontal_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(OtherFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -401,9 +395,9 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("vtsettaboutmod"));
|
||||
addPreferenceCategory(this, Globals.getString("vtsettaboutmod"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("menu_about"), about, !DoNotUseOldIcons() ? "ic_about_24" : "ic_about_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("menu_about"), about, !DoNotUseOldIcons() ? "ic_about_24" : "ic_about_outline_28", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(AboutAppFragment.class).b(context);
|
||||
a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
@@ -411,30 +405,30 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("opencommit"), "", !DoNotUseOldIcons() ? "ic_link_24" : "ic_link_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("opencommit"), "", !DoNotUseOldIcons() ? "ic_link_24" : "ic_link_outline_28", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse(getCommitLink())));
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("vtfaq"), Globals.getString("vtfaqsumm"), !DoNotUseOldIcons() ? "ic_help_24" : "ic_help_outline_24", preference -> {
|
||||
addPreference(this, "", Globals.getString("vtfaq"), Globals.getString("vtfaqsumm"), !DoNotUseOldIcons() ? "ic_help_24" : "ic_help_outline_24", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/s/vtosters_faq")));
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("reportbug"), Globals.getString("reportbugsumm"), !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
addPreference(this, "", Globals.getString("reportbug"), Globals.getString("reportbugsumm"), !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://github.com/vtosters/lite/issues")));
|
||||
return false;
|
||||
});
|
||||
|
||||
if (isValidSignature()) {
|
||||
PreferencesUtil.addPreferenceCategory(this, Globals.getString("updates"));
|
||||
addPreferenceCategory(this, Globals.getString("updates"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", Globals.getString("checkforupdates"), "", "ic_download_outline_24", preference -> {
|
||||
addPreference(this, "", Globals.getString("checkforupdates"), "", "ic_download_outline_24", preference -> {
|
||||
OTADialog.checkUpdates(getActivity());
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "checkupdates", Globals.getString("checkupdates"), "", "ic_recent_outline_28", true, (preference, o) -> {
|
||||
addMaterialSwitchPreference(this, "checkupdates", Globals.getString("checkupdates"), "", "ic_recent_outline_28", true, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
edit().putBoolean("checkupdates", value).commit();
|
||||
|
||||
Reference in New Issue
Block a user