Code example for ViewTreeObserver

Methods: addOnGlobalLayoutListener

0
		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) {
Connect your IDE to all the code out there  Get Codota for Java