当前位置: 首页>>代码示例>>Java>>正文


Java ImageView.isInEditMode方法代码示例

本文整理汇总了Java中android.widget.ImageView.isInEditMode方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.isInEditMode方法的具体用法?Java ImageView.isInEditMode怎么用?Java ImageView.isInEditMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ImageView的用法示例。


在下文中一共展示了ImageView.isInEditMode方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
	mImageView = new WeakReference<ImageView>(imageView);

	imageView.setOnTouchListener(this);

	mViewTreeObserver = imageView.getViewTreeObserver();
	mViewTreeObserver.addOnGlobalLayoutListener(this);

	// Make sure we using MATRIX Scale Type
	setImageViewScaleTypeMatrix(imageView);

	if (!imageView.isInEditMode()) {
		// Create Gesture Detectors...
		mScaleDragDetector = VersionedGestureDetector.newInstance(
				imageView.getContext(), this);

		mGestureDetector = new GestureDetector(imageView.getContext(),
				new GestureDetector.SimpleOnGestureListener() {

					// forward long click listener
					@Override
					public void onLongPress(MotionEvent e) {
						if (null != mLongClickListener) {
							mLongClickListener.onLongClick(mImageView.get());
						}
					}
				});

		mGestureDetector.setOnDoubleTapListener(this);

		// Finally, update the UI so that we're zoomable
		setZoomable(true);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:35,代码来源:PhotoViewAttacher.java

示例2: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
    mImageView = new WeakReference<ImageView>(imageView);

    imageView.setOnTouchListener(this);

    mViewTreeObserver = imageView.getViewTreeObserver();
    mViewTreeObserver.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (!imageView.isInEditMode()) {
        // Create Gesture Detectors...
        mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);

        mGestureDetector = new GestureDetector(imageView.getContext(), new GestureDetector.SimpleOnGestureListener() {

            // forward long click listener
            @Override
            public void onLongPress(MotionEvent e) {
                if (null != mLongClickListener) {
                    mLongClickListener.onLongClick(mImageView.get());
                }
            }
        });

        mGestureDetector.setOnDoubleTapListener(this);

        // Finally, addOrUpdate the UI so that we're zoomable
        setZoomable(true);
    }
}
 
开发者ID:liuke2016,项目名称:filepicker,代码行数:33,代码来源:PhotoViewAttacher.java

示例3: initImageView

import android.widget.ImageView; //导入方法依赖的package包/类
static InitResult initImageView(ImageView view, AttributeSet attrs,
		int defStyleAttr, int defStyleRes) {
	if (attrs != null && !view.isInEditMode()) {
		final int sourceResId = getResourceId(view, attrs, true);
		final int backgroundResId = getResourceId(view, attrs, false);
		final boolean freezesAnimation = isFreezingAnimation(view, attrs,
				defStyleAttr, defStyleRes);
		return new InitResult(sourceResId, backgroundResId,
				freezesAnimation);
	}
	return new InitResult(0, 0, false);
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:13,代码来源:GifViewUtils.java

示例4: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
	mImageView = new WeakReference<ImageView>(imageView);

	imageView.setOnTouchListener(this);

	mViewTreeObserver = imageView.getViewTreeObserver();
	mViewTreeObserver.addOnGlobalLayoutListener(this);

	// Make sure we using MATRIX Scale Type
	setImageViewScaleTypeMatrix(imageView);

	if (!imageView.isInEditMode()) {
		// Create Gesture Detectors...
		mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);

		mGestureDetector = new GestureDetector(imageView.getContext(),
				new GestureDetector.SimpleOnGestureListener() {

					// forward long click listener
					@Override
					public void onLongPress(MotionEvent e) {
						if (null != mLongClickListener) {
							mLongClickListener.onLongClick(mImageView.get());
						}
					}
				});

		mGestureDetector.setOnDoubleTapListener(this);

		// Finally, update the UI so that we're zoomable
		setZoomable(true);
	}
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:34,代码来源:PhotoViewAttacher.java

示例5: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
	mImageView = new WeakReference<ImageView>(imageView);

	imageView.setOnTouchListener(this);

	mViewTreeObserver = imageView.getViewTreeObserver();
	mViewTreeObserver.addOnGlobalLayoutListener(this);

	// Make sure we using MATRIX Scale Type
	setImageViewScaleTypeMatrix(imageView);

	if (!imageView.isInEditMode()) {
		// Create Gesture Detectors...
		mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);

		mGestureDetector = new GestureDetector(imageView.getContext(),
				new GestureDetector.SimpleOnGestureListener() {

					// forward long click listener
					@Override
					public void onLongPress(MotionEvent e) {
						if(null != mLongClickListener) {
							mLongClickListener.onLongClick(mImageView.get());
						}
					}});

		mGestureDetector.setOnDoubleTapListener(this);

		// Finally, update the UI so that we're zoomable
		setZoomable(true);
	}
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:33,代码来源:PhotoViewAttacher.java

示例6: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
    mImageView = new WeakReference<ImageView>(imageView);
    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    try {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                    }catch (Exception exception){}
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));

    // Finally, update the UI so that we're zoomable
    setZoomable(true);
}
 
开发者ID:yun2win,项目名称:tvConnect_android,代码行数:39,代码来源:PhotoViewAttacher.java

示例7: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
    mImageView = new WeakReference<ImageView>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));

    // Finally, update the UI so that we're zoomable
    setZoomable(true);
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:37,代码来源:PhotoViewAttacher.java

示例8: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
    mImageView = new WeakReference<ImageView>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));

    // Finally, update the UI so that we're zoomable
    setZoomable(true);
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:38,代码来源:PhotoViewAttacher.java

