Fixes + new update feed logic
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.ui.fragments.dockbar.DockBarManager.*;
|
||||
import static ru.vtosters.lite.utils.Globals.*;
|
||||
import static ru.vtosters.lite.utils.Preferences.*;
|
||||
import static java.lang.Long.MAX_VALUE;
|
||||
import static ru.vtosters.lite.ui.fragments.dockbar.DockBarManager.getInstance;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
import static ru.vtosters.lite.utils.Preferences.adsgroup;
|
||||
import static ru.vtosters.lite.utils.Preferences.adsstories;
|
||||
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.copyright_post;
|
||||
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
|
||||
|
||||
import com.vk.apps.AppsFragment;
|
||||
import com.vk.core.preference.Preference;
|
||||
import com.vk.fave.fragments.FaveTabFragment;
|
||||
import com.vk.menu.MenuFragment;
|
||||
import com.vk.music.fragment.MusicFragment;
|
||||
@@ -174,6 +183,20 @@ public class Newsfeed {
|
||||
return def;
|
||||
}
|
||||
|
||||
public static long getUpdateNewsfeed(boolean refresh_timeout) {
|
||||
String string = getPreferences().getString("newsupdate", "");
|
||||
if (string.isEmpty()) {
|
||||
return Preference.b().getLong(refresh_timeout ? "refresh_timeout_top" : "refresh_timeout_recent", 600000L);
|
||||
}
|
||||
if (string.equals("no_update")) {
|
||||
return MAX_VALUE;
|
||||
}
|
||||
if (string.equals("imd_update")) {
|
||||
return 10000L;
|
||||
}
|
||||
return Preference.b().getLong(refresh_timeout ? "refresh_timeout_top" : "refresh_timeout_recent", 600000L);
|
||||
}
|
||||
|
||||
public static Class getStartFragment() {
|
||||
String string = getPreferences().getString("start_values", "");
|
||||
if (string.equals("default")) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.*;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
|
||||
import static ru.vtosters.lite.utils.Globals.*;
|
||||
import static ru.vtosters.lite.utils.Newsfeed.*;
|
||||
import static ru.vtosters.lite.utils.Proxy.*;
|
||||
@@ -17,7 +17,15 @@ import com.vtosters.lite.data.Users;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Preferences {
|
||||
public static String VERSIONNAME = "2.0 Beta";
|
||||
public static String VERSIONNAME = "Beta";
|
||||
|
||||
public static void init(Application application) {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
migrate();
|
||||
registerActivities(application);
|
||||
}
|
||||
|
||||
public static boolean BooleanFalse(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
@@ -29,13 +37,6 @@ public class Preferences {
|
||||
return prefs.getBoolean(key, true);
|
||||
}
|
||||
|
||||
public static String getBackgroundStickers() {
|
||||
if (isBGStickersEnabled()) {
|
||||
return "images_with_background";
|
||||
}
|
||||
return "images";
|
||||
}
|
||||
|
||||
public static boolean authorsrecomm() {
|
||||
return BooleanTrue("authorsrecomm");
|
||||
}
|
||||
@@ -144,10 +145,6 @@ public class Preferences {
|
||||
return BooleanTrue("dockcounter");
|
||||
}
|
||||
|
||||
public static boolean feedautoupdate() {
|
||||
return BooleanTrue("feedautoupdate");
|
||||
}
|
||||
|
||||
public static boolean feedcache() {
|
||||
return BooleanTrue("feedcache");
|
||||
}
|
||||
@@ -319,12 +316,4 @@ public class Preferences {
|
||||
}
|
||||
return string.isEmpty() ? Locale.getDefault().getLanguage() : string;
|
||||
}
|
||||
|
||||
public static void init(Application application) {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
migrate();
|
||||
registerActivities(application);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,4 +194,10 @@ public class Themes {
|
||||
return VKThemeHelper.a(R.attr.tabbar_background);
|
||||
}
|
||||
|
||||
public static String getBackgroundStickers() {
|
||||
if (isBGStickersEnabled()) {
|
||||
return "images_with_background";
|
||||
}
|
||||
return "images";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user