List of usage examples for android.graphics.drawable LayerDrawable getPadding
@Override public boolean getPadding(Rect padding)
From source file:org.kde.necessitas.ministro.ExtractStyle.java
private JSONObject getLayerDrawable(Object drawable, String filename) { JSONObject json = new JSONObject(); LayerDrawable layers = (LayerDrawable) drawable; final int nr = layers.getNumberOfLayers(); try {/* ww w . ja v a2 s .co m*/ JSONArray array = new JSONArray(); for (int i = 0; i < nr; i++) { JSONObject layerJsonObject = getDrawable(layers.getDrawable(i), filename + "__" + layers.getId(i)); layerJsonObject.put("id", layers.getId(i)); array.put(layerJsonObject); } json.put("type", "layer"); Rect padding = new Rect(); if (layers.getPadding(padding)) json.put("padding", getJsonRect(padding)); json.put("layers", array); } catch (JSONException e) { e.printStackTrace(); } return json; }