From 9109eb36c11b610beef3a202780d6037ca923510 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Wed, 11 Jan 2023 22:13:12 +0100 Subject: [PATCH] Swipe down to close images --- CHANGELOG.md | 5 +++++ .../android/ImageActivity.kt | 1 + .../android/fragments/ImageFragment.kt | 5 +++++ .../src/main/res/layout/fragment_image.xml | 20 ++++++++++++------- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12a2ba2..fb32626 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +- feat: Close images by swiping down + +-------------------------------------------------------------------- + **v122123641** - feat: Disable the failing source in the filter sheet. @@ -13,6 +17,7 @@ - fix: NPE may be caused by the binding or the title that was null. - chore: Skip drone pipeline on changelog push. + -------------------------------------------------------------------- **v122123621** diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/ImageActivity.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/ImageActivity.kt index 16db2e8..5444485 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/ImageActivity.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/ImageActivity.kt @@ -19,6 +19,7 @@ class ImageActivity : AppCompatActivity() { super.onCreate(savedInstanceState) binding = ActivityImageBinding.inflate(layoutInflater) val view = binding.root + binding.pager.requestDisallowInterceptTouchEvent(true) setContentView(view) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ImageFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ImageFragment.kt index 7b46b8c..09cecd0 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ImageFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ImageFragment.kt @@ -27,6 +27,11 @@ class ImageFragment : Fragment() { _binding = FragmentImageBinding.inflate(inflater, container, false) val view = binding?.root + binding?.swipeRefreshLayout?.setProgressViewEndTarget(false, 0) + binding?.swipeRefreshLayout?.setOnRefreshListener { + activity?.finish() + } + binding!!.photoView.visibility = View.VISIBLE Glide.with(requireActivity()) .asBitmap() diff --git a/androidApp/src/main/res/layout/fragment_image.xml b/androidApp/src/main/res/layout/fragment_image.xml index 3bd2094..da5fc86 100644 --- a/androidApp/src/main/res/layout/fragment_image.xml +++ b/androidApp/src/main/res/layout/fragment_image.xml @@ -4,13 +4,19 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + android:layout_height="match_parent"> + + + \ No newline at end of file