polyak01 / IconSwitch

🍭 Custom Android Switch widget
901 stars 119 forks source link

Ugly corners at API below 21 #1

Open automatiq opened 7 years ago

automatiq commented 7 years ago

At api below 21 widget seems to be working fine, but has an issue with rounded corners. Tested with api 19 at emulator and a real device.

Image

Dwite commented 7 years ago

@polyak01 @a13xsus any possible fixes?

wo5553435 commented 7 years ago

I don't know the different between the two version's API of Canvas.drawRoundRect() ,but i found when you drew IconSwitchBg ,the radiusY and radiusX were too big , I just changed them like this: radiusX=radiusY = bounds.height()*0.5f; It become better now

polyak01 commented 7 years ago

@wo5553435 Thanks!) I will try your way next week.

davidrock commented 6 years ago

Same problem here, I am using API 26. There is a workaround for this issue ?