Refactor rounded corner logic in order to check for hardware acceleration
The outline provider only works with hardware acceleration, meaning that devices that don't support hw acceleration get no rounded corners when that strategy is used to round corners.
Unfortunately, a view doesn't know if it's hardware accelerated until it's a attached to a window, so when these views are created in StyleProvider, it's too early--it has to happen after the view is created, meaning all strategies need to be able to be used from one Android View class.
Most of the logic was the same between different strategies. All of the strategy-specific logic is in delegates now. The delegates are not Android Views (they can't be), but they can manipulate the view so that RoundedCornerWrapperView doesn't need to know the details of the different rounding strategies.
It doesn't make sense anymore to to keep the RoundedCornerWrapperView inheritance, since there would only be one class inheriting from the base class. I pulled some things into delegates, and some shared code into RoundedCornerViewHelper.
PiperOrigin-RevId: 253104022
Change-Id: I19e23fe6bb4778653ff343acac7112a67edfaaf4
21 files changed