Requirements for using AppCompat for Material UI
masterTo use Material UI elements with dynamic color tinting on devices running Android 2.1+, you must satisfy three requirements for the AppCompat Support Library to function correctly:
- Activity Type: Every
Activityused must extendAppCompatActivityor implementAppCompatDelegate. - Theme/Style Inheritance: All applied themes and styles must extend from AppCompat versions.
- Attribute Configuration: You must set the custom theme attributes specifically designed for AppCompat themes and styles.
When these conditions are met, AppCompatActivity intercepts layouts during inflation and wraps supported Views with their AppCompat counterparts. These views then read the custom AppCompat theme attributes to dynamically colorize themselves, ensuring backwards compatibility.