- 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.
This commit is contained in:
Severiano Jaramillo 2018-12-14 10:23:01 -06:00
parent 20e17108ec
commit f76f293811
4 changed files with 11 additions and 3 deletions

View file

@ -65,6 +65,8 @@ class HomeFragment : Fragment() {
val pagerAdapter = PagerAdapter(fragmentManager!!) val pagerAdapter = PagerAdapter(fragmentManager!!)
viewPager.adapter = pagerAdapter viewPager.adapter = pagerAdapter
tabLayout.setupWithViewPager(viewPager) 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? { 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 { override fun getCount(): Int {
return 2 return 3
} }
} }

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11,2v20c-5.07,-0.5 -9,-4.79 -9,-10s3.93,-9.5 9,-10zM13.03,2v8.99L22,10.99c-0.47,-4.74 -4.24,-8.52 -8.97,-8.99zM13.03,13.01L13.03,22c4.74,-0.47 8.5,-4.25 8.97,-8.99h-8.97z"/>
</vector>

View file

@ -144,7 +144,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="?android:colorControlHighlight" android:background="@color/semiTransparent"
app:tabSelectedTextColor="?android:textColorPrimary" app:tabSelectedTextColor="?android:textColorPrimary"
app:tabIndicatorColor="?attr/themedColorBackgroundFloating" app:tabIndicatorColor="?attr/themedColorBackgroundFloating"
app:tabIndicatorHeight="50dp" app:tabIndicatorHeight="50dp"

View file

@ -13,4 +13,5 @@
<color name="darkGray">#616161</color> <color name="darkGray">#616161</color>
<color name="colorReceive">#669900</color> <color name="colorReceive">#669900</color>
<color name="colorSend">#DC473A</color> <color name="colorSend">#DC473A</color>
<color name="semiTransparent">#2888</color>
</resources> </resources>