Java Code Examples for android.view.View#isOpaque()

The following examples show how to use android.view.View#isOpaque() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: AndroidProjects   File: SwipeBackLayout.java    License: MIT License 6 votes vote down vote up
private static boolean viewIsOpaque(View v) {
    if (v.isOpaque()) {
        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;
}
 
Example 2
Source Project: letv   File: ViewCompatEclairMr1.java    License: Apache License 2.0 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 3
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 4
Source Project: V.FlyoutTest   File: ViewCompatEclairMr1.java    License: MIT License 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 5
Source Project: guideshow   File: ViewCompatEclairMr1.java    License: MIT License 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}