Add version

This commit is contained in:
Tanguy Herbron 2018-04-23 15:38:58 +02:00
parent 5e28d86c5e
commit b40bd8f453
3 changed files with 9 additions and 1 deletions

View File

@ -7,7 +7,7 @@ android {
minSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@ -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"));
}

View File

@ -14,6 +14,8 @@
android:positiveButtonText="@null"
android:title="@string/pref_title_default_currency" />
<PreferenceScreen android:title="Version"
android:key="version"/>
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->