Example usage for android.widget ImageView removeCallbacks

List of usage examples for android.widget ImageView removeCallbacks

Introduction

In this page you can find the example usage for android.widget ImageView removeCallbacks.

Prototype

public boolean removeCallbacks(Runnable action) 

Source Link

Document

Removes the specified Runnable from the message queue.

Usage

From source file:com.ycl.framework.photoview.PhotoViewAttacher.java

@Override
public void setScale(float scale, float focalX, float focalY, boolean animate) {
    ImageView imageView = getImageView();

    if (null != imageView) {
        imageView.removeCallbacks(mRunColse);
        // Check to see if the scale is within bounds
        if (scale < mMinScale || scale > mMaxScale) {
            LogManager.getLogger().i(LOG_TAG, "Scale must be within the range of minScale and maxScale");
            return;
        }/*  w w w  .  j av  a2s.c o m*/

        if (animate) {
            imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY));
        } else {
            mSuppMatrix.setScale(scale, scale, focalX, focalY);
            checkAndDisplayMatrix();
        }
    }
}