Example usage for android.view ViewTreeObserver addOnTouchModeChangeListener

List of usage examples for android.view ViewTreeObserver addOnTouchModeChangeListener

Introduction

In this page you can find the example usage for android.view ViewTreeObserver addOnTouchModeChangeListener.

Prototype

public void addOnTouchModeChangeListener(OnTouchModeChangeListener listener) 

Source Link

Document

Register a callback to be invoked when the invoked when the touch mode changes.

Usage

From source file:com.example.libwidgettv.bak.AbsListView.java

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    final ViewTreeObserver treeObserver = getViewTreeObserver();
    treeObserver.addOnTouchModeChangeListener(this);
    if (mTextFilterEnabled && mPopup != null && !mGlobalLayoutListenerAddedFilter) {
        treeObserver.addOnGlobalLayoutListener(this);
    }//from   w w w  . j av a2s.  c o m

    if (mAdapter != null && mDataSetObserver == null) {
        mDataSetObserver = new AdapterDataSetObserver();
        mAdapter.registerDataSetObserver(mDataSetObserver);

        // Data may have changed while we were detached. Refresh.
        mDataChanged = true;
        mOldItemCount = mItemCount;
        mItemCount = mAdapter.getCount();
    }
    mIsAttached = true;
}

From source file:com.appunite.list.AbsHorizontalListView.java

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    final ViewTreeObserver treeObserver = getViewTreeObserver();
    treeObserver.addOnTouchModeChangeListener(this);
    if (mTextFilterEnabled && mPopup != null && !mGlobalLayoutListenerAddedFilter) {
        treeObserver.addOnGlobalLayoutListener(this);
    }/*from  www  . j a  v  a2s.  c  o  m*/

    if (mAdapter != null && mDataSetObserver == null) {
        mDataSetObserver = new AdapterDataSetObserver();
        mAdapter.registerDataSetObserver(mDataSetObserver);

        // Data may have changed while we were detached. Refresh.
        mDataChanged = true;
        mOldItemCount = mItemCount;
        mItemCount = mAdapter.getCount();
    }
}

From source file:com.runmit.sweedee.view.DirectListView.java

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    final ViewTreeObserver treeObserver = getViewTreeObserver();
    treeObserver.addOnTouchModeChangeListener(this);

    if (mAdapter != null && mDataSetObserver == null) {
        mDataSetObserver = new AdapterDataSetObserver();
        mAdapter.registerDataSetObserver(mDataSetObserver);

        // Data may have changed while we were detached. Refresh.
        //            mDataChanged = true;
        mOldItemCount = mItemCount;/*  www .j  a va2 s .c o m*/
        mItemCount = mAdapter.getCount();
    }

    mIsAttached = true;
}

From source file:com.aliasapps.seq.scroller.TwoWayView.java

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    final ViewTreeObserver treeObserver = getViewTreeObserver();
    treeObserver.addOnTouchModeChangeListener(this);

    if (mAdapter != null && mDataSetObserver == null) {
        mDataSetObserver = new AdapterDataSetObserver();
        mAdapter.registerDataSetObserver(mDataSetObserver);

        // Data may have changed while we were detached. Refresh.
        mDataChanged = true;/*from w w w .j av a  2s .  c  o m*/
        mOldItemCount = mItemCount;
        mItemCount = mAdapter.getCount();
    }

    mIsAttached = true;
}