From b40bd8f453baa9b442ae0099861ddc91c20c64ca Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 23 Apr 2018 15:38:58 +0200 Subject: [PATCH] Add version --- app/build.gradle | 2 +- .../com/nauk/coinfolio/Activities/SettingsActivity.java | 6 ++++++ app/src/main/res/xml/pref_general.xml | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 15ddffa..e123a13 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { minSdkVersion 23 targetSdkVersion 27 versionCode 1 - versionName "1.0" + versionName "0.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java index 7f69200..aba4e84 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/SettingsActivity.java @@ -6,6 +6,7 @@ import android.app.KeyguardManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.hardware.fingerprint.FingerprintManager; @@ -19,8 +20,10 @@ import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; +import android.preference.PreferenceScreen; import android.preference.RingtonePreference; import android.preference.SwitchPreference; +import android.provider.Settings; import android.security.keystore.KeyGenParameterSpec; import android.security.keystore.KeyPermanentlyInvalidatedException; import android.security.keystore.KeyProperties; @@ -31,6 +34,7 @@ import android.util.Log; import android.view.MenuItem; import android.view.View; +import com.nauk.coinfolio.BuildConfig; import com.nauk.coinfolio.DataManagers.PreferencesManager; import com.nauk.coinfolio.FingerprintToolkit.FingerprintDialogFragment; import com.nauk.coinfolio.FingerprintToolkit.FingerprintHandler; @@ -232,6 +236,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity { } }); + ((PreferenceScreen) findPreference("version")).setSummary(BuildConfig.VERSION_NAME); + bindPreferenceSummaryToValue(findPreference("default_currency")); } diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index f4f0328..3423141 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -14,6 +14,8 @@ android:positiveButtonText="@null" android:title="@string/pref_title_default_currency" /> +