Merge branch 'vtosters:master' into master
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.vk.core.util.ToastUtils;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
@@ -19,10 +18,14 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
private void prefs() {
|
||||
a("newfeed").a(new restart());
|
||||
a("dateformat").a(new restart());
|
||||
a("stories").a(new restart());
|
||||
a("swipe").a(new restart());
|
||||
a("dockcounter").a(new restart());
|
||||
}
|
||||
|
||||
public boolean restart(Preference preference, Object obj) {
|
||||
ToastUtils.a(getString("restartapp"));
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.vk.core.util.ToastUtils;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
@@ -22,7 +21,7 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
|
||||
}
|
||||
|
||||
public boolean restart(Preference preference, Object obj) {
|
||||
ToastUtils.a(getString("restartapp"));
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.componentSwitcher;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
@@ -34,14 +35,15 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
private void prefs() {
|
||||
a("iconvk").a(new a());
|
||||
a("darktheme").a(new b());
|
||||
a("lighttheme").a(new b());
|
||||
a("darktheme").a(new restart());
|
||||
a("lighttheme").a(new restart());
|
||||
a("navbar").a(new restart());
|
||||
}
|
||||
|
||||
public static class b implements Preference.b {
|
||||
public static class restart implements Preference.b {
|
||||
@Override // android.support.v7.preference.Preference.b
|
||||
public boolean a(Preference preference, Object obj) {
|
||||
ToastUtils.a(getString("restartapp"));
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,20 +3,45 @@ package ru.vtosters.lite.ui.fragments;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.getCurrentAccount;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.withRegex;
|
||||
import static ru.vtosters.lite.utils.Globals.drawableFromUrl;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
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.isGmsInstalled;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
import static ru.vtosters.lite.utils.Preferences.devmenu;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
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 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;
|
||||
|
||||
@@ -29,7 +54,7 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
String keyVKAccount = getCurrentAccount().getString("key_vk_account", "");
|
||||
String avatarUrl = withRegex(keyVKAccount, ".*\"photo\":\\{.*?:\"(.*?)\"\\}.*", "https://vk.com/images/camera_200.png").replace("\\/", "/");
|
||||
String name = withRegex(keyVKAccount, ".*\"name\":\\{.*?:\"(.*?)\"\\}.*", "");
|
||||
String id = "id" + Integer.toString(getUserId());
|
||||
String id = "@id" + Integer.toString(getUserId());
|
||||
int vtosterXml = getIdentifier("empty", "xml");
|
||||
this.a(vtosterXml);
|
||||
|
||||
@@ -40,25 +65,177 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "isdark", "Темная тема", "", "ic_palette_24", false, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
if(value){
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
} else {
|
||||
applyTheme(getDarkTheme(), getImDarkTheme());
|
||||
}
|
||||
|
||||
edit().putBoolean("isdark", value).commit();
|
||||
|
||||
VKThemeHelper.a(this.p());
|
||||
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
});
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "systemtheme", getString("appearance_theme_use_system"), getString("appearance_theme_use_system_summary"), "ic_recent_24", true, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
edit().putBoolean("systemtheme", value).commit();
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
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(devmenu()){
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("sett_debug"));
|
||||
|
||||
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.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;
|
||||
});
|
||||
}
|
||||
|
||||
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("vtlmessages"), "", "ic_message_28", preference -> {
|
||||
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);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlactivity"), "", "ic_message_28", preference -> {
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlactivity"), "", "ic_write_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ActivityFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlactivity"), "", "ic_write_28", preference -> {
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlthemes"), "", "ic_palette_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ActivityFragment.class).a(context);
|
||||
Intent a2 = new Navigator(ThemesFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
@@ -91,7 +268,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();
|
||||
@@ -100,6 +277,21 @@ public class VKMeSettings extends MaterialPreferenceToolbarFragment {
|
||||
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;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Preferences.newfeed;
|
||||
import static ru.vtosters.lite.utils.Preferences.oldicons;
|
||||
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme_notifs;
|
||||
|
||||
@@ -20,7 +21,6 @@ import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.GamesFragment;
|
||||
import com.vtosters.lite.fragments.PhotosFragment;
|
||||
import com.vtosters.lite.fragments.ProfileFragment;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
import com.vtosters.lite.fragments.d.DocumentsViewFragment;
|
||||
import com.vtosters.lite.fragments.f.FriendsFragment;
|
||||
import com.vtosters.lite.fragments.g.BirthdaysFragment;
|
||||
@@ -46,8 +46,6 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.ui.fragments.VKMeSettings;
|
||||
|
||||
public class DockBarManager {
|
||||
public static final int MIN_SELECTED_TABS_LIMIT = 3;
|
||||
public static final int MAX_SELECTED_TABS_LIMIT = 9;
|
||||
@@ -84,7 +82,7 @@ public class DockBarManager {
|
||||
|
||||
if (!dockbar.exists()) {
|
||||
if(vkme()) {
|
||||
mSelectedTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, VKMeSettings.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, useNewSettings()));
|
||||
if(vkme_notifs()) mSelectedTabs.add(new DockBarTab("tab_feedback", oldicons() ? R.drawable.ic_menu_notifications_28 : R.drawable.ic_menu_notification_outline_28, R.string.feedback, R.id.tab_feedback, NotificationsContainerFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_messages", oldicons() ? R.drawable.ic_menu_messages_28 : R.drawable.ic_message_28_outline, R.string.messages, R.id.tab_messages, DialogsFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_profile", R.drawable.libverify_ic_account_circle_white, R.string.profile, R.id.profile, ProfileFragment.class));
|
||||
@@ -110,7 +108,7 @@ public class DockBarManager {
|
||||
mDisabledTabs.add(new DockBarTab("tab_payments", R.drawable.ic_money_transfer_24, R.string.money_transfer_money_transfers, R.id.menu_payments, MoneyTransfersFragment.class));
|
||||
mDisabledTabs.add(new DockBarTab("tab_vk_apps", R.drawable.ic_services_24, R.string.menu_apps, R.id.menu_vk_apps, AppsFragment.class));
|
||||
mDisabledTabs.add(new DockBarTab("tab_profile", R.drawable.libverify_ic_account_circle_white, R.string.profile, R.id.profile, ProfileFragment.class));
|
||||
mDisabledTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, SettingsListFragment.class));
|
||||
mDisabledTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, useNewSettings()));
|
||||
mDisabledTabs.add(new DockBarTab("tab_brtd", R.drawable.ic_menu_birthdays, R.string.birthdays_title, R.id.menu_birthdays, BirthdaysFragment.class));
|
||||
|
||||
} else {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.StrictMode;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
@@ -32,6 +33,7 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.vk.navigation.Navigator;
|
||||
import com.vtosters.lite.UserProfile;
|
||||
import com.vtosters.lite.VKActivity;
|
||||
import com.vtosters.lite.api.ExtendedUserProfile;
|
||||
@@ -149,6 +151,26 @@ public class Globals {
|
||||
Runtime.getRuntime().exit(0);
|
||||
} // Application restart (works on sdk 29+ too)
|
||||
|
||||
public static void restartApplicationWithTimer() {
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
restartApplication();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
public static void restartApplicationInto(Class Class) {
|
||||
Context ctx = getContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
|
||||
Intent intent = new Navigator(Class).a(ctx);
|
||||
Intent mainIntent = Intent.makeRestartActivityTask(intent.getComponent());
|
||||
ctx.startActivity(mainIntent);
|
||||
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Context getContext() {
|
||||
try {
|
||||
|
||||
@@ -13,6 +13,7 @@ import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
|
||||
import static ru.vtosters.lite.utils.Preferences.newfeed;
|
||||
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
|
||||
import com.vk.apps.AppsFragment;
|
||||
@@ -28,7 +29,6 @@ import com.vk.notifications.NotificationsContainerFragment;
|
||||
import com.vtosters.lite.fragments.GamesFragment;
|
||||
import com.vtosters.lite.fragments.PhotosFragment;
|
||||
import com.vtosters.lite.fragments.ProfileFragment;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
import com.vtosters.lite.fragments.d.DocumentsViewFragment;
|
||||
import com.vtosters.lite.fragments.f.FriendsFragment;
|
||||
import com.vtosters.lite.fragments.g.BirthdaysFragment;
|
||||
@@ -209,7 +209,7 @@ public class Newsfeed {
|
||||
case "videos":
|
||||
return VideosFragment.class;
|
||||
case "settings":
|
||||
return SettingsListFragment.class;
|
||||
return useNewSettings();
|
||||
case "apps":
|
||||
return AppsFragment.class;
|
||||
case "discover":
|
||||
|
||||
@@ -27,11 +27,14 @@ import android.util.Log;
|
||||
import com.vk.core.util.Screen;
|
||||
import com.vk.im.engine.models.users.UserSex;
|
||||
import com.vtosters.lite.data.Users;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import ru.vtosters.lite.ui.fragments.VKMeSettings;
|
||||
|
||||
public class Preferences {
|
||||
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
|
||||
|
||||
@@ -143,6 +146,11 @@ public class Preferences {
|
||||
return getBoolValue("awayphp", true);
|
||||
}
|
||||
|
||||
public static Class useNewSettings() {
|
||||
boolean bool = getBoolValue("useNewSettings", true);
|
||||
return bool? VKMeSettings.class : SettingsListFragment.class;
|
||||
}
|
||||
|
||||
public static boolean VKUI_INJ() {
|
||||
return getBoolValue("VKUI_INJ", true);
|
||||
}
|
||||
|
||||
@@ -58,15 +58,15 @@ body[scheme=space_gray] {
|
||||
--counter_secondary_text: #000000 !important;
|
||||
--loader_background: #000000 !important;
|
||||
--overlay_status_background: #000000 !important;
|
||||
--header_background: #19191a !important;
|
||||
--header_alternate_background: #19191a !important;
|
||||
--header_background: #000000 !important;
|
||||
--header_alternate_background: #000000 !important;
|
||||
--separator_alternate: #000000 !important;
|
||||
--segmented_control_bar_background: #000000 !important;
|
||||
--search_bar_background: #000000 !important;
|
||||
/* background */
|
||||
--background_page: #000000 !important;
|
||||
--header_background_before_blur: #19191a !important;
|
||||
--header_background_before_blur_alternate: #19191a !important;
|
||||
--header_background_before_blur: #000000 !important;
|
||||
--header_background_before_blur_alternate: #000000 !important;
|
||||
/* lighter BG (text fields) */
|
||||
--attach_picker_tab_inactive_background: #121212 !important;
|
||||
--background_keyboard: #121212 !important;
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/gray_950</item>
|
||||
<item name="header_background_before_blur_alternate">@color/gray_950</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -579,7 +579,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@android:color/system_accent1_100</item>
|
||||
@@ -1244,7 +1244,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/black</item>
|
||||
<item name="header_background_before_blur_alternate">@color/black</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -1429,7 +1429,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@android:color/system_accent1_100</item>
|
||||
@@ -2085,7 +2085,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/black</item>
|
||||
<item name="header_background_before_blur_alternate">@color/black</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -2270,7 +2270,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@android:color/system_accent1_100</item>
|
||||
|
||||
@@ -1504,7 +1504,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/black</item>
|
||||
<item name="header_background_before_blur_alternate">@color/black</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -1689,7 +1689,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@color/sky_300</item>
|
||||
@@ -4803,7 +4803,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/gray_950</item>
|
||||
<item name="header_background_before_blur_alternate">@color/gray_950</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -4902,7 +4902,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@color/sky_300</item>
|
||||
@@ -7500,7 +7500,7 @@
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background">@color/black</item>
|
||||
<item name="header_background_before_blur">@color/gray_950</item>
|
||||
<item name="header_background_before_blur_alternate">@color/gray_950</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
@@ -7681,7 +7681,7 @@
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/gray_800</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_background">@color/black</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@color/sky_300</item>
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
android:defaultValue="true"
|
||||
android:key="disableanimstickers"
|
||||
android:title="Disable anim stickers + suggestions" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="useNewSettings"
|
||||
android:title="Use New Settings" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/debug_developer_functions">
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
android:entryValues="@array/lighttheme"
|
||||
android:key="lighttheme"
|
||||
android:title="@string/appearance_theme_light_theme" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="systemtheme"
|
||||
android:summary="@string/appearance_theme_use_system_summary"
|
||||
android:title="@string/appearance_theme_use_system" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="oldicons"
|
||||
|
||||
@@ -3610,6 +3610,10 @@
|
||||
|
||||
const-class v2, Lcom/vtosters/lite/fragments/SettingsListFragment;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->useNewSettings()Ljava/lang/Class;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
invoke-direct {v0, v2, v12}, Lcom/vk/navigation/Navigator;-><init>(Ljava/lang/Class;Landroid/os/Bundle;)V
|
||||
|
||||
invoke-virtual {v0, v1}, Lcom/vk/navigation/Navigator;->c(Landroid/content/Context;)V
|
||||
@@ -4670,6 +4674,10 @@
|
||||
|
||||
const-class v0, Lcom/vtosters/lite/fragments/SettingsListFragment;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->useNewSettings()Ljava/lang/Class;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-direct {v8, v0}, Lcom/vk/navigation/Navigator;-><init>(Ljava/lang/Class;)V
|
||||
|
||||
invoke-virtual {v8, v1}, Lcom/vk/navigation/Navigator;->a(Landroid/content/Context;)Landroid/content/Intent;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final b:I
|
||||
.field public final b:I
|
||||
|
||||
.field private final c:Lcom/vk/im/engine/models/typing/ComposingType;
|
||||
|
||||
|
||||
@@ -85,9 +85,7 @@
|
||||
|
||||
invoke-static {v0}, Lcom/vtosters/lite/fragments/SettingsListFragment;->b(Lcom/vtosters/lite/fragments/SettingsListFragment;)V
|
||||
|
||||
const-string v0, "\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435!"
|
||||
|
||||
invoke-static {v0}, Lcom/vk/core/util/ToastUtils;->a(Ljava/lang/CharSequence;)V
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Globals;->restartApplicationWithTimer()V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
@@ -217,6 +217,10 @@
|
||||
|
||||
const-class v2, Lcom/vtosters/lite/fragments/SettingsListFragment;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->useNewSettings()Ljava/lang/Class;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
invoke-direct {p2, v1, v2}, Lcom/vk/menu/MenuFragment$c;->a(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Class;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
Reference in New Issue
Block a user