本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}