mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Update MainActivity.kt
This commit is contained in:
@ -227,6 +227,16 @@ class MainActivity : SimpleActivity() {
|
|||||||
getTabAt(it)?.icon?.applyColorFilter(config.textColor)
|
getTabAt(it)?.icon?.applyColorFilter(config.textColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main_tabs_holder.onTabSelectionChanged(
|
||||||
|
tabUnselectedAction = {
|
||||||
|
it.icon?.applyColorFilter(config.textColor)
|
||||||
|
},
|
||||||
|
tabSelectedAction = {
|
||||||
|
viewpager.currentItem = it.position
|
||||||
|
it.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getInactiveTabIndexes(activeIndex: Int) = (0 until tabsList.size).filter { it != activeIndex }
|
private fun getInactiveTabIndexes(activeIndex: Int) = (0 until tabsList.size).filter { it != activeIndex }
|
||||||
@ -249,16 +259,6 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
main_tabs_holder.onTabSelectionChanged(
|
|
||||||
tabUnselectedAction = {
|
|
||||||
it.icon?.applyColorFilter(config.textColor)
|
|
||||||
},
|
|
||||||
tabSelectedAction = {
|
|
||||||
viewpager.currentItem = it.position
|
|
||||||
it.icon?.applyColorFilter(getAdjustedPrimaryColor())
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// selecting the proper tab sometimes glitches, add an extra selector to make sure we have it right
|
// selecting the proper tab sometimes glitches, add an extra selector to make sure we have it right
|
||||||
main_tabs_holder.onGlobalLayout {
|
main_tabs_holder.onGlobalLayout {
|
||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
@ -346,9 +346,9 @@ class MainActivity : SimpleActivity() {
|
|||||||
recents_fragment?.refreshItems()
|
recents_fragment?.refreshItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getAllFragments(): ArrayList<MyViewPagerFragment> {
|
private fun getAllFragments(): ArrayList<MyViewPagerFragment?> {
|
||||||
val showTabs = config.showTabs
|
val showTabs = config.showTabs
|
||||||
val fragments = arrayListOf<MyViewPagerFragment>()
|
val fragments = arrayListOf<MyViewPagerFragment?>()
|
||||||
|
|
||||||
if (showTabs and TAB_CONTACTS > 0) {
|
if (showTabs and TAB_CONTACTS > 0) {
|
||||||
fragments.add(contacts_fragment)
|
fragments.add(contacts_fragment)
|
||||||
|
Reference in New Issue
Block a user