Code example for LayerDrawable

Methods: getDrawable, setLayerInset

0
 
        int l = level * shiftSize;
        int r = 0;
        int t = 0;
        int b = 0;
        pieceDrawable.setLayerInset(level, l, t, r, b);
        ((BitmapDrawable) pieceDrawable.getDrawable(level)).setGravity(Gravity.LEFT | Gravity.TOP);
    } 
 
 
    private class MovesAdapter extends BaseAdapter {
 
        private List<String> itemList;
 
        public MovesAdapter(List<String> itemList) {
            this.itemList = itemList;
        } 
 
        @Override 
        public int getCount() { 
            return itemList.size();  //To change body of implemented methods use File | Settings | File Templates.