Example usage for android.view View MEASURED_HEIGHT_STATE_SHIFT

List of usage examples for android.view View MEASURED_HEIGHT_STATE_SHIFT

Introduction

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

Prototype

int MEASURED_HEIGHT_STATE_SHIFT

To view the source code for android.view View MEASURED_HEIGHT_STATE_SHIFT.

Click Source Link

Document

Bit shift of #MEASURED_STATE_MASK to get to the height bits for functions that combine both width and height into a single int, such as #getMeasuredState() and the childState argument of #resolveSizeAndState(int,int,int) .

Usage

From source file:com.actionbarsherlock.internal.widget.IcsView.java

/**
 * Return only the state bits of {@link #getMeasuredWidthAndState()}
 * and {@link #getMeasuredHeightAndState()}, combined into one integer.
 * The width component is in the regular bits {@link #MEASURED_STATE_MASK}
 * and the height component is at the shifted bits
 * {@link #MEASURED_HEIGHT_STATE_SHIFT}>>{@link #MEASURED_STATE_MASK}.
 *//*from   w  ww  .  ja v  a  2s .c om*/
public static int getMeasuredStateInt(View child) {
    return (child.getMeasuredWidth() & View.MEASURED_STATE_MASK)
            | ((child.getMeasuredHeight() >> View.MEASURED_HEIGHT_STATE_SHIFT)
                    & (View.MEASURED_STATE_MASK >> View.MEASURED_HEIGHT_STATE_SHIFT));
}

From source file:com.zj.showgirl.GirlFragment.java

@Nullable
@Override/*from ww  w.jav  a2s.  c  o  m*/
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_girl, container, false);
    ButterKnife.bind(this, view);

    setRecyclerView();
    setSwipeRefreshLayout();

    // ?refresh
    swipeRefreshLayout.measure(View.MEASURED_SIZE_MASK, View.MEASURED_HEIGHT_STATE_SHIFT);
    if (mIsFirstCreated) {
        onRefresh();
    }
    swipeRefreshLayout.setOnRefreshListener(this);
    return view;
}

From source file:com.hackerli.girl.module.showgirl.GirlFragment.java

@Nullable
@Override/*w w w . ja  v  a2  s .  c om*/
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_girl, container, false);
    ButterKnife.bind(this, view);

    setRecyclerView();
    setSwipeRefreshLayout();

    // ?refresh
    mSwipeRefreshLayout.measure(View.MEASURED_SIZE_MASK, View.MEASURED_HEIGHT_STATE_SHIFT);
    onRefresh();
    mSwipeRefreshLayout.setOnRefreshListener(this);
    return view;
}