Android - How do I make a wallpaper that combines bitmaps?

I know how to make a wallpaper by repeating a bitmap. I also saw a way to combine two bitmaps using Canvas. But I want to make a repeating bitmap in combination with a gradient suitable for creating a background. I have a .png file, which it is partially transparent, and I want to repeat it along with the gradient (regular XML gradient).

This is PNG: http://subtlepatterns.com/?p=1203

Is there any way to do this?

Thanks in advance.

+4
source share
1 answer

You can use the XML bitmap to create the tile template:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/my_png" android:tileMode="repeat" /> 

You can then use this as part of the LayerList , which also includes your gradient. Then use the list of layers as your wallpaper.

+10
source

All Articles