Swipe down to close images #122

Merged
AmineB merged 10 commits from davidoskky/ReaderForSelfoss-multiplatform:swipe_down into master 2023-01-26 10:42:16 +00:00
3 changed files with 19 additions and 7 deletions
Showing only changes of commit 2b6659f4ec - Show all commits

View File

@ -19,6 +19,7 @@ class ImageActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding = ActivityImageBinding.inflate(layoutInflater)
val view = binding.root
binding.pager.requestDisallowInterceptTouchEvent(true)
setContentView(view)

View File

@ -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()

View File

@ -4,13 +4,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/photoView"
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:background="@drawable/checkerboard"
app:srcCompat="@android:drawable/screen_background_dark" />
android:layout_height="match_parent">
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/photoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:background="@drawable/checkerboard"
app:srcCompat="@android:drawable/screen_background_dark" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>