-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add swiping between posts in PostActivity #872
Conversation
Does this conflict with #785 ? |
Huh - To be honest, I didn't even notice that feature. I suppose this renders that non-functional - I'm using my build right now on my phone and it does not go back to the HomeActivity when swiping right. I guess my question then is how to best bring the two features together? Personally, I can live without #785 in favor of this. |
The codeowners are gonna have to decide that but most likely you will have to set an option somewhere to decide between yours, the previous and none. |
Yeah, that's probably the best solution - I'll get started on adding that as an option in the meantime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a setting, "Allow swiping between posts" or something like that. Disabled by default. When disabled, the current behaviour is maintained where swiping right on the post view will return you to the home/community view. If enabled, then you must use back or the back arrow in the top left to navigate back, and swiping left/right switches between posts.
Cleaned everything up a bit and got it functioning as requested @twizmwazin - should be all set for your review 🤞 Thanks for taking the time! |
app/src/main/java/com/jerboa/ui/components/common/SwipeBetweenPosts.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/common/SwipeBetweenPosts.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/common/SwipeBetweenPosts.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/jerboa/ui/components/home/HomeViewModel.kt
Outdated
Show resolved
Hide resolved
What behaviour should be expected when the post is opened via deep link? The post might not be in the list of posts loaded by HomeViewModel. |
@nahwneeth If the current post is not in the post list, then swiping will simply have no effect; there is no forward/backward on a deep link, right? |
@twizmwazin imo there should also be an option to disable both behaviours, i frequent /c/jerboa and #979. There are users who do not want either. Simple turning it into a Enum with a additional None would suffice and it should default to none. |
FWIW, I agree, and am happy to implement it that way 👍 |
# Conflicts: # app/src/main/java/com/jerboa/MainActivity.kt # app/src/main/java/com/jerboa/db/AppDB.kt # app/src/main/java/com/jerboa/model/CommunityViewModel.kt # app/src/main/java/com/jerboa/model/HomeViewModel.kt # app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt
# Conflicts: # app/schemas/com.jerboa.db.AppDB/18.json # app/src/main/java/com/jerboa/db/AppDB.kt # app/src/main/java/com/jerboa/db/Migrations.kt
var communityName: String? by mutableStateOf(null) | ||
|
||
var fetchingMore by mutableStateOf(false) | ||
private set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to re-merge from main, because all these should be removed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for coming back to this. I ll take a deeper look some time later
app/src/main/java/com/jerboa/ui/components/common/PostStream.kt
Outdated
Show resolved
Hide resolved
} else { | ||
appState.toPost(id = crv.post.id) | ||
} | ||
// TODO navigate to comment (using appState.toComment()) once the route is supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's blocking this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing, navigating to the Comment route caused a crash, presumably because it is not supported by any existing composable 🤷
app/src/main/java/com/jerboa/ui/components/post/PostActivity.kt
Outdated
Show resolved
Hide resolved
I found a bug where, after having already gone into the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There also some warnings that need to fixed. I still need to take a deeper look at this
showVotingArrowsInListView = appSettings.showVotingArrowsInListView, | ||
showParentCommentNavigationButtons = appSettings.showParentCommentNavigationButtons, | ||
navigateParentCommentsWithVolumeButtons = appSettings.navigateParentCommentsWithVolumeButtons, | ||
siteViewModel = siteViewModel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the toComment crashes because you removed this composable.
This is the one that makes it possible
There are so many changes here that you might be better off starting from |
Stale PR. I can re-open if necessary. |
This was a feature that I absolutely could not live without in BaconReader. This lets you swipe left and right when in a post to get to the next or previous one. Let me know your thoughts.
Thanks!