Example usage for android.view View setDuplicateParentStateEnabled

List of usage examples for android.view View setDuplicateParentStateEnabled

Introduction

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

Prototype

public void setDuplicateParentStateEnabled(boolean enabled) 

Source Link

Document

Enables or disables the duplication of the parent's state into this view.

Usage

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

private void mountView(View view, int flags) {
    view.setDuplicateParentStateEnabled(MountItem.isDuplicateParentState(flags));

    mIsChildDrawingOrderDirty = true;//  w ww. j  a v  a2s .c o m

    // A host has been recycled and is already attached.
    if (view instanceof ComponentHost && view.getParent() == this) {
        finishTemporaryDetach(view);
        view.setVisibility(VISIBLE);
        return;
    }

    LayoutParams lp = view.getLayoutParams();
    if (lp == null) {
        lp = generateDefaultLayoutParams();
        view.setLayoutParams(lp);
    }

    if (mInLayout) {
        addViewInLayout(view, -1, view.getLayoutParams(), true);
    } else {
        addView(view, -1, view.getLayoutParams());
    }
}