In My case, what is difference in here:
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
and
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Material Theme is a user interface style that determines the look and feel of views and activities starting with Android 5.0 (Lollipop). Material Theme is built into Android 5.0, so it is used by the system UI as well as by applications.
A Material Theme contains color, typography and shape attributes. When you customize these attributes, your changes are automatically reflected in the components you use to build your app. Configure the parameters you pass to MaterialTheme to theme your application.
colorPrimary and colorSecondary represent the colors of your brand. colorPrimaryVariant and colorSecondaryVariant are lighter or darker shades of your brand colors. colorSurface is used for “sheets” of material (like cards and bottom sheets) android:colorBackground is the window background color of your app.
One of the concepts that was new to me was theme overlays. It's a powerful technique that allows us to override only the attributes that are specified in the overlay itself. The typical way to apply a theme overlay is using the android:theme attribute on our view.
This is the raw material design theme, which is used by Android 5 and upNot sure how this works wrt. new Android libraries for app design:
<style name="AppTheme" parent="android:Theme.*">
This is a way to use material design on pre-lollipop devices, which maintains compatibility.
<style name="AppTheme" parent="Theme.AppCompat.*">
You can design for newer APIs using AppCompat and still have it work on earlier API levels than what the base level for material design is.
In this case, it essentially means that you can run material design on platforms that predate material design. This isn't as important anymore now that versions that early make up at most ~2.5% of the market share at the time of writing.
Note, however, that using AppCompat does give you additional compatibility helpers beyond just being able to use the material theme on older devices. Also note that AppCompat has since been deprecated in favor of whatever system is currently mainstream and that Google hasn't axed yet (Jetpack?), which may or may not work differently.
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
Theme.AppCompat is for above API 7+
Theme.Material is for above API 21+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With