Android: specifying the same theme in styles.xml and styles-21.xml

When we want to enable material design with backward compatibility in our application, we use the library appcompat.

I tried to do this by including this in styles.xml

<style name="AppTheme" parent="Theme.AppCompat.Light">

But when I do this, I don’t see any worries when touching widgets (even on Android Android phones).

Why is this?

And when I put the same line above in styles.xmland styles-21.xml, I see ripples in the phones Android L. If the support library does not include ripples, how can I see ripples when I have a separate file styles-v21?

Note: I encountered this problem when I was trying to transfer the application to a material project.

I want the application to use full capabilities Support Library for Material designwhen working on devices running Android L, and I want the application to use full power Material designwhen running on Android L and higher. I am not sure how I should continue the migration.

+4
source share
1 answer

An API 21+ device will first consider styles-v21 and then into styles as a fallback.

0
source

All Articles