當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewTreeObserver.addOnScrollChangedListener方法代碼示例

本文整理匯總了Java中android.view.ViewTreeObserver.addOnScrollChangedListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewTreeObserver.addOnScrollChangedListener方法的具體用法?Java ViewTreeObserver.addOnScrollChangedListener怎麽用?Java ViewTreeObserver.addOnScrollChangedListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.ViewTreeObserver的用法示例。


在下文中一共展示了ViewTreeObserver.addOnScrollChangedListener方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerListener

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
private void registerListener(View anchor) {
    // Don't do anything if we haven't managed to patch the super listener.
    // And don't bother attaching the listener if the anchor view isn't
    // attached. This means we'll only have to deal with the real VTO owned
    // by the ViewRoot.
    if (mSuperScrollListener != null) {
        ViewTreeObserver vto = (anchor.getWindowToken() != null) ? anchor.getViewTreeObserver()
                : null;
        if (vto != mViewTreeObserver) {
            if (mViewTreeObserver != null && mViewTreeObserver.isAlive()) {
                mViewTreeObserver.removeOnScrollChangedListener(mSuperScrollListener);
            }
            if ((mViewTreeObserver = vto) != null) {
                vto.addOnScrollChangedListener(mSuperScrollListener);
            }
        }
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:PopupWindowCompat.java

示例2: onAttachedToWindow

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    // mParent.requestTransparentRegion(this);
    // mSession = getWindowSession();
    mLayout.token = getWindowToken();
    mLayout.setTitle("SurfaceView");
    mViewVisibility = getVisibility() == VISIBLE;

    if (!mGlobalListenersAdded) {
        ViewTreeObserver observer = getViewTreeObserver();
        observer.addOnScrollChangedListener(mScrollChangedListener);
        observer.addOnPreDrawListener(mDrawListener);
        mGlobalListenersAdded = true;
    }
}
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:17,代碼來源:UpdateView.java

示例3: registerListener

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
private void registerListener(View anchor) {
    if (mSuperScrollListener != null) {
        ViewTreeObserver vto = (anchor.getWindowToken() != null) ? anchor.getViewTreeObserver() : null;
        if (vto != mViewTreeObserver) {
            if (mViewTreeObserver != null && mViewTreeObserver.isAlive()) {
                mViewTreeObserver.removeOnScrollChangedListener(mSuperScrollListener);
            }
            if ((mViewTreeObserver = vto) != null) {
                vto.addOnScrollChangedListener(mSuperScrollListener);
            }
        }
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:14,代碼來源:ActionBarPopupWindow.java


注:本文中的android.view.ViewTreeObserver.addOnScrollChangedListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。