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

The following examples show how to use android.view.View#isOpaque() . 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 check out the related API usage on the sidebar.
Example 1
Source File: SwipeBackLayout.java    From AndroidProjects with 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 File: ViewCompatEclairMr1.java    From letv with Apache License 2.0 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 3
Source File: ViewCompatEclairMr1.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 4
Source File: ViewCompatEclairMr1.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}
 
Example 5
Source File: ViewCompatEclairMr1.java    From guideshow with MIT License 4 votes vote down vote up
public static boolean isOpaque(View view) {
    return view.isOpaque();
}