Code example for View

Methods: setAlphasetFocusablesetOnClickListenersetVisibility

    void setScrimView(View scrim) {
        if (mScrimView != null) {
        mScrimView = scrim;
        mScrimView.setAlpha(mIsBouncing ? 1.0f : 0.0f);
        mScrimView.setVisibility(mIsBouncing ? VISIBLE : INVISIBLE);
    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();
Stop searching for code, let great code find you!  Add Codota to your java IDE