diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt index be56fa5..910e685 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt @@ -60,8 +60,18 @@ class HomeFragment : Fragment() { // Configure UserAccountViewModel to show the current account mUserAccountViewModel = ViewModelProviders.of(this).get(UserAccountViewModel::class.java) - mUserAccountViewModel.getUserAccount(userId).observe(this, Observer{ user -> - tvAccountName.text = user?.name ?: "" + mUserAccountViewModel.getUserAccount(userId).observe(this, Observer{ userAccount -> + if (userAccount != null) { + tvAccountName.text = userAccount.name + if (userAccount.isLtm) { + // Add the lightning bolt to the start of the account name if it is LTM + tvAccountName.setCompoundDrawablesRelativeWithIntrinsicBounds( + resources.getDrawable(R.drawable.ic_ltm_account, null), null, null, null + ) + // Add some padding so that the lightning bolt icon is not too close to the account name text + tvAccountName.compoundDrawablePadding = 4 + } + } }) // Navigate to the Receive Transaction Fragment diff --git a/app/src/main/res/drawable/ic_ltm_account.xml b/app/src/main/res/drawable/ic_ltm_account.xml new file mode 100644 index 0000000..f633181 --- /dev/null +++ b/app/src/main/res/drawable/ic_ltm_account.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file