Skip to content

Instantly share code, notes, and snippets.

@labibmuhajir
Created April 21, 2020 10:18
Show Gist options
  • Save labibmuhajir/3f22d5ce48307f754f5c972a1e2f28b9 to your computer and use it in GitHub Desktop.
Save labibmuhajir/3f22d5ce48307f754f5c972a1e2f28b9 to your computer and use it in GitHub Desktop.
android tab divider
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