From 5c88ce9fa834f99f86b4adac389254cb9af77db0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 19:47:54 +0200 Subject: [PATCH] update PhotoView to 2.1.2 --- app/build.gradle | 2 +- .../gallery/fragments/PhotoFragment.kt | 15 ++++++--------- app/src/main/res/layout/pager_photo_item.xml | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4596e75ef..fe35d2c6a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ dependencies { compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.google.code.gson:gson:2.8.0' - compile 'com.github.chrisbanes:PhotoView:1.3.1' + compile 'com.github.chrisbanes:PhotoView:2.1.2' compile 'it.sephiroth.android.exif:library:1.0.1' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 134af8f40..1667d68c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -38,7 +38,6 @@ import com.simplemobiletools.gallery.helpers.MEDIUM import com.simplemobiletools.gallery.models.Medium import it.sephiroth.android.library.exif2.ExifInterface import kotlinx.android.synthetic.main.pager_photo_item.view.* -import uk.co.senab.photoview.PhotoViewAttacher import java.io.File import java.io.FileOutputStream import java.io.IOException @@ -93,15 +92,13 @@ class PhotoFragment : ViewPagerFragment() { view.photo_view.apply { maximumScale = 8f mediumScale = 3f - setOnPhotoTapListener(object : PhotoViewAttacher.OnPhotoTapListener { - override fun onPhotoTap(view: View?, x: Float, y: Float) { - photoClicked() - } + setOnOutsidePhotoTapListener { + photoClicked() + } - override fun onOutsidePhotoTap() { - photoClicked() - } - }) + setOnPhotoTapListener { view, x, y -> + photoClicked() + } } loadImage() diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index 7d7cf1e82..1c4d2d76a 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> -