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


Java ViewTreeObserver.removeGlobalOnLayoutListener方法代碼示例

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


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

示例1: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
public void cleanup() {
    if(null != this.mImageView) {
        ImageView imageView = (ImageView)this.mImageView.get();
        if(null != imageView) {
            ViewTreeObserver observer = imageView.getViewTreeObserver();
            if(null != observer && observer.isAlive()) {
                observer.removeGlobalOnLayoutListener(this);
            }

            imageView.setOnTouchListener((View.OnTouchListener)null);
            this.cancelFling();
        }

        if(null != this.mGestureDetector) {
            this.mGestureDetector.setOnDoubleTapListener((GestureDetector.OnDoubleTapListener)null);
        }

        this.mMatrixChangeListener = null;
        this.mPhotoTapListener = null;
        this.mViewTapListener = null;
        this.mImageView = null;
    }
}
 
開發者ID:leobert-lan,項目名稱:UiLib,代碼行數:24,代碼來源:PhotoViewAttacher.java

示例2: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Clean-up the resources attached to this object. This needs to be called when the ImageView is
 * no longer used. A good example is from {@link android.view.View#onDetachedFromWindow()} or
 * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using
 * {@link uk.co.senab.photoview.PhotoView}.
 */
@SuppressWarnings("deprecation")
public void cleanup() {
    if (null == mImageView) {
        return; // cleanup already done
    }

    final ImageView imageView = mImageView.get();

    if (null != imageView) {
        // Remove this as a global layout listener
        ViewTreeObserver observer = imageView.getViewTreeObserver();
        if (null != observer && observer.isAlive()) {
            observer.removeGlobalOnLayoutListener(this);
        }

        // Remove the ImageView's reference to this
        imageView.setOnTouchListener(null);

        // make sure a pending fling runnable won't be run
        cancelFling();
    }

    if (null != mGestureDetector) {
        mGestureDetector.setOnDoubleTapListener(null);
    }

    // Clear listeners too
    mMatrixChangeListener = null;
    mPhotoTapListener = null;
    mViewTapListener = null;

    // Finally, clear ImageView
    mImageView = null;
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:41,代碼來源:PhotoViewAttacher.java

示例3: onDetachedFromWindow

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
@Override
protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();
    ActivityChooserModel dataModel = mAdapter.getDataModel();
    if (dataModel != null) {
        try {
            dataModel.unregisterObserver(mModelDataSetOberver);
        } catch (IllegalStateException e) {
            //Oh, well... fixes issue #557
        }
    }
    ViewTreeObserver viewTreeObserver = getViewTreeObserver();
    if (viewTreeObserver.isAlive()) {
        viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
    }
    mIsAttachedToWindow = false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:18,代碼來源:ActivityChooserView.java

示例4: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Clean-up the resources attached to this object. This needs to be called when the ImageView is
 * no longer used. A good example is from {@link View#onDetachedFromWindow()} or
 * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using
 * {@link IPhotoView}.
 */
@SuppressWarnings("deprecation")
public void cleanup() {
    if (null == mImageView) {
        return; // cleanup already done
    }

    final ImageView imageView = mImageView.get();

    if (null != imageView) {
        // Remove this as a global layout listener
        ViewTreeObserver observer = imageView.getViewTreeObserver();
        if (null != observer && observer.isAlive()) {
            observer.removeGlobalOnLayoutListener(this);
        }

        // Remove the ImageView's reference to this
        imageView.setOnTouchListener(null);

        // make sure a pending fling runnable won't be run
        cancelFling();
    }

    if (null != mGestureDetector) {
        mGestureDetector.setOnDoubleTapListener(null);
    }

    // Clear listeners too
    mMatrixChangeListener = null;
    mPhotoTapListener = null;
    mViewTapListener = null;

    // Finally, clear ImageView
    mImageView = null;
}
 
開發者ID:WeiXinqiao,項目名稱:Recognize-it,代碼行數:41,代碼來源:PhotoViewAttacher.java

示例5: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Clean-up the resources attached to this object. This needs to be called when the ImageView is
 * no longer used. A good example is from {@link View#onDetachedFromWindow()} or
 * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using
 */
@SuppressWarnings("deprecation")
public void cleanup() {
    if (null == mImageView) {
        return; // cleanup already done
    }

    final ImageView imageView = mImageView.get();

    if (null != imageView) {
        // Remove this as a global layout listener
        ViewTreeObserver observer = imageView.getViewTreeObserver();
        if (null != observer && observer.isAlive()) {
            observer.removeGlobalOnLayoutListener(this);
        }

        // Remove the ImageView's reference to this
        imageView.setOnTouchListener(null);

        // make sure a pending fling runnable won't be run
        cancelFling();
    }

    if (null != mGestureDetector) {
        mGestureDetector.setOnDoubleTapListener(null);
    }

    // Clear listeners too
    mMatrixChangeListener = null;
    mPhotoTapListener = null;
    mViewTapListener = null;

    // Finally, clear ImageView
    mImageView = null;
}
 
開發者ID:yun2win,項目名稱:tvConnect_android,代碼行數:40,代碼來源:PhotoViewAttacher.java

示例6: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Clean-up the resources attached to this object. This needs to be called when the ImageView is
 * no longer used. A good example is from {@link View#onDetachedFromWindow()} or
 * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using
 * {@link PhotoView}.
 */
@SuppressWarnings("deprecation")
public void cleanup() {
    if (null == mImageView) {
        return; // cleanup already done
    }

    final ImageView imageView = mImageView.get();

    if (null != imageView) {
        // Remove this as a global layout listener
        ViewTreeObserver observer = imageView.getViewTreeObserver();
        if (null != observer && observer.isAlive()) {
            observer.removeGlobalOnLayoutListener(this);
        }

        // Remove the ImageView's reference to this
        imageView.setOnTouchListener(null);

        // make sure a pending fling runnable won't be run
        cancelFling();
    }

    if (null != mGestureDetector) {
        mGestureDetector.setOnDoubleTapListener(null);
    }

    // Clear listeners too
    mMatrixChangeListener = null;
    mPhotoTapListener = null;
    mViewTapListener = null;

    // Finally, clear ImageView
    mImageView = null;
}
 
開發者ID:wuhighway,項目名稱:DailyStudy,代碼行數:41,代碼來源:PhotoViewAttacher.java

示例7: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
public void cleanup() {
    if (this.mImageView != null) {
        ImageView imageView = (ImageView) this.mImageView.get();
        if (imageView != null) {
            ViewTreeObserver observer = imageView.getViewTreeObserver();
            if (observer != null && observer.isAlive()) {
                observer.removeGlobalOnLayoutListener(this);
            }
            imageView.setOnTouchListener(null);
            cancelFling();
        }
        if (this.mGestureDetector != null) {
            this.mGestureDetector.setOnDoubleTapListener(null);
        }
        this.mMatrixChangeListener = null;
        this.mPhotoTapListener = null;
        this.mViewTapListener = null;
        this.mImageView = null;
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:21,代碼來源:PhotoViewAttacher.java

示例8: cleanup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Clean-up the resources attached to this object. This needs to be called when the ImageView is
 * no longer used. A good example is from {@link android.view.View#onDetachedFromWindow()} or
 * from {@link android.app.Activity#onDestroy()}. This is automatically called if you are using
 * {@link opensource.component.photoview.PhotoView}.
 */
@SuppressWarnings("deprecation")
public final void cleanup() {
    if (null == mImageView) {
        return; // cleanup already done
    }

    final ImageView imageView = mImageView.get();

    if (null != imageView) {
        // Remove this as a global layout listener
        ViewTreeObserver observer = imageView.getViewTreeObserver();
        if (null != observer && observer.isAlive()) {
            observer.removeGlobalOnLayoutListener(this);
        }

        // Remove the ImageView's reference to this
        imageView.setOnTouchListener(null);

        // make sure a pending fling runnable won't be run
        cancelFling();
    }

    if (null != mGestureDetector) {
        mGestureDetector.setOnDoubleTapListener(null);
    }

    // Clear listeners too
    mMatrixChangeListener = null;
    mPhotoTapListener = null;
    mViewTapListener = null;

    // Finally, clear ImageView
    mImageView = null;
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:41,代碼來源:PhotoViewAttacher.java

示例9: removeOnGlobalLayoutListener

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
private static void removeOnGlobalLayoutListener(ViewTreeObserver observer, ViewTreeObserver.OnGlobalLayoutListener listener) {
    if (observer == null) {
        return ;
    }

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
        observer.removeGlobalOnLayoutListener(listener);
    } else {
        observer.removeOnGlobalLayoutListener(listener);
    }
}
 
開發者ID:jphacks,項目名稱:TK_1701,代碼行數:12,代碼來源:LookActivity.java

示例10: removeGlobalLayoutListener

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public static void removeGlobalLayoutListener(ViewTreeObserver viewTreeObserver, OnGlobalLayoutListener keyboardListener) {
	if (Version.sdkAboveOrEqual(Version.API16_JELLY_BEAN_41)) {
		ApiSixteenPlus.removeGlobalLayoutListener(viewTreeObserver, keyboardListener);
	} else {
		viewTreeObserver.removeGlobalOnLayoutListener(keyboardListener);
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:9,代碼來源:Compatibility.java

示例11: removeGlobalLayoutObserver

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
public static void removeGlobalLayoutObserver(final ViewTreeObserver observer,
        ViewTreeObserver.OnGlobalLayoutListener layoutListener) {
    if (Build.VERSION.SDK_INT < 16) {
        observer.removeGlobalOnLayoutListener(layoutListener);
    } else {
        observer.removeOnGlobalLayoutListener(layoutListener);
    }
}
 
開發者ID:lurbas,項目名稱:ListItemView,代碼行數:9,代碼來源:ViewUtils.java

示例12: dismissPopup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
/**
 * Dismisses the popup window with activities.
 *
 * @return True if dismissed, false if already dismissed.
 */
public boolean dismissPopup() {
    if (isShowingPopup()) {
        getListPopupWindow().dismiss();
        ViewTreeObserver viewTreeObserver = getViewTreeObserver();
        if (viewTreeObserver.isAlive()) {
            viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
        }
    }
    return true;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:ActivityChooserView.java

示例13: dismissPopup

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
public boolean dismissPopup() {
    if (isShowingPopup()) {
        getListPopupWindow().dismiss();
        ViewTreeObserver viewTreeObserver = getViewTreeObserver();
        if (viewTreeObserver.isAlive()) {
            viewTreeObserver.removeGlobalOnLayoutListener(this.mOnGlobalLayoutListener);
        }
    }
    return true;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:ActivityChooserView.java

示例14: onDetachedFromWindow

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();
    ActivityChooserModel dataModel = this.mAdapter.getDataModel();
    if (dataModel != null) {
        dataModel.unregisterObserver(this.mModelDataSetOberver);
    }
    ViewTreeObserver viewTreeObserver = getViewTreeObserver();
    if (viewTreeObserver.isAlive()) {
        viewTreeObserver.removeGlobalOnLayoutListener(this.mOnGlobalLayoutListener);
    }
    if (isShowingPopup()) {
        dismissPopup();
    }
    this.mIsAttachedToWindow = false;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:16,代碼來源:ActivityChooserView.java

示例15: removeGlobalOnLayoutListener

import android.view.ViewTreeObserver; //導入方法依賴的package包/類
@TargetApi(AndroidVersionCodes.JELLY_BEAN)
public static void removeGlobalOnLayoutListener(ViewTreeObserver mViewTreeObserver, ViewTreeObserver.OnGlobalLayoutListener listener) {
    if (Build.VERSION.SDK_INT < AndroidVersionCodes.JELLY_BEAN) {
        mViewTreeObserver.removeGlobalOnLayoutListener(listener);
    } else {
        mViewTreeObserver.removeOnGlobalLayoutListener(listener);
    }
}
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:9,代碼來源:AndroidUtilsCompat.java


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