Skip to content Skip to sidebar Skip to footer

Android Pinch-to-zoom Layout Inside A Viewpager With Padding Left And Right

I have a viewpager with left and right padding for showing the previews of left and right pages of viewpager. viewPager.setPadding(30,0,30,0); The content of the viewpager is a z

Solution 1:

Did you try putting zoomview beside viewpager in framelayout (not in each page) so it is on top of viewpager.

Solution 2:

Try this, it's worked for me using this :https://gist.github.com/atermenji/3781644

publicclassImageZoomViewPagerextendsViewPager {

publicImageZoomViewPager(Context context) {
    super(context);
}

publicImageZoomViewPager(Context context, AttributeSet attrs) {
    super(context, attrs);
}

@OverrideprotectedbooleancanScroll(View v, boolean checkV, int dx, int x, int y) {
    if (v instanceof ImageViewTouch) {
        return ((ImageViewTouch) v).canScroll(dx);
    } else {
        returnsuper.canScroll(v, checkV, dx, x, y);
    }
}}

Post a Comment for "Android Pinch-to-zoom Layout Inside A Viewpager With Padding Left And Right"