Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding duplicate resources in android project

I have some images in my drawable folder and they have landscape versions in drawable-land. However I want some of the landscape images to be shared, as it seems a waste to duplicate the file with a different name. Is it possible to make a sym link (shortcut) or something for one of the duplicated files to prevent wasting space

Folder explanation below as I'm not great at explaining myself:

/drawable 
> image1.png
> image2.png 
/drawable-land
>image1.png  <-- This image
>image2.png  <-- is identical to this file
like image 597
stealthcopter Avatar asked Aug 25 '10 18:08

stealthcopter


1 Answers

Insead of image2.png you can definde image2.xml with following contents (obviously, place it at landscape folder):

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/image1" />
like image 50
Konstantin Burov Avatar answered Sep 21 '22 03:09

Konstantin Burov