Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcdd83243b | ||
|
|
bc3e5a706d | ||
|
|
0b56d9dd23 | ||
|
|
62ccdf8eba | ||
|
|
72f4226419 | ||
|
|
f6a45beac5 | ||
|
|
a657ddef58 | ||
|
|
726e38ff2e | ||
|
|
191d3f760e | ||
|
|
2cd3b0f39c | ||
|
|
abd990eef7 | ||
|
|
cd875af7d7 | ||
|
|
b1e8f93371 | ||
|
|
64afd0222b | ||
|
|
32369f1f38 | ||
|
|
f00be506cc | ||
|
|
248fd1ce9c | ||
|
|
3e2d4bb665 | ||
|
|
92689941ca | ||
|
|
c46110cfea | ||
|
|
b5250e0b8d | ||
|
|
0e81397305 | ||
|
|
95d306eaed | ||
|
|
339a4fe01f | ||
|
|
48cdbc7681 | ||
|
|
5e85ba10f4 | ||
|
|
ea7dd7aba5 |
@@ -118,6 +118,19 @@ public class PreferencesUtil {
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreferenceDrawable(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, @Nullable Drawable icon, Preference.c listener) {
|
||||
Preference preference = new Preference(getContext());
|
||||
preference.b(summary); // setSummary
|
||||
preference.c(title); // setTitle
|
||||
preference.d(key); // setKey
|
||||
|
||||
if (icon != null)
|
||||
preference.a(icon); // preference.setIcon
|
||||
preference.a(listener); // preference.setOnPreferenceClickListener(listener)
|
||||
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreferenceCategory(MaterialPreferenceToolbarFragment fragment, CharSequence title) {
|
||||
PreferenceCategory preference = new PreferenceCategory(getContext(), null);
|
||||
preference.c(title); // setTitle
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -18,16 +17,20 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
|
||||
}
|
||||
|
||||
private void prefs() {
|
||||
a("newfeed").a(new a());
|
||||
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;
|
||||
}
|
||||
|
||||
public class a implements Preference.b {
|
||||
a() {
|
||||
public class restart implements Preference.b {
|
||||
restart() {
|
||||
}
|
||||
|
||||
@Override // android.support.v7.preference.Preference.b
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
@@ -10,5 +13,25 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
|
||||
public void b(Bundle bundle) {
|
||||
super.b(bundle);
|
||||
a(R.xml.preferences_messages);
|
||||
prefs();
|
||||
}
|
||||
|
||||
private void prefs() {
|
||||
a("vkme").a(new MessagesFragment.restart());
|
||||
}
|
||||
|
||||
public boolean restart(Preference preference, Object obj) {
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
}
|
||||
|
||||
public class restart implements Preference.b {
|
||||
restart() {
|
||||
}
|
||||
|
||||
@Override // android.support.v7.preference.Preference.b
|
||||
public boolean a(Preference preference, Object obj) {
|
||||
return MessagesFragment.this.restart(preference, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,385 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static bruhcollective.itaysonlab.libvkx.client.LibVKXClient.isIntegrationEnabled;
|
||||
import static ru.vtosters.lite.f0x1d.VTVerifications.vtverif;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.getAccountPrefsCount;
|
||||
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.ui.fragments.multiaccount.MultiAccountManager.workingAccounts;
|
||||
import static ru.vtosters.lite.utils.About.getBuildNumber;
|
||||
import static ru.vtosters.lite.utils.About.getCommitLink;
|
||||
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.getPrefsValue;
|
||||
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.ads;
|
||||
import static ru.vtosters.lite.utils.Preferences.devmenu;
|
||||
import static ru.vtosters.lite.utils.Preferences.disableSettingsSumms;
|
||||
import static ru.vtosters.lite.utils.Preferences.hasSpecialVerif;
|
||||
import static ru.vtosters.lite.utils.Preferences.navbar;
|
||||
import static ru.vtosters.lite.utils.Preferences.offline;
|
||||
import static ru.vtosters.lite.utils.Preferences.shortinfo;
|
||||
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 static ru.vtosters.lite.utils.Themes.setTheme;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.aefyr.tsg.g2.TelegramStickersService;
|
||||
import com.vk.about.AboutAppFragment;
|
||||
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.dockbar.DockBarManager;
|
||||
import ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountFragment;
|
||||
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
|
||||
|
||||
public class VTSettings extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override
|
||||
public void b(Bundle bundle) {
|
||||
super.b(bundle);
|
||||
|
||||
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" + getUserId();
|
||||
|
||||
String feedsumm = getValAsString("vtlfeedsumm", ads());
|
||||
String docksumm = getDocksumm();
|
||||
String musicsumm = getValAsString("vtlmusicsumm", isIntegrationEnabled());
|
||||
String msgsumm = getValAsString("vtlmsgsumm", vkme());
|
||||
String activitysumm = getValAsString("vtlactivitysumm", !offline());
|
||||
String themessumm = getValAsString("vtlthemessumm", navbar());
|
||||
String tgssumm = getTGSsumm();
|
||||
String interfacesumm = getValAsString("vtlinterfacesumm", shortinfo());
|
||||
String proxysumm = getValAsString("vtlproxysumm", !getPrefsValue("proxy").equals("noproxy"));
|
||||
String othersumm = getValAsString("vtlothersumm", vtverif());
|
||||
String multiaccsumm = getMultiAccsumm();
|
||||
String ssfs = getSSFSsumm();
|
||||
String about = "Commit: " + getBuildNumber();
|
||||
|
||||
int vtosterXml = getIdentifier("empty", "xml");
|
||||
this.a(vtosterXml);
|
||||
|
||||
if (vkme()) {
|
||||
PreferencesUtil.addPreferenceDrawable(this, "", name, id, drawableFromUrl(avatarUrl), preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MultiAccountFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
PreferencesUtil.addPreference(this, "", getString("accounts"), multiaccsumm, "ic_user_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(MultiAccountFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("vtsettdarktheme"));
|
||||
}
|
||||
|
||||
PreferencesUtil.addMaterialSwitchPreference(this, "isdark", getString("vtsettdarktheme"), "", "ic_palette_24", false, (preference, o) -> {
|
||||
boolean value = (boolean) o;
|
||||
|
||||
if(value){
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
} else {
|
||||
applyTheme(getDarkTheme(), getImDarkTheme());
|
||||
}
|
||||
|
||||
edit().putBoolean("isdark", value).commit();
|
||||
|
||||
setTheme(this.p());
|
||||
|
||||
restartApplicationWithTimer();
|
||||
return true;
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
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, getString("vtsettaccount"));
|
||||
|
||||
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"), ssfs, "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, getString("vtsettmod"));
|
||||
|
||||
if (!vkme()) {
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlfeed"), feedsumm, "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"), docksumm, "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"), musicsumm, "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"), msgsumm, "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"), activitysumm, "ic_write_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ActivityFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlthemes"), themessumm, "ic_palette_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ThemesFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtltgs"), tgssumm, "ic_telegram", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(StickersFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlinterface"), interfacesumm, "ic_interface", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(InterfaceFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlproxy"), proxysumm, "ic_globe_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(ProxySettingsFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("vtlother"), othersumm, "ic_more_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(OtherFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("vtsettaboutmod"));
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("menu_about"), about, "ic_about_24", preference -> {
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(AboutAppFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
return false;
|
||||
});
|
||||
|
||||
PreferencesUtil.addPreference(this, "", getString("opencommit"), "", "ic_link_24", preference -> {
|
||||
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse(getCommitLink())));
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
public static String getValAsString(String stringid, Boolean value) {
|
||||
if(disableSettingsSumms()) return "";
|
||||
|
||||
if (value){
|
||||
return getString(stringid) + ": " + getString("vtlsettenabled");
|
||||
}
|
||||
|
||||
return getString(stringid) + ": " + getString("vtlsettdisabled");
|
||||
}
|
||||
|
||||
public static String getSSFSsumm() {
|
||||
if(disableSettingsSumms()) return "";
|
||||
|
||||
if(hasSpecialVerif()) return getString("vtlssfssumm") + ": " + getString("vtlsettverifyes");
|
||||
|
||||
return getString("vtlssfssumm") + ": " + getString("vtlsettverifno");
|
||||
}
|
||||
|
||||
public static String getDocksumm() {
|
||||
if(disableSettingsSumms()) return "";
|
||||
|
||||
return getString("vtldocksumm") + ": " + DockBarManager.getInstance().getTabCount();
|
||||
}
|
||||
|
||||
public static String getTGSsumm() {
|
||||
if(disableSettingsSumms()) return "";
|
||||
|
||||
return getString("vtltgssumm") + ": " + TelegramStickersService.getInstance(getContext()).getPacksListReference().size();
|
||||
}
|
||||
|
||||
public static String getMultiAccsumm() {
|
||||
if(disableSettingsSumms() || getAccountPrefsCount() <= 1) return "";
|
||||
|
||||
return getString("vtlmultiaccsumm") + ": " + workingAccounts();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int aq() {
|
||||
return getIdentifier("notification_settings", "string");
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ 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;
|
||||
|
||||
import com.vk.apps.AppsFragment;
|
||||
import com.vk.discover.DiscoverFragment;
|
||||
@@ -18,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;
|
||||
@@ -79,6 +81,14 @@ public class DockBarManager {
|
||||
File dockbar = new File(getContext().getFilesDir(), "dockbar.json");
|
||||
|
||||
if (!dockbar.exists()) {
|
||||
if(vkme()) {
|
||||
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));
|
||||
return;
|
||||
}
|
||||
|
||||
mSelectedTabs.add(new DockBarTab("tab_news", oldicons() ? R.drawable.ic_newsfeed_28 : R.drawable.ic_menu_newsfeed_outline_28, R.string.newsfeed, R.id.tab_news, newfeed() ? HomeFragment.class : NewsfeedFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_discover", oldicons() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, DiscoverFragment.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));
|
||||
@@ -98,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 {
|
||||
@@ -225,8 +235,11 @@ public class DockBarManager {
|
||||
int target = adapter.getIndexByViewType(toPosition, adapter.getItemType(toPosition));
|
||||
if (fromPosition < toPosition) {
|
||||
|
||||
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu"))
|
||||
return;
|
||||
if(!vkme()){
|
||||
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu")){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DockBarTab tab = mSelectedTabs.get(curr);
|
||||
mSelectedTabs.remove(tab);
|
||||
@@ -296,6 +309,10 @@ public class DockBarManager {
|
||||
return mSelectedTabs.get(getIndexByViewType(pos, 1));
|
||||
}
|
||||
|
||||
public int getTabCount() {
|
||||
return mSelectedTabs.size();
|
||||
}
|
||||
|
||||
public DockBarTab getDisabledTab(int pos) {
|
||||
return mDisabledTabs.get(getIndexByViewType(pos, 2));
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MultiAccountManager {
|
||||
return getContext().getSharedPreferences("pref_account_manager" + (account != 0 ? account : ""), Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
private static int getAccountPrefsCount() {
|
||||
public static int getAccountPrefsCount() {
|
||||
File[] prefs = new File(getContext().getFilesDir().getParent(), "shared_prefs")
|
||||
.listFiles((dir, name) -> {
|
||||
return name.matches("pref_account_manager\\d+\\.xml");
|
||||
@@ -46,7 +46,7 @@ public class MultiAccountManager {
|
||||
return prefs != null ? prefs.length : 0;
|
||||
}
|
||||
|
||||
private static String withRegex(String base, String regex, String def) {
|
||||
public static String withRegex(String base, String regex, String def) {
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(base);
|
||||
if (matcher.find()) {
|
||||
@@ -57,7 +57,7 @@ public class MultiAccountManager {
|
||||
|
||||
public static List<MultiAccountItem> buildList() {
|
||||
List<MultiAccountItem> list = new ArrayList<>();
|
||||
for (int i = 0; i <= getAccountPrefsCount(); i++) {
|
||||
for (int i = 0; i <= workingAccounts(); i++) {
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
String keyVKAccount = prefs.getString("key_vk_account", "");
|
||||
if (!keyVKAccount.isEmpty()) {
|
||||
@@ -72,6 +72,18 @@ public class MultiAccountManager {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static int workingAccounts() {
|
||||
int count = 0;
|
||||
for (int i = 0; i <= getAccountPrefsCount(); i++) {
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
String keyVKAccount = prefs.getString("key_vk_account", "");
|
||||
if (!keyVKAccount.isEmpty()) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public static boolean switchAccount(int i) {
|
||||
int account = getPreferences().getInt("account", 0);
|
||||
if (account == i) return false;
|
||||
@@ -81,7 +93,7 @@ public class MultiAccountManager {
|
||||
}
|
||||
|
||||
public static void addAccount() {
|
||||
getPreferences().edit().putInt("account", getAccountPrefsCount()).commit();
|
||||
getPreferences().edit().putInt("account", workingAccounts()).commit();
|
||||
}
|
||||
|
||||
public static void deleteAccount(int i) {
|
||||
@@ -90,7 +102,7 @@ public class MultiAccountManager {
|
||||
prefs.edit().clear().commit();
|
||||
File file = new File(new File(getContext().getFilesDir().getParent(), "shared_prefs"), "pref_account_manager" + i);
|
||||
if (file.exists()) file.delete();
|
||||
if (account == i && getAccountPrefsCount() > 0) {
|
||||
if (account == i && workingAccounts() > 0) {
|
||||
List<MultiAccountItem> accounts = buildList();
|
||||
if (accounts.size() > 0)
|
||||
switchAccount(buildList().get(0).index);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static androidx.core.content.ContextCompat.getDrawable;
|
||||
import static ru.vtosters.lite.utils.Preferences.getLocale;
|
||||
import static ru.vtosters.lite.utils.Preferences.preferences;
|
||||
import static ru.vtosters.lite.utils.Themes.isDarkTheme;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
@@ -13,10 +15,18 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
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;
|
||||
import android.widget.Toast;
|
||||
@@ -24,13 +34,17 @@ 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;
|
||||
import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -92,6 +106,41 @@ public class Globals {
|
||||
return extendedUserProfile.a;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Drawable drawableFromUrl(String url) {
|
||||
try {
|
||||
URL aryURI = new URL(url);
|
||||
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(policy);
|
||||
|
||||
URLConnection conn = aryURI.openConnection();
|
||||
InputStream is = conn.getInputStream();
|
||||
Bitmap bmp = BitmapFactory.decodeStream(is);
|
||||
|
||||
return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(getBitmapClippedCircle(bmp), convertDpToPixel(48), convertDpToPixel(48), true));
|
||||
} catch (Exception e) {
|
||||
return getDrawable(getContext(), com.vtosters.lite.R.drawable.libverify_ic_account_circle_white);
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap getBitmapClippedCircle(Bitmap bitmap) {
|
||||
final int width = bitmap.getWidth();
|
||||
final int height = bitmap.getHeight();
|
||||
final Bitmap outputBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
|
||||
final Path path = new Path();
|
||||
path.addCircle(
|
||||
(float)(width / 2)
|
||||
, (float)(height / 2)
|
||||
, (float) Math.min(width, (height / 2))
|
||||
, Path.Direction.CCW);
|
||||
|
||||
final Canvas canvas = new Canvas(outputBitmap);
|
||||
canvas.clipPath(path);
|
||||
canvas.drawBitmap(bitmap, 0, 0, null);
|
||||
return outputBitmap;
|
||||
}
|
||||
|
||||
public static void restartApplication() {
|
||||
Context ctx = getContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
@@ -103,6 +152,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 {
|
||||
@@ -254,6 +323,8 @@ public class Globals {
|
||||
configuration.setLayoutDirection(locale);
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
|
||||
edit().putBoolean("isdark", isDarkTheme()).commit();
|
||||
|
||||
return context;
|
||||
} // Language changer and BaseContext injector
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ 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;
|
||||
import com.vk.core.preference.Preference;
|
||||
@@ -27,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;
|
||||
@@ -175,6 +176,9 @@ public class Newsfeed {
|
||||
}
|
||||
|
||||
public static long getUpdateNewsfeed(boolean refresh_timeout) {
|
||||
if (vkme()) {
|
||||
return MAX_VALUE;
|
||||
}
|
||||
switch (getPrefsValue("newsupdate")) {
|
||||
case "no_update":
|
||||
return MAX_VALUE;
|
||||
@@ -186,6 +190,9 @@ public class Newsfeed {
|
||||
}
|
||||
|
||||
public static Class getStartFragment() {
|
||||
if (vkme()) {
|
||||
return DialogsFragment.class;
|
||||
}
|
||||
switch (getPrefsValue("start_values")) {
|
||||
case "newsfeed":
|
||||
return newfeed() ? HomeFragment.class : NewsfeedFragment.class;
|
||||
@@ -202,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":
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static android.os.Build.VERSION;
|
||||
import static ru.vtosters.lite.f0x1d.VTVerifications.hasPrometheus;
|
||||
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
|
||||
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
|
||||
@@ -27,11 +28,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.VTSettings;
|
||||
|
||||
public class Preferences {
|
||||
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
|
||||
|
||||
@@ -47,7 +51,9 @@ public class Preferences {
|
||||
migrate();
|
||||
reloadMessagesList();
|
||||
registerActivities(application);
|
||||
LoadLibrary("vkopustest");
|
||||
if(dev()){
|
||||
LoadLibrary("vkopustest");
|
||||
}
|
||||
systemThemeChanger();
|
||||
} // VK Init
|
||||
|
||||
@@ -74,7 +80,7 @@ public class Preferences {
|
||||
}
|
||||
|
||||
public static boolean systemtheme() {
|
||||
return getBoolValue("systemtheme", true);
|
||||
return getBoolValue("systemtheme", true) && VERSION.SDK_INT >= 28;
|
||||
}
|
||||
|
||||
public static boolean authorsrecomm() {
|
||||
@@ -117,6 +123,10 @@ public class Preferences {
|
||||
return getBoolValue("oldicons", false);
|
||||
}
|
||||
|
||||
public static boolean vkme() {
|
||||
return getBoolValue("vkme", false);
|
||||
}
|
||||
|
||||
public static boolean adsslider() {
|
||||
return getBoolValue("__dbg_no_slider_ads", false);
|
||||
}
|
||||
@@ -137,6 +147,11 @@ public class Preferences {
|
||||
return getBoolValue("awayphp", true);
|
||||
}
|
||||
|
||||
public static Class useNewSettings() {
|
||||
boolean bool = getBoolValue("useNewSettings", true);
|
||||
return bool? VTSettings.class : SettingsListFragment.class;
|
||||
}
|
||||
|
||||
public static boolean VKUI_INJ() {
|
||||
return getBoolValue("VKUI_INJ", true);
|
||||
}
|
||||
@@ -182,7 +197,7 @@ public class Preferences {
|
||||
}
|
||||
|
||||
public static boolean dockcounter() {
|
||||
return getBoolValue("dockcounter", true);
|
||||
return getBoolValue("dockcounter", true) && !vkme();
|
||||
}
|
||||
|
||||
public static boolean feedcache() {
|
||||
@@ -338,6 +353,10 @@ public class Preferences {
|
||||
return getBoolValue("vkme_msg", false);
|
||||
}
|
||||
|
||||
public static boolean vkme_notifs() {
|
||||
return getBoolValue("vkme_notifs", false);
|
||||
}
|
||||
|
||||
public static boolean roundedmsgs() {
|
||||
return getBoolValue("roundedmsgs", false);
|
||||
}
|
||||
@@ -346,6 +365,10 @@ public class Preferences {
|
||||
return getBoolValue("disableanimstickers", true);
|
||||
}
|
||||
|
||||
public static boolean disableSettingsSumms() {
|
||||
return getBoolValue("disableSettingsSumms", false);
|
||||
}
|
||||
|
||||
public static boolean donaterecomm() {
|
||||
return getBoolValue("donaterecomm", false);
|
||||
}
|
||||
@@ -366,6 +389,11 @@ public class Preferences {
|
||||
return isVerified(getUserId());
|
||||
}
|
||||
|
||||
public static boolean hasSpecialVerif() {
|
||||
return hasPrometheus(getUserId());
|
||||
}
|
||||
|
||||
|
||||
public static String getLocale() {
|
||||
String string = getPrefsValue("lang_value");
|
||||
|
||||
|
||||
@@ -200,7 +200,6 @@ public class Proxy {
|
||||
return getPrefsValue("proxy").equals("apiproxy");
|
||||
}
|
||||
|
||||
|
||||
public static boolean proxyvk() {
|
||||
return getBoolValue("proxyvk", false);
|
||||
} // Official vk proxy enforcer
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
|
||||
import static com.vk.im.ui.themes.ImTheme.*;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
|
||||
import static ru.vtosters.lite.utils.Globals.getResources;
|
||||
@@ -9,8 +11,10 @@ import static ru.vtosters.lite.utils.Preferences.isBGStickersEnabled;
|
||||
import static ru.vtosters.lite.utils.Preferences.navbar;
|
||||
import static ru.vtosters.lite.utils.Preferences.roundedmsgs;
|
||||
import static ru.vtosters.lite.utils.Preferences.systemtheme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vksans;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
@@ -44,6 +48,9 @@ public class Themes {
|
||||
ImThemeHelper.b.a(imtheme); // ImThemeHelper.b.a(ImTheme value) VK Theme Msg apply
|
||||
} // Apply VKTheme and ImTheme (hard applying without dynamic theme changing)
|
||||
|
||||
public static void setTheme(Activity activity) {
|
||||
VKThemeHelper.a(activity); // apply changed theme
|
||||
}
|
||||
public static boolean isDarkTheme() {
|
||||
return !VKThemeHelper.d();
|
||||
}
|
||||
@@ -126,9 +133,9 @@ public class Themes {
|
||||
public static ImTheme getImDarkTheme() {
|
||||
switch (getPrefsValue("darktheme")) {
|
||||
case "amoled":
|
||||
return roundedmsgs() ? ImTheme.VKME_AMOLED : ImTheme.VKAPP_AMOLED;
|
||||
return roundedmsgs() ? VKME_AMOLED : VKAPP_AMOLED;
|
||||
default:
|
||||
return roundedmsgs() ? ImTheme.VKME_DARK : ImTheme.VKAPP_DARK;
|
||||
return roundedmsgs() ? VKME_DARK : VKAPP_DARK;
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
@@ -142,7 +149,7 @@ public class Themes {
|
||||
public static ImTheme getImLightTheme() {
|
||||
switch (getPrefsValue("lighttheme")) {
|
||||
default:
|
||||
return roundedmsgs() ? ImTheme.VKME_LIGHT : ImTheme.VKAPP_LIGHT;
|
||||
return roundedmsgs() ? VKME_LIGHT : VKAPP_LIGHT;
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
@@ -311,24 +318,41 @@ public class Themes {
|
||||
return "images";
|
||||
}
|
||||
|
||||
public static int getNavigationHeight(int Default) {
|
||||
int VKME = R.dimen.design_bottom_sheet_peek_height_min;
|
||||
|
||||
return vkme()? VKME : Default;
|
||||
}
|
||||
|
||||
public static int getNavigationWidth(int Default) {
|
||||
int VKME = R.dimen.app_minimumsize_h;
|
||||
|
||||
return vkme()? VKME : Default;
|
||||
}
|
||||
|
||||
public static void systemThemeChanger() {
|
||||
if (isDarkTheme()){
|
||||
boolean isDarkTheme = isDarkTheme();
|
||||
|
||||
if (isDarkTheme){
|
||||
applyTheme(getDarkTheme(), getImDarkTheme());
|
||||
} else {
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
}
|
||||
|
||||
if (!systemtheme()) return;
|
||||
if (!systemtheme()){
|
||||
edit().putBoolean("isdark", isDarkTheme).commit();
|
||||
return;
|
||||
}
|
||||
|
||||
int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
switch (currentNightMode) {
|
||||
case Configuration.UI_MODE_NIGHT_UNDEFINED:
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
break;
|
||||
case Configuration.UI_MODE_NIGHT_NO:
|
||||
edit().putBoolean("isdark", false).commit();
|
||||
applyTheme(getLightTheme(), getImLightTheme());
|
||||
break;
|
||||
case Configuration.UI_MODE_NIGHT_YES:
|
||||
edit().putBoolean("isdark", true).commit();
|
||||
applyTheme(getDarkTheme(), getImDarkTheme());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
Before Width: | Height: | Size: 975 B After Width: | Height: | Size: 664 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 651 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 629 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 773 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 895 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -16,7 +16,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0sp"
|
||||
android:textColor="#ff528bcc"
|
||||
android:textColor="?accent"
|
||||
android:gravity="center|right"
|
||||
android:id="@id/tv_reset"
|
||||
android:background="@drawable/picker_white_ripple_bounded"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView android:textSize="16.0sp"
|
||||
android:textColor="@color/muted_black"
|
||||
android:textColor="?text_primary"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center|left"
|
||||
android:id="@android:id/text1"
|
||||
|
||||
@@ -4348,7 +4348,7 @@
|
||||
<string name="debug_experimental_page_stats">Статистика страницы</string>
|
||||
<string name="debug_experimental_page_stats_summary">Вкшники вроде перестали отдавать инфу</string>
|
||||
<string name="debug_experimental_vk_sans_font">Шрифт VK Sans</string>
|
||||
<string name="debug_experimental_vk_me_mode">Режим VK Me MSG</string>
|
||||
<string name="debug_experimental_vk_me_mode">Режим VK Me для диалогов</string>
|
||||
<string name="debug_experimental_libverify">Поддержка libverify</string>
|
||||
<string name="debug_experimental_libverify_summary">Включение может пофиксить 2фа вход</string>
|
||||
<string name="debug_experimental_opusmodule">Модуль Opus</string>
|
||||
@@ -4446,5 +4446,34 @@
|
||||
<string name="franimation">Анимация фрагментов (бета)</string>
|
||||
<string name="selectfranimation">Выберите анимацию фрагментов</string>
|
||||
|
||||
<string name="vkme">Режим VK Me</string>
|
||||
<string name="vkmesumm">Замена докбара и некоторых элементов на что-то похожее как в VK Me</string>
|
||||
|
||||
<string name="vtsettaccount">Аккаунт</string>
|
||||
<string name="vtsettdarktheme">Темная тема</string>
|
||||
<string name="vtsettaboutmod">О модификации</string>
|
||||
<string name="vtsettmod">Настройки мода</string>
|
||||
|
||||
<string name="vtlsettenabled">Включено</string>
|
||||
<string name="vtlsettdisabled">Отключено</string>
|
||||
|
||||
<string name="vtlsettverifno">Нет</string>
|
||||
<string name="vtlsettverifyes">Да</string>
|
||||
|
||||
<string name="vtlfeedsumm">Блокировать рекламу</string>
|
||||
<string name="vtldocksumm">Докбар элементов</string>
|
||||
<string name="vtlmusicsumm">VKX интеграция</string>
|
||||
<string name="vtlmsgsumm">Режим VK Me</string>
|
||||
<string name="vtlactivitysumm">Офлайн режим</string>
|
||||
<string name="vtlthemessumm">Покраска навбара</string>
|
||||
<string name="vtltgssumm">Установлено паков</string>
|
||||
<string name="vtlinterfacesumm">Округление чисел</string>
|
||||
<string name="vtlproxysumm">Проксирование</string>
|
||||
<string name="vtlothersumm">Отображение верификаций</string>
|
||||
<string name="vtlmultiaccsumm">Доступно аккаунтов</string>
|
||||
<string name="vtlhidesumm">Скрыть подписи в настройках</string>
|
||||
|
||||
<string name="vtlssfssumm">Есть доступ</string>
|
||||
|
||||
<string name="empty_text" />
|
||||
</resources>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -4474,7 +4474,7 @@ May look like a fake leaving the online"</string>
|
||||
<string name="debug_experimental_page_stats">Page stats</string>
|
||||
<string name="debug_experimental_page_stats_summary">VK Devs seems to have stopped sending info</string>
|
||||
<string name="debug_experimental_vk_sans_font">VK Sans font</string>
|
||||
<string name="debug_experimental_vk_me_mode">VK Me MSG mode</string>
|
||||
<string name="debug_experimental_vk_me_mode">VK Me dialogs mode</string>
|
||||
<string name="debug_experimental_libverify">libverify support</string>
|
||||
<string name="debug_experimental_libverify_summary">Turning on may fix 2fa login</string>
|
||||
<string name="debug_experimental_opusmodule">Opus Module</string>
|
||||
@@ -4580,6 +4580,35 @@ May look like a fake leaving the online"</string>
|
||||
<string name="franimation">Fragment animation (beta)</string>
|
||||
<string name="selectfranimation">Select fragment animation</string>
|
||||
|
||||
<string name="vkme">VK Me mode</string>
|
||||
<string name="vkmesumm">Replacing the dock and some elements with something similar as in VK Me</string>
|
||||
|
||||
<string name="vtsettaccount">Account</string>
|
||||
<string name="vtsettdarktheme">Dark theme</string>
|
||||
<string name="vtsettaboutmod">About modification</string>
|
||||
<string name="vtsettmod">Mod settings</string>
|
||||
|
||||
<string name="vtlsettenabled">enabled</string>
|
||||
<string name="vtlsettdisabled">disabled</string>
|
||||
|
||||
<string name="vtlsettverifno">No</string>
|
||||
<string name="vtlsettverifyes">Yes</string>
|
||||
|
||||
<string name="vtlfeedsumm">Block ads</string>
|
||||
<string name="vtldocksumm">Dockbar elements</string>
|
||||
<string name="vtlmusicsumm">VKX Integration</string>
|
||||
<string name="vtlmsgsumm">VK Me mode</string>
|
||||
<string name="vtlactivitysumm">Offline mode</string>
|
||||
<string name="vtlthemessumm">Navbar coloring</string>
|
||||
<string name="vtltgssumm">Installed packs</string>
|
||||
<string name="vtlinterfacesumm">Round numbers</string>
|
||||
<string name="vtlproxysumm">Proxy</string>
|
||||
<string name="vtlothersumm">Show verifications</string>
|
||||
<string name="vtlmultiaccsumm">Available accounts</string>
|
||||
<string name="vtlhidesumm">Hide settings summaries</string>
|
||||
|
||||
<string name="vtlssfssumm">Have access</string>
|
||||
|
||||
<item type="string" name="APKTOOL_DUMMY_10be" />
|
||||
<item type="string" name="APKTOOL_DUMMY_10bf" />
|
||||
<item type="string" name="APKTOOL_DUMMY_10c0" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -41,10 +41,6 @@
|
||||
android:defaultValue="false"
|
||||
android:key="vksans"
|
||||
android:title="@string/debug_experimental_vk_sans_font" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkme_msg"
|
||||
android:title="@string/debug_experimental_vk_me_mode" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="libverify"
|
||||
@@ -69,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
|
||||
|
||||
@@ -75,5 +75,9 @@
|
||||
android:key="dockcounter"
|
||||
android:summary="@string/docknumberssum"
|
||||
android:title="@string/docknumbers" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="disableSettingsSumms"
|
||||
android:title="@string/vtlhidesumm" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -12,6 +12,35 @@
|
||||
android:title="@string/roundedmsgs" />
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/sett_media">
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="compressPhotos"
|
||||
android:title="@string/sett_compress_photos" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="compressVideos"
|
||||
android:title="@string/sett_compress_videos" />
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="VK Me">
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkme"
|
||||
android:summary="@string/vkmesumm"
|
||||
android:title="@string/vkme" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkme_msg"
|
||||
android:summary="TODO"
|
||||
android:title="@string/debug_experimental_vk_me_mode" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkme_notifs"
|
||||
android:summary="Back notif tab"
|
||||
android:title="vkme_notifs" />
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/interfaceemoji">
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const/4 v1, 0x0
|
||||
const/4 v1, 0x1
|
||||
|
||||
invoke-virtual {v0, v1}, Lcom/vk/imageloader/view/VKImageView;->setClickable(Z)V
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -835,6 +835,12 @@
|
||||
|
||||
invoke-virtual {v0, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->vkme()Z
|
||||
|
||||
move-result v5
|
||||
|
||||
if-nez v5, :cond_228
|
||||
|
||||
new-instance v5, Lcom/vtosters/lite/fragments/SettingsListFragment$a;
|
||||
|
||||
const v6, 0x7f0803bc
|
||||
@@ -867,6 +873,7 @@
|
||||
|
||||
invoke-virtual {v0, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||||
|
||||
:cond_228
|
||||
new-instance v5, Lcom/vtosters/lite/fragments/SettingsListFragment$a;
|
||||
|
||||
const v6, 0x7f08067b
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -348,6 +348,10 @@
|
||||
|
||||
const v0, 0x7f070062
|
||||
|
||||
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result v0
|
||||
|
||||
invoke-virtual {p2, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
@@ -127,6 +127,10 @@
|
||||
|
||||
const p2, 0x7f07005b
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationWidth(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
.line 57
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
||||
|
||||
@@ -136,6 +140,10 @@
|
||||
|
||||
const p2, 0x7f07005c
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationWidth(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
.line 58
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
||||
|
||||
@@ -145,6 +153,10 @@
|
||||
|
||||
const p2, 0x7f070062
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
.line 59
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
||||
|
||||
|
||||
@@ -87,6 +87,10 @@
|
||||
|
||||
const v0, 0x7f070062
|
||||
|
||||
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result v0
|
||||
|
||||
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getDimension(I)F
|
||||
|
||||
move-result p1
|
||||
@@ -157,6 +161,10 @@
|
||||
|
||||
const p2, 0x7f070062
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
||||
|
||||
move-result p1
|
||||
@@ -227,6 +235,10 @@
|
||||
|
||||
const p2, 0x7f070062
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
||||
|
||||
move-result p1
|
||||
@@ -300,6 +312,10 @@
|
||||
|
||||
const p2, 0x7f070062
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/utils/Themes;->getNavigationHeight(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
||||
|
||||
move-result p1
|
||||
|
||||