Example usage for android.graphics.drawable NinePatchDrawable NinePatchDrawable

List of usage examples for android.graphics.drawable NinePatchDrawable NinePatchDrawable

Introduction

In this page you can find the example usage for android.graphics.drawable NinePatchDrawable NinePatchDrawable.

Prototype

public NinePatchDrawable(Resources res, Bitmap bitmap, byte[] chunk, Rect padding, String srcName) 

Source Link

Document

Create drawable from raw nine-patch data, setting initial target density based on the display metrics of the resources.

Usage

From source file:com.example.image.ImageWorker.java

protected Drawable getLoadingDrawable() {
    byte[] chunk = mLoadingBitmap.getNinePatchChunk();
    if (NinePatch.isNinePatchChunk(chunk)) {
        return new NinePatchDrawable(mResources, mLoadingBitmap, chunk, new Rect(), null);
    } else {/*ww  w.  j a  v  a2  s.c  o m*/
        return new BitmapDrawable(mResources, mLoadingBitmap);
    }
}