Code example for NinePatchDrawable

0
 
        if (chunk != null && bitmap != null) {
            int[] padding = chunk.getPadding();
            Rect paddingRect = new Rect(padding[0], padding[1], padding[2], padding[3]);
 
            return new NinePatchDrawable(context.getResources(), bitmap,
                    NinePatch_Delegate.serialize(chunk),
                    paddingRect, null);
        } 
 
        return null; 
    } 
 
    // ------- TypedValue stuff 
    // This is taken from //device/libs/utils/ResourceTypes.cpp 
 
    private static final class UnitEntry { 
        String name;
        int type;
        int unit;
Experience pair programming with AI  Get Codota for Java