List of usage examples for android.graphics.drawable NinePatchDrawable NinePatchDrawable
private NinePatchDrawable(@NonNull NinePatchState state, @Nullable Resources res)
From source file:Main.java
/** return NinePatchDrawable with give id * @param aContext//from w w w. j av a 2 s . c om * @param aNinePatchResourceId * @return */ public static NinePatchDrawable getNinePatchDrawable(Context aContext, int aNinePatchResourceId) { Bitmap bg = BitmapFactory.decodeResource(aContext.getResources(), aNinePatchResourceId); NinePatch np = new NinePatch(bg, bg.getNinePatchChunk(), null); NinePatchDrawable t9Patch = new NinePatchDrawable(aContext.getResources(), np); return t9Patch; }