Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.13.18' propVersionName = '3.13.19' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/TabLayout.kt 0 → 100644 +17 −0 Original line number Diff line number Diff line package com.simplemobiletools.commons.extensions import android.support.design.widget.TabLayout fun TabLayout.onTabSelectionChanged(tabUnselectedAction: (inactiveTab: TabLayout.Tab) -> Unit, tabSelectedAction: (activeTab: TabLayout.Tab) -> Unit) = setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { override fun onTabSelected(tab: TabLayout.Tab) { tabSelectedAction(tab) } override fun onTabUnselected(tab: TabLayout.Tab) { tabUnselectedAction(tab) } override fun onTabReselected(tab: TabLayout.Tab) { } }) Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.13.18' propVersionName = '3.13.19' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/TabLayout.kt 0 → 100644 +17 −0 Original line number Diff line number Diff line package com.simplemobiletools.commons.extensions import android.support.design.widget.TabLayout fun TabLayout.onTabSelectionChanged(tabUnselectedAction: (inactiveTab: TabLayout.Tab) -> Unit, tabSelectedAction: (activeTab: TabLayout.Tab) -> Unit) = setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { override fun onTabSelected(tab: TabLayout.Tab) { tabSelectedAction(tab) } override fun onTabUnselected(tab: TabLayout.Tab) { tabUnselectedAction(tab) } override fun onTabReselected(tab: TabLayout.Tab) { } })