Example #1
0
 public AnimatedZoomRunnable(PhotoViewAttacher photoViewAttacher, float currentZoom, float targetZoom,
                             float focalX, float focalY)
 {
     this.photoViewAttacher = photoViewAttacher;
     mFocalX    = focalX;
     mFocalY    = focalY;
     mStartTime = Java.Lang.JavaSystem.CurrentTimeMillis();
     mZoomStart = currentZoom;
     mZoomEnd   = targetZoom;
 }
        public PhotoView(Context context, IAttributeSet attr, int defStyle) : base(context, attr, defStyle)
        {
            base.SetScaleType(ScaleType.Matrix);
            mAttacher = new PhotoViewAttacher(this);

            if (null != mPendingScaleType)
            {
                SetScaleType(mPendingScaleType);
                mPendingScaleType = null;
            }
        }
        public PhotoView(Context context) : base(context, null, 0)
        {
            base.SetScaleType(ScaleType.Matrix);
            mAttacher = new PhotoViewAttacher(this);

            if (null != mPendingScaleType)
            {
                SetScaleType(mPendingScaleType);
                mPendingScaleType = null;
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            PhotoView mImageView = FindViewById <PhotoView>(Resource.Id.iv_photo);

            mCurrMatrixTv = FindViewById <TextView>(Resource.Id.tv_current_matrix);

            Drawable bitmap = Resources.GetDrawable(Resource.Drawable.wallpaper);

            mImageView.SetImageDrawable(bitmap);

            // The MAGIC happens here!
            mAttacher = new PhotoViewAttacher(mImageView);

            // Lets attach some listeners, not required though!
            mAttacher.SetOnMatrixChangeListener(new MatrixChangeListener(this));
            mAttacher.SetOnPhotoTapListener(new PhotoTapListener(this));
        }
Example #5
0
 public void SetPhotoViewAttacher(PhotoViewAttacher newPhotoViewAttacher)
 {
     this.photoViewAttacher = newPhotoViewAttacher;
 }
Example #6
0
 public DefaultOnDoubleTapListener(PhotoViewAttacher photoViewAttacher)
 {
     SetPhotoViewAttacher(photoViewAttacher);
 }
Example #7
0
 public FlingRunnable(PhotoViewAttacher photoViewAttacher, Context context)
 {
     mScroller = ScrollerProxy.GetScroller(context);
     this.photoViewAttacher = photoViewAttacher;
 }
Example #8
0
 public MSimpleOnGestureListener(PhotoViewAttacher photoViewAttacher)
 {
     this.photoViewAttacher = photoViewAttacher;
 }