示例9: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView) {
    mImageView = new WeakReference<ImageView>(imageView);

    imageView.setOnTouchListener(this);

    mViewTreeObserver = imageView.getViewTreeObserver();
    mViewTreeObserver.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (!imageView.isInEditMode()) {
        // Create Gesture Detectors...
        mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);

        mGestureDetector = new GestureDetector(imageView.getContext(),
                new GestureDetector.SimpleOnGestureListener() {

                    // forward long click listener
                    @Override
                    public void onLongPress(MotionEvent e) {
                        if (null != mLongClickListener) {
                            mLongClickListener.onLongClick(mImageView.get());
                        }
                    }
                });

        mGestureDetector.setOnDoubleTapListener(this);

        // Finally, update the UI so that we're zoomable
        setZoomable(true);
    }
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:34,代码来源:PhotoViewAttacher.java

示例10: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView, boolean zoomable) {
    mImageView = new WeakReference<>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }

                @Override
                public boolean onFling(MotionEvent e1, MotionEvent e2,
                                       float velocityX, float velocityY) {
                    if (mSingleFlingListener != null) {
                        if (getScale() > DEFAULT_MIN_SCALE) {
                            return false;
                        }

                        if (MotionEventCompat.getPointerCount(e1) > SINGLE_TOUCH
                                || MotionEventCompat.getPointerCount(e2) > SINGLE_TOUCH) {
                            return false;
                        }

                        return mSingleFlingListener.onFling(e1, e2, velocityX, velocityY);
                    }
                    return false;
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
    mBaseRotation = 0.0f;

    // Finally, update the UI so that we're zoomable
    setZoomable(zoomable);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:57,代码来源:PhotoViewAttacher.java

示例11: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
private PhotoViewAttacher(ImageView imageView, boolean zoomable) {
    mImageView = new WeakReference<>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }

                @Override
                public boolean onFling(MotionEvent e1, MotionEvent e2,
                                       float velocityX, float velocityY) {
                    if (mSingleFlingListener != null) {
                        if (getScale() > DEFAULT_MIN_SCALE) {
                            return false;
                        }

                        if (MotionEventCompat.getPointerCount(e1) > SINGLE_TOUCH
                                || MotionEventCompat.getPointerCount(e2) > SINGLE_TOUCH) {
                            return false;
                        }

                        return mSingleFlingListener.onFling(e1, e2, velocityX, velocityY);
                    }
                    return false;
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
    mBaseRotation = 0.0f;

    // Finally, update the UI so that we're zoomable
    setZoomable(zoomable);
}
 
开发者ID:wuhighway,项目名称:DailyStudy,代码行数:57,代码来源:PhotoViewAttacher.java

示例12: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView, boolean zoomable) {
    this.mInterpolator = new AccelerateDecelerateInterpolator();
    this.ZOOM_DURATION = 200;
    this.mMinScale = 1.0F;
    this.mMidScale = 1.75F;
    this.mMaxScale = 3.0F;
    this.mAllowParentInterceptOnEdge = true;
    this.mBlockParentIntercept = false;
    this.mBaseMatrix = new Matrix();
    this.mDrawMatrix = new Matrix();
    this.mSuppMatrix = new Matrix();
    this.mDisplayRect = new RectF();
    this.mMatrixValues = new float[9];
    this.mScrollEdge = 2;
    this.mScaleType = ImageView.ScaleType.FIT_CENTER;
    this.mImageView = new WeakReference<>(imageView);
    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);
    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if(null != observer) {
        observer.addOnGlobalLayoutListener(this);
    }

    setImageViewScaleTypeMatrix(imageView);
    if(!imageView.isInEditMode()) {
        this.mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);
        this.mGestureDetector = new GestureDetector(imageView.getContext(), new GestureDetector.SimpleOnGestureListener() {
            public void onLongPress(MotionEvent e) {
                if(null != PhotoViewAttacher.this.mLongClickListener) {
                    PhotoViewAttacher.this.mLongClickListener.onLongClick(PhotoViewAttacher.this.getImageView());
                }

            }

            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                return PhotoViewAttacher.this.mSingleFlingListener != null?(PhotoViewAttacher.this.getScale() > 1.0F?false:(MotionEventCompat.getPointerCount(e1) <= PhotoViewAttacher.SINGLE_TOUCH && MotionEventCompat.getPointerCount(e2) <= PhotoViewAttacher.SINGLE_TOUCH?PhotoViewAttacher.this.mSingleFlingListener.onFling(e1, e2, velocityX, velocityY):false)):false;
            }
        });
        this.mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
        this.mBaseRotation = 0.0F;
        this.setZoomable(zoomable);
    }
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:44,代码来源:PhotoViewAttacher.java

示例13: PhotoViewAttacher

import android.widget.ImageView; //导入方法依赖的package包/类
public PhotoViewAttacher(ImageView imageView, boolean zoomable) {
    mImageView = new WeakReference<>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }

                @Override
                public boolean onFling(MotionEvent e1, MotionEvent e2,
                                       float velocityX, float velocityY) {
                    if (mSingleFlingListener != null) {
                        if (getScale() > DEFAULT_MIN_SCALE) {
                            return false;
                        }

                        if (MotionEventCompat.getPointerCount(e1) > SINGLE_TOUCH
                                || MotionEventCompat.getPointerCount(e2) > SINGLE_TOUCH) {
                            return false;
                        }

                        return mSingleFlingListener.onFling(e1, e2, velocityX, velocityY);
                    }
                    return false;
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
    mBaseRotation = 0.0f;

    // Finally, update the UI so that we're zoomable
    setZoomable(zoomable);
}
 
开发者ID:WeiXinqiao,项目名称:Recognize-it,代码行数:56,代码来源:PhotoViewAttacher.java


注:本文中的android.widget.ImageView.isInEditMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。