Example usage for android.view View setForeground

List of usage examples for android.view View setForeground

Introduction

In this page you can find the example usage for android.view View setForeground.

Prototype

public void setForeground(Drawable foreground) 

Source Link

Document

Supply a Drawable that is to be rendered on top of all of the content in the view.

Usage

From source file:Main.java

public static void setForeground(View view, Drawable drawable) {
    view.setForeground(drawable);
}

From source file:com.facebook.litho.MountState.java

private static void setViewForeground(View view, ViewNodeInfo viewNodeInfo) {
    final Drawable foreground = viewNodeInfo.getForeground();
    if (foreground != null) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            throw new IllegalStateException("MountState has a ViewNodeInfo with foreground however "
                    + "the current Android version doesn't support foreground on Views");
        }//from   w w  w.  j  a va2s.c o m

        view.setForeground(foreground);
    }
}

From source file:com.facebook.litho.MountState.java

private static void unsetViewForeground(View view, ViewNodeInfo viewNodeInfo) {
    final Drawable foreground = viewNodeInfo.getForeground();
    if (foreground != null) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
            throw new IllegalStateException("MountState has a ViewNodeInfo with foreground however "
                    + "the current Android version doesn't support foreground on Views");
        }// w  ww .  java2  s.co m

        view.setForeground(null);
    }
}