Code example for View

Methods: setAlpha, setFocusable, setOnClickListener, setVisibility

0
    void setScrimView(View scrim) {
        if (mScrimView != null) {
            mScrimView.setOnClickListener(null);
        } 
        mScrimView = scrim;
        mScrimView.setAlpha(mIsBouncing ? 1.0f : 0.0f);
        mScrimView.setVisibility(mIsBouncing ? VISIBLE : INVISIBLE);
        mScrimView.setFocusable(true);
        mScrimView.setOnClickListener(mScrimClickListener);
    } 
 
    private int getVirtualHeight(LayoutParams lp, int height, int heightUsed) {
        int virtualHeight = height;
        final View root = getRootView();
        if (root != null) {
            // This calculation is super dodgy and relies on several assumptions. 
            // Specifically that the root of the window will be padded in for insets 
            // and that the window is LAYOUT_IN_SCREEN. 
            virtualHeight = mDisplayMetrics.heightPixels - root.getPaddingTop();
        } 
        if (lp.childType == LayoutParams.CHILD_TYPE_WIDGET ||