Example usage for android.graphics PixelFormat OPAQUE

List of usage examples for android.graphics PixelFormat OPAQUE

Introduction

In this page you can find the example usage for android.graphics PixelFormat OPAQUE.

Prototype

int OPAQUE

To view the source code for android.graphics PixelFormat OPAQUE.

Click Source Link

Document

System chooses an opaque format (no alpha bits required)

Usage

From source file:com.aigo.kt03airdemo.ui.view.ResideLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v))
        return true;

    // View#isOpaque didn't take all valid opaque scrollbar modes into account
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque above and return false
    // here. On older devices, check the view's background drawable directly as a fallback.
    if (Build.VERSION.SDK_INT >= 18)
        return false;

    final Drawable bg = v.getBackground();
    return bg != null && bg.getOpacity() == PixelFormat.OPAQUE;
}

From source file:com.bright.cloudutils.view.ResideLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v))
        return true;

    // View#isOpaque didn't take all valid opaque scrollbar modes into
    // account//from ww w . j  av  a 2 s  .  co  m
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque
    // above and return false
    // here. On older devices, check the view's background drawable directly
    // as a fallback.
    if (Build.VERSION.SDK_INT >= 18)
        return false;

    final Drawable bg = v.getBackground();
    return bg != null && bg.getOpacity() == PixelFormat.OPAQUE;
}

From source file:com.android.dialer.widget.OverlappingPaneLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v))
        return true;

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }/*  w  ww  .j ava2 s . com*/
    return false;
}

From source file:com.yk.notification.util.BitmapUtil.java

/**
 * DrawableBitmap/*  ww w.  j a  v  a 2s  .  c  om*/
 * 
 * @param drawable
 *            Drawable
 * @return Bitmap
 */
public static Bitmap getBitmapFromDrawable(Drawable drawable) {
    int width = drawable.getIntrinsicWidth();
    int height = drawable.getIntrinsicHeight();
    Bitmap bitmap = Bitmap.createBitmap(width, height,
            drawable.getOpacity() != PixelFormat.OPAQUE ? Config.ARGB_8888 : Config.RGB_565);
    Canvas canvas = new Canvas(bitmap);
    drawable.setBounds(0, 0, width, height);
    drawable.draw(canvas);
    return bitmap;

}

From source file:cn.emagsoftware.ui.BugFixedSlidingPaneLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v))
        return true;

    // View#isOpaque didn't take all valid opaque scrollbar modes into account
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque above and return false
    // here. On older devices, check the view's background drawable directly as a fallback.
    if (Build.VERSION.SDK_INT >= 18)
        return false;

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }//from   w ww . j  ava  2  s.com
    return false;
}

From source file:name.teze.layout.lib.SlidingPaneLayout.java

public static boolean isOpaque(View view) {
    final Drawable bg = view.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }//ww w  .j  a  v a  2s .  com
    return false;
}

From source file:com.waz.zclient.pages.main.conversationpager.SlidingPaneLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v)) {
        return true;
    }// w w w  .java2  s.c om

    // View#isOpaque didn't take all valid opaque scrollbar modes into account
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque above and return false
    // here. On older devices, check the view's background drawable directly as a fallback.
    if (Build.VERSION.SDK_INT >= 18) {
        return false;
    }

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }
    return false;
}

From source file:com.example.zhaozhu.practisecustomview.customviewgroup.HSlidingPaneLayout.java

private static boolean viewIsOpaque(final View v) {
    //if (ViewCompat.isOpaque(v))
    //{/* w ww  .j  a va  2s  . co m*/
    //   return true;
    //}

    // View#isOpaque didn't take all valid opaque scrollbar modes into
    // account
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque
    // above and return false
    // here. On older devices, check the view's background drawable directly
    // as a fallback.
    if (Build.VERSION.SDK_INT >= 18) {
        return false;
    }

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }
    return false;
}

From source file:name.teze.layout.lib.SlidingPaneLayout.java

private static boolean viewIsOpaque(View v) {
    if (isOpaque(v))
        return true;// hack by Fooyou

    // View#isOpaque didn't take all valid opaque scrollbar modes into account
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque above and return false
    // here. On older devices, check the view's background drawable directly as a fallback.
    if (Build.VERSION.SDK_INT >= 18)
        return false;

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }// w w  w .jav  a  2s .  c om
    return false;
}

From source file:cn.zmdx.kaka.locker.widget.SlidingPaneLayout.java

private static boolean viewIsOpaque(View v) {
    if (ViewCompat.isOpaque(v))
        return true;

    // View#isOpaque didn't take all valid opaque scrollbar modes into
    // account//from w w  w. j a v a  2 s  .c  om
    // before API 18 (JB-MR2). On newer devices rely solely on isOpaque
    // above and return false
    // here. On older devices, check the view's background drawable directly
    // as a fallback.
    if (Build.VERSION.SDK_INT >= 18)
        return false;

    final Drawable bg = v.getBackground();
    if (bg != null) {
        return bg.getOpacity() == PixelFormat.OPAQUE;
    }
    return false;
}