SherlockGougou / BigImageViewPager

🔥🔥🔥 BigImage ImageView ViewPager 支持超长图、超大图的图片浏览器,优化内存,支持手势放大、下拉关闭、查看原图、加载百分比、保存图片等功能。
Other
2.15k stars 248 forks source link

图片在放大时, 不能下拉关闭 #118

Closed Songsayit closed 3 years ago

Songsayit commented 3 years ago

参考iPhone手机的图库. 发现他在图片放大后, 如果拉到顶部(底部), 他仍然是可以下拉(上拉)关闭. 修改代码FingerDragHelper.java 的83行改成下面那样就行了. 请作者帮忙更新一下. 谢谢 isIntercept = (imageView.atYEdge || (imageView.getScale() <= (imageView.getMinScale() + 0.001F))) && (imageView.getMaxTouchCount() == 0 || imageView.getMaxTouchCount() == 1) && Math.abs(ev.getRawY() - mDownY) > 2 * mTouchslop; // && imageView.atYEdge);

SherlockGougou commented 3 years ago

其实是原本就是这么设计的,不过你的建议不错,我可以加个开关setEnableDragCloseIgnoreScale,默认false需要的可以设置为true

Songsayit commented 3 years ago

嗯. 谢谢. 主要现在的UI交互参考的都是iphone的. 所以需要麻烦一下你

SherlockGougou commented 3 years ago

已经增加了,版本号6.1.2

Songsayit commented 3 years ago

谢谢您

puderty commented 3 years ago

我看了这个,然后用了微信iOS的觉得它的体验更合理。区别在: 1,禁止向上滑动关闭的话应该如果一开始就在底部边缘,是不应该可以向上滑动的。 2,即使是在放大panning模式,如果已经滑动到顶部,也可以触发这个下拉关闭功能。

我的修改patch:

Index: library/src/main/java/cc/shinichi/library/view/helper/SubsamplingScaleImageViewDragClose.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8

--- library/src/main/java/cc/shinichi/library/view/helper/SubsamplingScaleImageViewDragClose.java (revision 332e5405a167fd141411e552bf26ed4b31dda6dd) +++ library/src/main/java/cc/shinichi/library/view/helper/SubsamplingScaleImageViewDragClose.java (date 1607753944000) @@ -29,11 +29,6 @@ import android.view.ViewConfiguration; import android.view.ViewParent;

-import androidx.annotation.AnyThread; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.exifinterface.media.ExifInterface;

import com.davemorrissey.labs.subscaleview.ImageViewState; import com.davemorrissey.labs.subscaleview.R.styleable; import com.davemorrissey.labs.subscaleview.decoder.CompatDecoderFactory; @@ -54,6 +49,12 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;

+import androidx.annotation.AnyThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.exifinterface.media.ExifInterface; +import cc.shinichi.library.ImagePreview; + /**