AnimatedTabLayout
AnimatedTabLayout copied to clipboard
Android P Bug with squared tabs
Just updated to official release version of Android P, the tabs are all squared.
I have the same issue, is possible to fix that?
I've fixed the issue by applying to AnimatedTabItemView
an ViewOutlineProvider
as described here: https://github.com/android/user-interface-samples/tree/master/ClippingBasic
This is the inner class I've made in AnimatedTabItemView
:
private inner class ClipOutlineProvider : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, mWidth.toInt(),
mHeight.toInt(), radius)
}
}
And set it in init(...)
function:
outlineProvider = ClipOutlineProvider()
clipToOutline = true
This is however a common issue with Android P: https://issuetracker.google.com/issues/111819103#comment5
The issue has be solved in #13. Use this instead,
implementation 'com.github.iammert:AnimatedTabLayout:-SNAPSHOT'