Code example for BitmapDrawable

Methods: mutate, setTileModeXY

0
		fixDrawableRepeat(d.getCurrent());
	} 
 
	/** Mutate the bitmap and reset tilemode **/ 
	public static void fixBitmapRepeat(BitmapDrawable bmp) {
		bmp.mutate(); // make sure that we aren't sharing state anymore
		bmp.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
	} 
 
	/** Go through layers and dispatch them via fixDrawableRepeat **/ 
	public static void fixLayerRepeat(LayerDrawable lyr) {
		for (int i = 0; i < lyr.getNumberOfLayers(); i++) {
			fixDrawableRepeat(lyr.getDrawable(i));
		} 
	} 
 
	/** Converts a boolean for visibility into View.VISIBLE or View.GONE **/ 
	public static int boolToVis(boolean show) {
		return show ? View.VISIBLE : View.GONE;
	}