Swipe down to close images #122
No reviewers
Labels
No Label
Difficulty - Beginner friendly
Difficulty = Easy
Difficulty = Hard
Difficulty = Medium
Priority = CRITICAL
Priority = High
Priority = Low
Priority = Normal
Priority = Some day
Status - Fixed somewhere else
Status - No details provided
Status = Can't fix
Status = Duplicate
Status = Help wanted
Status = Invalid
Status = Need more details
Status = Taken
Status = Wontfix
Type - Selfoss works like this
Type = Bug
Type = Chore
Type = Enhancement
Type = Feature
Type = Question
Type = SELFOSS API ISSUE
Type = Tools
Type = UX/Design
Up For Grabs
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Louvorg/ReaderForSelfoss-multiplatform#122
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "davidoskky/ReaderForSelfoss-multiplatform:swipe_down"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Types of changes
This is implements feature #13
Images are closed by swiping down, no graphical clue is given however.
Eventually I decided to use the SwipeRefreshLayout since it already implements the correct gesture, this way there's no need to implement a specific way to detect the gesture.
9109eb36c1
to1f7a47c614
@ -1,3 +1,7 @@
- feat: Close images by swiping down
This will be generated automatically. Can you please remove this ?
Sure, there you go
1f7a47c614
to2b6659f4ec
I'm not sure if anyone will discover this feature if there is no way to tell if the image is being closed.
I can't merge this like this.
I agree, a graphical indication that the image will be closed would be proper.
I'm unsure how to introduce it though: the best thing would be an animation that shows the image closing.
I'll try to look into that already, I'm quite sure all libraries doing that are outdated, but I may find some easy way to do it.
Alright, I found an easy way to animate it. It's simple and it works fairly well with the viewpager as well. While dragging down the image it shrinks towards the bottom of the screen and then it closes and you're back to the article. This does not happen if you zoomed into the image, so you're safe to drag it around. The only thing is that while dragging down the image you get a white background, which isn't very nice.
I'll check if it is possible to have the article itself as background when that's happening, but I figure it could be complex and I might have to move the image fragments to be instantiated in the article fragment itself. Thus, if that's too complex I guess this could be merged as is, it currently works fine.
It isn't reliable. You can see how weirdly it works on the video attached.
Damn, I didn't have this happening to me before. I'll try reproducing that.
Alright, this is finished. The image can be swiped down to be closed and there is no interference with the viewpager or the zooming of the image. When swiping down, the image resizes to a small square at the bottom of the screen, completing the animation the activity closes, otherwise the image animates back to full screen automatically.
When swiping down, the article is visible in the background, slightly obscured by a dark color.
I have found no other major usability issues. I've been playing around with it for a while. It happened to me once that the animation stopped in the middle, tapping on the image made it start again, I was unable to reproduce this however. It is possible to swipe the image down mid way, stop swiping and start swiping horizontally to change image while it is not full screen; this doesn't appear to me as a big issue since it is not impeding the usability of the functionalities.
Just tested it, it works pretty good.
I'll review the code, now, and merge as soon as everything is closed.
@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.constraintlayout.motion.widget.MotionLayout
This may be removed.
@ -34,0 +34,4 @@
val transitionListener = object : MotionLayout.TransitionListener {
override fun onTransitionStarted(motionLayout: MotionLayout?, startId: Int, endId: Int) {
binding.root.setOnClickListener {
Is this needed ?
Ops, sorry didn't even notice that...
@ -34,0 +34,4 @@
val transitionListener = object : MotionLayout.TransitionListener {
override fun onTransitionStarted(motionLayout: MotionLayout?, startId: Int, endId: Int) {
binding.root.setOnClickListener {
Is this needed ?
I just checked again, if any of those definitions is removed the build fails.
I meant the empty onclick listener
I'll merge as soon as everything is ok