From a71a0a7bd8f46d891a88c5fab219adea23f6f633 Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Tue, 19 Aug 2014 21:24:22 +0200 Subject: [PATCH] Setting build & version number --- build.gradle | 4 ++-- res/layout/settings.xml | 1 - res/values/strings.xml | 1 - src/fr/gaulupeau/apps/Poche/Settings.java | 8 ++++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index fcea494..6c9c613 100644 --- a/build.gradle +++ b/build.gradle @@ -19,8 +19,8 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 20 - versionCode 1 - versionName "1.0" + versionCode 9 + versionName "1.6" } sourceSets { diff --git a/res/layout/settings.xml b/res/layout/settings.xml index 0b3e3b8..4cdeb2f 100644 --- a/res/layout/settings.xml +++ b/res/layout/settings.xml @@ -102,7 +102,6 @@ android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="10dp" - android:text="@string/version" android:textSize="12sp" /> API global token : Your User ID: Your Token: - 1.5.3.2 diff --git a/src/fr/gaulupeau/apps/Poche/Settings.java b/src/fr/gaulupeau/apps/Poche/Settings.java index ce2006b..35f6f9b 100644 --- a/src/fr/gaulupeau/apps/Poche/Settings.java +++ b/src/fr/gaulupeau/apps/Poche/Settings.java @@ -9,6 +9,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; +import android.widget.TextView; public class Settings extends Activity { Button btnDone; @@ -16,6 +17,7 @@ public class Settings extends Activity { EditText editAPIUsername; EditText editAPIToken; EditText editGlobalToken; + TextView textViewVersion; @Override protected void onCreate(Bundle savedInstanceState) { @@ -43,5 +45,11 @@ public class Settings extends Activity { finish(); } }); + try { + textViewVersion = (TextView) findViewById(R.id.version); + textViewVersion.setText(getApplicationContext().getPackageManager().getPackageInfo(getApplicationContext().getPackageName(), 0).versionName); + } catch (Exception e) { + // + } } }