fixes
This commit is contained in:
@@ -8,25 +8,33 @@ import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserId;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
|
||||
import static ru.vtosters.lite.utils.Preferences.devmenu;
|
||||
import static ru.vtosters.lite.utils.Themes.applyTheme;
|
||||
import static ru.vtosters.lite.utils.Themes.getDarkTheme;
|
||||
import static ru.vtosters.lite.utils.Themes.getImDarkTheme;
|
||||
import static ru.vtosters.lite.utils.Themes.getImLightTheme;
|
||||
import static ru.vtosters.lite.utils.Themes.getLightTheme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.vk.about.AboutAppFragment;
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
import com.vk.identity.fragments.IdentityListFragment;
|
||||
import com.vk.navigation.Navigator;
|
||||
import com.vk.notifications.settings.NotificationsSettingsFragment;
|
||||
import com.vk.webapp.Bugs;
|
||||
import com.vk.webapp.PrivacyFragment;
|
||||
import com.vk.webapp.SSFS;
|
||||
import com.vk.webapp.VKConnect;
|
||||
import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
import com.vtosters.lite.fragments.SettingsAccountFragment;
|
||||
import com.vtosters.lite.fragments.SettingsDebugFragment;
|
||||
import com.vtosters.lite.fragments.SettingsGeneralFragment;
|
||||
import com.vtosters.lite.fragments.k.BlacklistFragment;
|
||||
import com.vtosters.lite.fragments.money.music.control.subscription.MusicSubscriptionControlFragment;
|
||||
|
||||
import ru.vtosters.lite.ui.PreferencesUtil;
|
||||
import ru.vtosters.lite.ui.fragments.dockbar.DockBarFragment;
|
||||
import ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountFragment;
|
||||
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
|
||||
|
||||
@@ -50,25 +58,135 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "isdark", "Темная тема", "", "ic_palette_24", false, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
if (!isGmsInstalled()) {
|
||||
PreferencesUtil.addPreference(this, "", getString("installgms"), "", "ic_alert", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(InstallGMSFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if(value){
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
} else {
|
||||
applyTheme(getDarkTheme(), getImDarkTheme());
|
||||
}
|
||||
if(devmenu()){
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("sett_debug"));
|
||||
|
||||
edit().putBoolean("isdark", value).commit();
|
||||
PreferencesUtil.addPreference(this, "", getString("sett_debug"), "", "ic_bug_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsDebugFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
VKThemeHelper.a(this.p());
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "ssl", getString("debug_developer_force_ssl"), getString("debug_developer_force_ssl_summary"), "ic_globe_24", true, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
edit().putBoolean("ssl", value).commit();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
PreferencesUtil.addPreferenceCategory(this, "Аккаунт");
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vkconnect"), "", "ic_tags_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(VKConnect.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("privacy_settings"), "", "ic_privacy_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(PrivacyFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("sett_account"), "", "ic_user_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsAccountFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("bugs"), "", "ic_bug_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(Bugs.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtssfs"), "", "ic_link_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SSFS.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("notification_settings"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("sett_general"), "", "ic_settings_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsGeneralFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("blacklist"), "", "ic_users_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(BlacklistFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("sett_notifications"), "", "ic_notification_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(NotificationsSettingsFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
if (VKAccountManager.b().isRealMusicSubs()) {
|
||||
PreferencesUtil.addPreference(this, "", getString("subscription_music"), "", "ic_music_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MusicSubscriptionControlFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (VKAccountManager.b().ar()) {
|
||||
PreferencesUtil.addPreference(this, "", getString("identity_title"), "", "ic_services_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(IdentityListFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, "Настройки модификации");
|
||||
|
||||
if (!vkme()) {
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlfeed"), "", "ic_newsfeed_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(FeedFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("dockbar_editor"), "", "ic_list_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(DockBarFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlmusic"), "", "ic_music_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MusicFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlmessages"), "", "ic_message_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MessagesFragment.class).a(context);
|
||||
@@ -118,7 +236,7 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, "Прочее");
|
||||
PreferencesUtil.addPreferenceCategory(this, "О модификации");
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("menu_about"), "", "ic_about_24", preference -> {
|
||||
Context context = getContext();
|
||||
@@ -127,13 +245,20 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
return false;
|
||||
});
|
||||
|
||||
if(devmenu())
|
||||
PreferencesUtil.addPreference(this, "", getString("sett_debug"), "", "ic_bug_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(SettingsDebugFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
PreferencesUtil.addPreference(this, "", getString("vtfaq"), "", "ic_help_24", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/s/vtosters_faq")));
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("reportbug"), "", "ic_bug_24", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://github.com/vtosters/lite/issues")));
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("download_latest_vtl"), "", "ic_download_24", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://github.com/vtosters/lite/releases/latest")));
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user