Skip to content

Commit

Permalink
use constant
Browse files Browse the repository at this point in the history
Signed-off-by: David Luhmer <david-dev@live.de>
  • Loading branch information
David-Development committed Oct 7, 2023
1 parent 098fb15 commit ba5896d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ public class Constants {

public static final String USER_INFO_STRING = "USER_INFO";

public static final String PREVIOUS_VERSION_CODE = "PREVIOUS_VERSION_CODE";

protected static boolean isNextCloud(SharedPreferences prefs) {
int[] version = extractVersionNumberFromString(prefs.getString(Constants.NEWS_WEB_VERSION_NUMBER_STRING, ""));
if(version[0] == 0) {
if (version[0] == 0) {
// not initialized yet..
return true; // let's assume that it is nextcloud..
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ public void onConfigurationChanged(@NonNull Configuration newConfig) {
void showChangelogIfNecessary() {
// on first app start with new version - always show the changelog
int currentVersionCode = BuildConfig.VERSION_CODE;
int previousVersionCode = mPrefs.getInt("PREVIOUS_VERSION_CODE", 0);
int previousVersionCode = mPrefs.getInt(Constants.PREVIOUS_VERSION_CODE, 0);
if (currentVersionCode > previousVersionCode) {
DialogFragment dialog = new VersionInfoDialogFragment();
dialog.show(getSupportFragmentManager(), "VersionChangelogDialogFragment");
mPrefs.edit().putInt("PREVIOUS_VERSION_CODE", currentVersionCode).apply();
mPrefs.edit().putInt(Constants.PREVIOUS_VERSION_CODE, currentVersionCode).apply();
}
}

Expand Down

0 comments on commit ba5896d

Please sign in to comment.