From: Damyan Ivanov Date: Tue, 27 Nov 2018 20:57:49 +0000 (+0000) Subject: dynamicly set the version in the drawer head X-Git-Tag: v0.3~395 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;ds=inline;h=33c7adcf50991dfa6796dd042d26d46839aaee43;p=mobile-ledger.git dynamicly set the version in the drawer head --- diff --git a/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java b/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java index fdbbfaef..f8c70604 100644 --- a/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java +++ b/app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java @@ -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 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 69b22338..ccd75645 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,6 +1,6 @@ - #008577 - #00574B - #D81B60 + #9c27b0 + #4a148c + #00c853