Issue
So, I'm making an app that has many different res folders for values, drawables and layouts. The variation is by screen size, mobile country code (I'm using this field to override it and thus enable different skins in my app, much like iOS targets), landscape / portrait, screen widths, languages & dpi.
One of my biggest problems for this app is the fact that I need to support both tablets & phones. I create a layout for phones under layout-normal. If I do this, it seems like I must copy-paste my tablet layout into both the layout-large & layout-xlarge folders. If I don't, the app defaults to the normal layout.
I was wondering if there was a way in Android to override the way the runtime determines which folder it goes to. This way, I could via code, direct the run-time to the correct folder depending on the device's configuration, and not need to copy-paste my layouts all over the place.
Note:
I specified 1 reason I want to do this, but there are also several others. I'm looking for a way to override the way android determines which res folder it goes to, not a different solution to the 1 problem I specified above.
Any advice would be greatly appreciated!
Solution
In order to avoid the duplication you could use the resource alias mechanism as described here. That system can be used for images, layouts and other resources from the values folder.
Answered By - user
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.