Example usage for android.view View.OnLayoutChangeListener View.OnLayoutChangeListener

List of usage examples for android.view View.OnLayoutChangeListener View.OnLayoutChangeListener

Introduction

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

Prototype

View.OnLayoutChangeListener

Source Link

Usage

From source file:com.vuze.android.remote.fragment.TorrentListFragment.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void onCreateViewHC(View fragView) {
    if (sideListArea != null) {
        fragView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
            int lastWidth = -1;

            @Override/*w w w .j  a v a  2 s  . com*/
            public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
                    int oldTop, int oldRight, int oldBottom) {
                int width = right - left;
                if (width != lastWidth) {
                    lastWidth = width;
                    expandSideListWidth(sidelistInFocus);
                }
            }
        });
    }
}