Waseem
Waseem

Reputation: 577

How to choose different colors for different Android APIs for a specific property?

Say I have this colorPrimaryDark set for API > 23:

<color name="colorPrimaryDark" tools:targetApi="23">#FFFFFF</color>

How can I set it to black for older APIs?

Upvotes: 0

Views: 66

Answers (1)

Massita
Massita

Reputation: 309

You can probably set a color without the tools:targetApi that will be used for any other android api. I think that its a better approach to create a colors.xml inside a folder dedicated to the API you want, like if you want your color to be used in every api 16 target, you can create a folder named values-v16 inside your res folder and create a new colors.xml inside it.

Upvotes: 2

Related Questions