android - Styles and themes on values, values-v11 and values-v14 folders -


i working on app base design on holo theme. globally want working little confused way working folders values, values-v11 , values-v14.

so know that:

  • values targeting api inferior 11
  • values-v11 targeting api between 11 , 13
  • values-v14 targeting api superior 13

at first thought had specify every folder styles needed app realized kind of inheritance system in place.

my problem confused , don't understand how working inheritance between these 3 folders.

i did following test in order see behavior on phone (running on android 4.0, folder values-v14 should 1 loaded):

in values have style set in blue text color:

<style name="textmedium" parent="@android:style/textappearance.medium">     <item name="android:textcolor">@color/blue</item> 

in values-v11 have style set in white text color:

<style name="textmedium" parent="@android:style/textappearance.medium">     <item name="android:textcolor">@color/white</item> 

in values-v14 have style set in red text color:

<style name="textmedium" parent="@android:style/textappearance.medium">     <item name="android:textcolor">@color/red</item> 

for first case above (every folder different color), color loaded on text red, meaning values-v14 folder gets priority.

then if comment out red style values-v14 folder, text becomes white. mean system take style in values-v11 folder if device targeting values-v14 folder? thought maybe use values folder default not values-v11.

more generally, question is, these 3 folders working parent , child? meaning that:

  • if device running on api version > 13, system load values-v14 values-v11 , values.
  • if device running on api between 11 , 13, system load values-v11 , values.
  • if device running on api version < 11, system load values.

if indeed way working, make sense setup maximum of styles in parent folder values , add specific ones in v11 or v14?

sorry long question, hope clear, themes/styles system described briefly in android guide , difficult find information on how works...

thanks help!

more generally, question is, these 3 folders working parent , child?

those folders work "most specific" matching system meaning match closest(lower) api level values folder:

  • values-v14 targets apis >= 14(it not selected @ versions below 14)
  • values-v11 targets apis between(and including) 11 , 13 if values-v14 present otherwise match every version starting 11 , above((it not selected @ versions below 11))
  • values default folder , last matched, covering other apis levels not covered values-xx folder. should always(as resources folders) have folder in app

if indeed way working, make sense setup maximum of styles in parent folder values , add specific ones in v11 or v14?

yes, how android project template built(when use create new project...), tells use values-xx folders customization(different look, use of newer styles, attributes):

 <!-- in styles.xml v-14 values folder: -->  <!-- api 14 theme customizations can go here. --> 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -