Example usage for android.graphics NinePatch isNinePatchChunk

List of usage examples for android.graphics NinePatch isNinePatchChunk

Introduction

In this page you can find the example usage for android.graphics NinePatch isNinePatchChunk.

Prototype

public native static boolean isNinePatchChunk(byte[] chunk);

Source Link

Document

Verifies that the specified byte array is a valid 9-patch data chunk.

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 {/*from   w w w .j  a va 2 s . c o  m*/
        return new BitmapDrawable(mResources, mLoadingBitmap);
    }
}