Overwrite only changed style properties for Android fragmentation -
i define followiung style in values/styles.xml of application:
<style name="light_textview_style"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_margintop">@dimen/_1_bu</item> <item name="android:textcolor">@color/login_text</item> <item name="android:textsize">@dimen/text_1_and_quarter_bu</item> </style> and in values-xlarge/styles.xml modify following way:
<style name="light_textview_style"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_margintop">@dimen/_1_bu</item> <item name="android:textcolor">@color/login_text</item> <item name="android:textsize">@dimen/text_1_and_quarter_bu</item> </style> basically changing 1 property - layout_width becomes wrap content large displays.
i have many such cases of styles. means duplicate huge number of properties between styles because of fragmenting few properties.
is there cleverer way reuse declaration values/styles.xml , specify explicitly changed properties?
you can have parent style , derive 2 different styles it.
look @ link about: themes
Comments
Post a Comment