Example usage for android.graphics.drawable Drawable getOpacity

List of usage examples for android.graphics.drawable Drawable getOpacity

Introduction

In this page you can find the example usage for android.graphics.drawable Drawable getOpacity.

Prototype

public abstract @PixelFormat.Opacity int getOpacity();

Source Link

Document

Return the opacity/transparency of this Drawable.

Usage

From source file:org.bangbang.support.v4.widget.HListView.java

/**
     * Sets the drawable that will be drawn between each item in the list. If the drawable does
     * not have an intrinsic height, you should also call {@link #setDividerHeight(int)}
     */*w w w  . ja v a 2 s  . co m*/
     * @param divider The drawable to use.
     */
    public void setDivider(Drawable divider) {
        if (divider != null) {
            mDividerWidth = divider.getIntrinsicHeight();
            mClipDivider = divider instanceof ColorDrawable;
        } else {
            mDividerWidth = 0;
            mClipDivider = false;
        }
        mDivider = divider;
        mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE;
        requestLayoutIfNecessary();
    }

From source file:com.appunite.list.HorizontalListView.java

/**
 * Sets the drawable that will be drawn between each item in the list. If the drawable does
 * not have an intrinsic width, you should also call {@link #setDividerWidth(int)}
 *
 * @param divider The drawable to use./*from w  w  w.  ja  va2  s  . c o  m*/
 */
public void setDivider(Drawable divider) {
    if (divider != null) {
        mDividerWidth = divider.getIntrinsicWidth();
    } else {
        mDividerWidth = 0;
    }
    mDivider = divider;
    mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE;
    requestLayout();
    invalidate();
}

From source file:com.appunite.list.ListView.java

/**
 * Sets the drawable that will be drawn between each item in the list. If the drawable does
 * not have an intrinsic width, you should also call {@link #setDividerHeight(int)}
 *
 * @param divider The drawable to use./*w  w w.j  a  va 2 s  . co  m*/
 */
public void setDivider(Drawable divider) {
    if (divider != null) {
        mDividerHeight = divider.getIntrinsicHeight();
    } else {
        mDividerHeight = 0;
    }
    mDivider = divider;
    mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE;
    requestLayout();
    invalidate();
}

From source file:com.awrtechnologies.carbudgetsales.hlistview.widget.HListView.java

/**
 * Sets the drawable that will be drawn between each item in the list. If the drawable does not have an intrinsic height, you
 * should also call {@link #setDividerHeight(int)}
 * //  www  . ja v a 2  s  .co m
 * @param divider
 *           The drawable to use.
 */
public void setDivider(Drawable divider) {
    if (LOG_ENABLED) {
        Log.i(LOG_TAG, "setDivider: " + divider);
    }

    if (divider != null) {
        mDividerWidth = divider.getIntrinsicWidth();
    } else {
        mDividerWidth = 0;
    }
    mDivider = divider;
    mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE;
    requestLayout();
    invalidate();
}