]> git.ktnx.net Git - mobile-ledger.git/commitdiff
dynamicly set the version in the drawer head
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 27 Nov 2018 20:57:49 +0000 (20:57 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 27 Nov 2018 20:57:49 +0000 (20:57 +0000)
app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java
app/src/main/res/values/colors.xml

index fdbbfaefa22f0bb2d61f922766a58b3d74dacdbe..f8c70604c99b5c2f6c1dfce45b9aeca672fcba6f 100644 (file)
@@ -1,5 +1,6 @@
 package net.ktnx.mobileledger;
 
+import android.content.pm.PackageInfo;
 import android.os.Bundle;
 import android.support.design.widget.FloatingActionButton;
 import android.support.design.widget.NavigationView;
@@ -40,6 +41,15 @@ public class LatestTransactions extends AppCompatActivity
 
         NavigationView navigationView = findViewById(R.id.nav_view);
         navigationView.setNavigationItemSelectedListener(this);
+
+        android.widget.TextView ver = drawer.findViewById(R.id.drawer_version_text);
+
+        try {
+            PackageInfo pi = getApplicationContext().getPackageManager().getPackageInfo(getPackageName(), 0);
+            ver.setText(pi.versionName);
+        } catch (Exception e) {
+            ver.setText("version");
+        }
     }
 
     @Override
index 69b22338c6510250df3b43672635120dbce2fa49..ccd75645898fc0ad1c3c78009d9f0ffd2df8a177 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <color name="colorPrimary">#008577</color>
-    <color name="colorPrimaryDark">#00574B</color>
-    <color name="colorAccent">#D81B60</color>
+    <color name="colorPrimary">#9c27b0</color>
+    <color name="colorPrimaryDark">#4a148c</color>
+    <color name="colorAccent">#00c853</color>
 </resources>