I could probably do some of the stuff through themes, like setting the windowBackground, but if for example my layout has an imageView and I want to have the image change depending on subject I can't see any way to do this through themes.
The ideal solution would be if you could specify custom qualifiers on resource folders, so I could have folders like drawable-subject1, drawable-subject2 and then specify in my activity which folder to use. This would allow for just one set of layout files and an infinite amount of subjects to be added without any code changes. On Jun 27, 10:10 am, Kumar Bibek <[email protected]> wrote: > Well, as far as I can think of, you should be able to do it through themes. > What problems did you face while using themes? > > *Thanks and Regards, > Kumar Bibek* > *http://techdroid.kbeanie.comhttp://www.kbeanie.com* > > > > > > > > On Mon, Jun 27, 2011 at 2:35 PM, muckwarrior <[email protected]> wrote: > > Woops, sorry for the duplicate post, I couldn't find my original one > > for some reason. > > > Yeah I figured I could do it through Java code alright, but I'd prefer > > not to. In reality I have a lot more resources than just a button and > > a BG and setting all these in code and maintaining the list would be > > far from ideal. I just wanted to check there wasn't an easier option > > before I went ahead and implemented it. > > > On Jun 27, 9:56 am, muckwarrior <[email protected]> wrote: > > > I'm building an app, similar to a quiz app, which repeats > > > functionality for different subjects. The layouts will be the same for > > > each subject except that the resources used will different, e.g. > > > Subject 1 will use ButtonImage 1 and Background colour 1, Subject 2 > > > uses ButtonImage 2 etc. etc. > > > > What I'm trying to avoid is duplicating the xml layouts. I initially > > > assumed that I could use themes to avoid hardcoding the resourceIDs > > > into the layout, but on further investigation that doesn't seem > > > possible. Another approach I thought may have been possible was to use > > > alternative resources folders and have a folder for each subject, but > > > it doesn't seem possible to use custom qualifiers. > > > > Can anyone tell me is it possible to specify multiple resources > > > without creating multiple xml layouts? > > > -- > > 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 -- 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

