How can I alias an android bitmap to a drawable from another size (drawable-large-mdpi aliases to drawable-hdpi) -
i'm working on adding support tablet sized screens apps. have images in drawable-mdpi , drawable-hdpi different density screens. problem tablets galaxy 7" "large" screen still medium density. part of layout has 5 buttons across width of screen evenly spaced. on large screen mdpi graphics though images small tons of whitespace between them.
i use larger graphics large layout make them appropriate take advantage of screen real estate. have double sized graphics in hdpi directory work perfectly. test, i've copied of images /res/drawable-hdpi /res/drawable-large-mdpi , looked want.
however, don't want bloat size of app coping of images. create aliases each of them when /res/drawable-large-mdpi/button_0 requested, use /res/drawable-hdpi/button_0 instead.
i've tried creating xml bitmap don't know how reference drawable specific directory. help?
contents of /res/drawable-large-mdpi/button_0.xml:
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable-hdpi/button_0" />
the error above is:
error: error: no resource found matches given name (at 'src' value '@drawable-hdpi/button_0_highlighted').
this page talks different modifiers can use on resource folders. seems indicate order of precedence such screen size(small, med, large, xlarge) higher density(ldpi, mdpi, hdpi). think means if renamed drawables-hdpi folder drawables-large-hdpi though galaxy tab has medium density still use drawables folder because has large screen.
edit: tested out, solve problem 1 way. images inside drawables-large-hdpi folder show on galaxy tab when running app. unfortunately adding large qualifier makes don't show on medium sized screens hdpi densities. looking might have make separate folders , have 2 copies of large resources if want functionality =(.
Comments
Post a Comment