当前位置: 首页>>代码示例>>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;未经允许,请勿转载。