From 9d7a82e612fe06b56e3ac7702ce7227cf3fc8b6a Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 18 Sep 2021 11:49:01 +0200 Subject: [PATCH] Improved revision handling --- CHANGELOG.md | 2 +- app/build.gradle | 7 ++++--- app/src/main/assets/CHANGELOG.md | 2 +- app/src/main/java/eu/faircode/email/ActivityView.java | 6 +++--- app/src/main/java/eu/faircode/email/FragmentAbout.java | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5828cd3ba1..54e7e2186d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia) -### 1.1726-b +### 1.1726b * Following dark/light theme for original message view * Added message menu item / optional button to force light theme for original message view diff --git a/app/build.gradle b/app/build.gradle index 2386c3f451..1c8fbfaf74 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,6 +4,7 @@ apply plugin: 'kotlin-android' apply plugin: 'de.undercouch.download' def getVersionCode = { -> return 1726 } +def getRevision = { -> "\"b\"" } def getReleaseName = { -> return "\"Yaverlandia\"" } // https://en.wikipedia.org/wiki/List_of_dinosaur_genera @@ -133,7 +134,7 @@ android { productFlavors { github { dimension "all" - buildConfigField "String", "REVISION", "\"b\"" + buildConfigField "String", "REVISION", getRevision() buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "AMAZON_RELEASE", "false" @@ -144,7 +145,7 @@ android { } fdroid { dimension "all" - buildConfigField "String", "REVISION", "\"a\"" + buildConfigField "String", "REVISION", getRevision() buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "AMAZON_RELEASE", "false" @@ -156,7 +157,7 @@ android { play { dimension "all" //minSdkVersion 23 - buildConfigField "String", "REVISION", "\"a\"" + buildConfigField "String", "REVISION", getRevision() buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "PLAY_STORE_RELEASE", "true" buildConfigField "boolean", "AMAZON_RELEASE", "false" diff --git a/app/src/main/assets/CHANGELOG.md b/app/src/main/assets/CHANGELOG.md index 5828cd3ba1..54e7e2186d 100644 --- a/app/src/main/assets/CHANGELOG.md +++ b/app/src/main/assets/CHANGELOG.md @@ -2,7 +2,7 @@ ### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia) -### 1.1726-b +### 1.1726b * Following dark/light theme for original message view * Added message menu item / optional button to force light theme for original message view diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 24baa40496..00c3129b8e 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -1103,14 +1103,14 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } private void checkFirst() { - String current = BuildConfig.VERSION_NAME + "-" + BuildConfig.REVISION; + String version = BuildConfig.VERSION_NAME + BuildConfig.REVISION; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); if (prefs.getBoolean("first", true)) new FragmentDialogFirst().show(getSupportFragmentManager(), "first"); else if (!BuildConfig.PLAY_STORE_RELEASE) { String last = prefs.getString("changelog", null); - if (!Objects.equals(current, last)) { + if (!Objects.equals(version, last)) { Bundle args = new Bundle(); args.putString("name", "CHANGELOG.md"); FragmentDialogMarkdown fragment = new FragmentDialogMarkdown(); @@ -1119,7 +1119,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } } - prefs.edit().putString("changelog", current).apply(); + prefs.edit().putString("changelog", version).apply(); } private void checkBanner() { diff --git a/app/src/main/java/eu/faircode/email/FragmentAbout.java b/app/src/main/java/eu/faircode/email/FragmentAbout.java index 8e60530e04..8f4b2778ad 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAbout.java +++ b/app/src/main/java/eu/faircode/email/FragmentAbout.java @@ -61,7 +61,8 @@ public class FragmentAbout extends FragmentBase { TextView tvGplV3 = view.findViewById(R.id.tvGplV3); LinearLayout llContributors = view.findViewById(R.id.llContributors); - tvVersion.setText(getString(R.string.title_version, BuildConfig.VERSION_NAME)); + String version = BuildConfig.VERSION_NAME + BuildConfig.REVISION; + tvVersion.setText(getString(R.string.title_version, version)); tvRelease.setText(BuildConfig.RELEASE_NAME); long last = 0;