Android Studio - Layout Theme Selection -- Where is this data stored? -


i quite familiar android layouts , fact can declare app wide theme in manifest or indirectly via styles resource such "halo", or "material", etc... .

i know style can done on per layout basis. android studio "layout editor" allows select theme layout.

question:

where selected theme stored when applied per layout?


the android documentation seems suggest in manifest activities declared. example:

<activity android:name=".mainmenu"  `android:theme="@android:style/theme.holo.noactionbar"/>` 

however, when select different theme, after compile , run application see no changes in manifest, or respective layout, or activity sub class.

so association between layout , chosen theme being stored?

tl;dr

androidmanifest.xml references styles.xml in turns references colors.xml. layout editor modifies styles.xml, you're not seeing results because of possible overrides in styles.xml.

-- modify parent style in styles.xml , removes unwanted overrides within. --


after investigating issue coming across problem, here conclusion came to:

starting new "empty activity" see following in androidmanifest.xml file: android:theme="@style/apptheme". not directly related changes in layout editor in "design view" of current activity.

androidmanifest.xml

hovering on theme definition below:

enter image description here

styles.xml

clicking on take styles.xml. default, see following:

enter image description here

this apptheme coming being referenced in androidmanifest.xml. see, theme.appcompat.light.darkactionbar parent style, , if want change overall theme need modify that, e.g. "@android:style/theme.material" or "@android:style/theme.holo".

it worth noting long override colors still there, not notice changes when app launched, though changes did go through.

to see changes commend following lines:

    <item name="colorprimary">@color/colorprimary</item>     <item name="colorprimarydark">@color/colorprimarydark</item>     <item name="coloraccent">@color/coloraccent</item> 

by deleting or commenting:

<!--        <item name="colorprimary">@color/colorprimary</item>         <item name="colorprimarydark">@color/colorprimarydark</item>         <item name="coloraccent">@color/coloraccent</item>--> 

theme layout editor

for reason android studio 2.2 got rid of refresh button on layout causing many difficulties in update of style.

for time being, manually override parent style in styles.xml , remove overrides being imported colors.xml. not ideal, it's solution.

for full list of themes can check developer r.style link or clicking on open editor visual representation of different themes.

enter image description here

which displays following:

enter image description here


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -