Android Open Source - works-imageview-pager Image View Touch For Pager






From Project

Back to project page works-imageview-pager.

License

The source code is released under:

Apache License

If you think the Android project works-imageview-pager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mobilesolutionworks.android.imagepaging;
// w ww  . j  a v a  2 s . com
import android.content.Context;
import android.graphics.RectF;
import android.util.AttributeSet;

/**
 * Created by yunarta on 18/9/14.
 */
public class ImageViewTouchForPager extends TouchImageView implements Scrollable {

    public ImageViewTouchForPager(Context context) {
        super(context, null);
    }

    public ImageViewTouchForPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ImageViewTouchForPager(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean isHittingEdge(int direction) {
        RectF rect = getZoomedRect();
        if (rect == null) return true;

//        Log.d("[pager]", "isHittingEdge direction = " + direction);
        if (direction > 0) {
            boolean b = (int) rect.right <= getWidth();
//            Log.d("[pager]", "isHittingEdge right result = " + b);

            return b;
        } else {
            boolean b = (int) rect.left >= 0;
//            Log.d("[pager]", "isHittingEdge left result = " + b);

            return b;
        }
    }

    @Override
    public boolean isScrollable() {
//        boolean b = !mScaleDetector.isInProgress();
//        Log.d("[pager]", "isScrollable = " + b);

        return true;
    }
}




Java Source Code List

com.mobilesolutionworks.android.imagepaging.ImagePagerAdapter.java
com.mobilesolutionworks.android.imagepaging.ImageViewPager.java
com.mobilesolutionworks.android.imagepaging.ImageViewTouchForPager.java
com.mobilesolutionworks.android.imagepaging.Scrollable.java
com.mobilesolutionworks.android.imagepaging.TouchImageView.java