Improved revision handling

pull/206/head
M66B 3 years ago
parent 2ef084d9ee
commit 9d7a82e612

@ -2,7 +2,7 @@
### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia) ### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia)
### 1.1726-b ### 1.1726b
* Following dark/light theme for original message view * Following dark/light theme for original message view
* Added message menu item / optional button to force light theme for original message view * Added message menu item / optional button to force light theme for original message view

@ -4,6 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'de.undercouch.download' apply plugin: 'de.undercouch.download'
def getVersionCode = { -> return 1726 } def getVersionCode = { -> return 1726 }
def getRevision = { -> "\"b\"" }
def getReleaseName = { -> return "\"Yaverlandia\"" } def getReleaseName = { -> return "\"Yaverlandia\"" }
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera // https://en.wikipedia.org/wiki/List_of_dinosaur_genera
@ -133,7 +134,7 @@ android {
productFlavors { productFlavors {
github { github {
dimension "all" dimension "all"
buildConfigField "String", "REVISION", "\"b\"" buildConfigField "String", "REVISION", getRevision()
buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "boolean", "AMAZON_RELEASE", "false" buildConfigField "boolean", "AMAZON_RELEASE", "false"
@ -144,7 +145,7 @@ android {
} }
fdroid { fdroid {
dimension "all" dimension "all"
buildConfigField "String", "REVISION", "\"a\"" buildConfigField "String", "REVISION", getRevision()
buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false" buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "boolean", "AMAZON_RELEASE", "false" buildConfigField "boolean", "AMAZON_RELEASE", "false"
@ -156,7 +157,7 @@ android {
play { play {
dimension "all" dimension "all"
//minSdkVersion 23 //minSdkVersion 23
buildConfigField "String", "REVISION", "\"a\"" buildConfigField "String", "REVISION", getRevision()
buildConfigField "boolean", "BETA_RELEASE", "true" buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "true" buildConfigField "boolean", "PLAY_STORE_RELEASE", "true"
buildConfigField "boolean", "AMAZON_RELEASE", "false" buildConfigField "boolean", "AMAZON_RELEASE", "false"

@ -2,7 +2,7 @@
### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia) ### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia)
### 1.1726-b ### 1.1726b
* Following dark/light theme for original message view * Following dark/light theme for original message view
* Added message menu item / optional button to force light theme for original message view * Added message menu item / optional button to force light theme for original message view

@ -1103,14 +1103,14 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
} }
private void checkFirst() { private void checkFirst() {
String current = BuildConfig.VERSION_NAME + "-" + BuildConfig.REVISION; String version = BuildConfig.VERSION_NAME + BuildConfig.REVISION;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean("first", true)) if (prefs.getBoolean("first", true))
new FragmentDialogFirst().show(getSupportFragmentManager(), "first"); new FragmentDialogFirst().show(getSupportFragmentManager(), "first");
else if (!BuildConfig.PLAY_STORE_RELEASE) { else if (!BuildConfig.PLAY_STORE_RELEASE) {
String last = prefs.getString("changelog", null); String last = prefs.getString("changelog", null);
if (!Objects.equals(current, last)) { if (!Objects.equals(version, last)) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("name", "CHANGELOG.md"); args.putString("name", "CHANGELOG.md");
FragmentDialogMarkdown fragment = new FragmentDialogMarkdown(); 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() { private void checkBanner() {

@ -61,7 +61,8 @@ public class FragmentAbout extends FragmentBase {
TextView tvGplV3 = view.findViewById(R.id.tvGplV3); TextView tvGplV3 = view.findViewById(R.id.tvGplV3);
LinearLayout llContributors = view.findViewById(R.id.llContributors); 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); tvRelease.setText(BuildConfig.RELEASE_NAME);
long last = 0; long last = 0;

Loading…
Cancel
Save