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) {
Stop searching for code, let great code find you!  Add Codota to your java IDE