Code example for LayerDrawable

Methods: setLayerInset

0
        if (icon == null) {
            array[2] = mGenericFavicon;
        } else { 
            array[2] = new BitmapDrawable(icon);
        } 
        LayerDrawable d = new LayerDrawable(array);
        d.setLayerInset(1, 1, 1, 1, 1);
        d.setLayerInset(2, 2, 2, 2, 2);
        mFavicon.setImageDrawable(d);
    } 
 
    /** 
     * Set the Drawable for the lock icon, or null to hide it. 
     */ 
    /* package */ void setLock(Drawable d) {
        if (null == d) {
            mLockIcon.setVisibility(View.GONE);
        } else { 
            mLockIcon.setImageDrawable(d);
            mLockIcon.setVisibility(View.VISIBLE);
Stop searching for code, let great code find you!  Add Codota to your java IDE