autoupdated disabler
This commit is contained in:
@@ -288,7 +288,7 @@ public class Preferences {
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public static boolean checkupdates() {
|
||||
return !getBoolValue("isRoamingState", false) && isValidSignature() && BuildConfig.BUILD_TYPE.equals("release");
|
||||
return !getBoolValue("isRoamingState", false) && isValidSignature() && BuildConfig.BUILD_TYPE.equals("release") && getBoolValue("autoupdates", true);
|
||||
}
|
||||
|
||||
public static boolean isNewBuild() {
|
||||
|
||||
@@ -689,6 +689,19 @@ public class VTSettings extends TrackedMaterialPreferenceToolbarFragment {
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
||||
getPreferenceScreen(),
|
||||
"autoupdates",
|
||||
"Автоматическое обновление",
|
||||
"Получать уведомление о выходе новой версии приложения",
|
||||
R.drawable.ic_history_outline_28,
|
||||
true,
|
||||
(preference, o) -> {
|
||||
Preferences.getPreferences().edit().putBoolean("autoupdates", (boolean) o).apply();
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class LifecycleUtils {
|
||||
}
|
||||
|
||||
public static Activity getCurrentActivity() {
|
||||
return activities.size() > 0 ? activities.get(activities.size() - 1) : new MainActivity();
|
||||
return !activities.isEmpty() ? activities.get(activities.size() - 1) : new MainActivity();
|
||||
}
|
||||
|
||||
public static void restartApplication() {
|
||||
|
||||
Reference in New Issue
Block a user