From f76f2938112d79409c02e79b04d99733f86b0245 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Fri, 14 Dec 2018 10:23:01 -0600 Subject: [PATCH] - Add a third tab to the Balances/Networth Tablayout which contains only a Pie chart as the title but has no content yet. - Lighten up the above tabs that are not the current selected one. They are still grayed but just a bit. --- .../agorise/bitsybitshareswallet/fragments/HomeFragment.kt | 6 ++++-- app/src/main/res/drawable/ic_pie_chart.xml | 5 +++++ app/src/main/res/layout/fragment_home.xml | 2 +- app/src/main/res/values/colors.xml | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/drawable/ic_pie_chart.xml 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 bfb558a..460a8ea 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/HomeFragment.kt @@ -65,6 +65,8 @@ class HomeFragment : Fragment() { val pagerAdapter = PagerAdapter(fragmentManager!!) viewPager.adapter = pagerAdapter tabLayout.setupWithViewPager(viewPager) + // Set the pie chart icon for the third tab + tabLayout.getTabAt(2)?.setIcon(R.drawable.ic_pie_chart) } /** @@ -82,11 +84,11 @@ class HomeFragment : Fragment() { } override fun getPageTitle(position: Int): CharSequence? { - return getString(listOf(R.string.title_balances, R.string.title_net_worth)[position]) + return listOf(getString(R.string.title_balances), getString(R.string.title_net_worth), "")[position] } override fun getCount(): Int { - return 2 + return 3 } } diff --git a/app/src/main/res/drawable/ic_pie_chart.xml b/app/src/main/res/drawable/ic_pie_chart.xml new file mode 100644 index 0000000..3782c7c --- /dev/null +++ b/app/src/main/res/drawable/ic_pie_chart.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 8113bcc..d26ae91 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -144,7 +144,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:background="?android:colorControlHighlight" + android:background="@color/semiTransparent" app:tabSelectedTextColor="?android:textColorPrimary" app:tabIndicatorColor="?attr/themedColorBackgroundFloating" app:tabIndicatorHeight="50dp" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 05a6f26..8231667 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,4 +13,5 @@ #616161 #669900 #DC473A + #2888