From 25c6a9558f277dc97a8edce1f2ee9fc1c1148f2d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 29 Mar 2020 16:02:33 +0200 Subject: [PATCH] simplify code --- .../mian/gitnex/activities/MainActivity.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java index 80dac10f..b7ce42d5 100644 --- a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java @@ -299,24 +299,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig Log.e("changelogDialog", Objects.requireNonNull(e.getMessage())); } - if (!tinyDb.getBoolean("versionFlag")) { - if (versionCode > tinyDb.getInt("versionCode")) { - tinyDb.putInt("versionCode", versionCode); - tinyDb.putBoolean("versionFlag", true); - } - else { - tinyDb.putBoolean("versionFlag", false); - } - } - else { - tinyDb.putBoolean("versionFlag", false); - } - - if(tinyDb.getBoolean("versionFlag")) { + if (versionCode > tinyDb.getInt("versionCode")) { + tinyDb.putInt("versionCode", versionCode); + tinyDb.putBoolean("versionFlag", true); ChangeLog changelogDialog = new ChangeLog(this); changelogDialog.showDialog(); } - } public void setActionBarTitle (@NonNull String title) {