I have a small question though ......when we use all the attributes the Layout Editor becomes completely useless as then you cant even see the icons or the final look n feel of the widget/control/view in the editor. The only way to see the final output is by running the program. This sometimes hurt... rest the power of layout editor/XML is great
On Apr 20, 2:58 am, havexz <[email protected]> wrote: > Thanks a lot.. I also just figured this out.......Again thanks a lot > for such a quick response.... > > On Apr 20, 2:51 am, Jeff Sharkey <[email protected]> wrote: > > > Yep, it's possible. :) You're probably looking to do it through an > > attribute. Here's a quick example which works when you change > > android:theme on the activity. > > > == styles.xml == > > > <resources> > > <style name="ThemeDark" parent="@android:style/Theme"> > > <item name="skyState">@style/cloudy</item> > > </style> > > > <style name="ThemeLight" parent="@android:style/Theme.Light"> > > <item name="skyState">@style/sunny</item> > > </style> > > > <style name="cloudy"> > > <item name="android:background">#8444</item> > > <item name="android:textColor">#f888</item> > > </style> > > > <style name="sunny"> > > <item name="android:background">#8088</item> > > <item name="android:textColor">#f0ff</item> > > </style> > > </resources> > > > == attrs.xml == > > > <resources> > > <attr name="skyState" format="reference" /> > > </resources> > > > == layout.xml == > > > <TextView > > android:layout_width="fill_parent" > > android:layout_height="wrap_content" > > android:text="@string/hello" > > style="?attr/skyState" > > /> > > > On Mon, Apr 20, 2009 at 12:36 AM, havexz <[email protected]> wrote: > > > > Hi > > > > I have a image view and I want to show different images based on the > > > current theme. I want to do this using the XML only. Via code it can > > > be done .....but then that is not a elegant solution. > > > > On the same lines, can we add our own attributes to the theme (theme > > > that i created)? > > > -- > > Jeff Sharkey > > [email protected] > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

