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
tree: b7e8f0f03e44a65e60a7d614839e32a6da925c87
  1. AUTHORS
  2. CONTRIBUTING.md
  3. CONTRIBUTORS
  4. LICENSE
  5. README.md
  6. WORKSPACE
  7. src/
  8. third_party/
README.md

Feed Libraries

This directory includes various libraries and protocols which users can use to to embed the proactive content recommendations into their application. Supported surfaces currently include Android.

Contributing

See CONTRIBUTING.md.