android - Can I edit a style dynamically? -


i'm developing app should totally customizable endusers. imagine application has many activities textviews, buttons, etc.

so client can create xml file one:

<style >     <h1>25dp</h1>     <h2>30dp<h2>     <actionbar>#cecece</actionbar> </style> 

as can imagine, example, there several textviews "titles" should take h1 value.

i know can parse xml file , for each textview, apply style manually, not way of achieving because if had 3000 textviews, should manually edit them all.

what want "edit" actual style programmatically.

any tip?

you can't access resource file in created apk compiled it. idea "customizable" styles works in following scenario:

  1. your app library project
  2. your client uses library project , create style extends/overwrites own style , compile new apk

you not telling if "enduser" user of app/apk or customer can above mentioned modifications.

an alternative might create own extensions of textviews, buttons etc can load style set. need create own style language , need make sure custom views understand , apply them.

a lot of work, if ask me... would, in general, suggest make different themes customer can pick best suited them...


Comments