Created
April 21, 2020 10:18
-
-
Save labibmuhajir/3f22d5ce48307f754f5c972a1e2f28b9 to your computer and use it in GitHub Desktop.
android tab divider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with(tabCatalog) { | |
setupWithViewPager(vpCatalog) | |
val linearLayout = getChildAt(0) as LinearLayout | |
linearLayout.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE | |
val drawable = GradientDrawable() | |
drawable.setColor(ResourcesCompat.getColor(resources, R.color.black16, null)) | |
drawable.setSize(1, 1) | |
linearLayout.dividerPadding = 40 | |
linearLayout.dividerDrawable = drawable | |
requestLayout() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment