-
Notifications
You must be signed in to change notification settings - Fork 4
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
[post list] allow for edge swiping only #721
Comments
Swipe actions can be disabled completely in the settings screen or you can enable actions just on one side in the "Configure swipe actions" section. I understand what your request is, i.e. starting the swipe only if the gesture begins at a certain offset on the card, but I don't know if it possible technically. I'll look into it. |
@diegoberaldin I do enjoy the swiping feature a lot, and Raccoon has a really pleasant way of handling it as well as being very customizable. I fully understand if it's not possible and that it's a minor detail in the first place. I'm just tossing out ideas honestly, its already a superb app. |
Thanks for your appreciation, feel free to ask for features or suggest changes! Actually swiping and scrolling are always a pain in Jetpack Compose (the UI toolkit used in this app) and I've already played quite a bit with SwipeToDismissBox. |
@diegoberaldin Even with all swipe actions disabled, the post list still registers swipes. You can see the post bounce slightly when you try to swipe. The problem is that scrolling up/down is often incorrectly being recognized as swipes. This makes scrolling difficult, and it is biggest reason I don't want to use Raccoon until this is fixed. Tested with 1.10.0-20240501-pre |
@diegoberaldin Sorry please ignore my previous comment. I just found the "Enable swipe actions" toggle, looks like the issue is resolved when I have the toggle off. That said, I think swipe actions should only count when swiping from the edge, instead of in the middle of the screen. |
Unfortunately, I've taken some time to dig into the documentation, and there is no support with standard M3 components. The only viable option would be to completely rewrite the component, reimplement the default behaviour by hand and adding this conditional check on top of it. I added the "help wanted" tag so if anyone wants to pick this and experiment, they'll be welcome. |
I have no idea if this is true (they could be hallucinating), but... According to Gemini: Using Modifier.swipeable:
Using GestureDetector:
And according to Copilot: To implement edge swipe actions in Jetpack Compose, you can use the Modifier.pointerInput in combination with detectDragGestures. You’ll need to check the initial touch position to determine if the gesture started from the edge of the screen. You can ask for specific code examples if you put your question into the prompt. You can probably try putting your code into the prompt and ask for the implementation based on your existing code as well. |
Using If someone has time, I am leaving this issue open with the "help wanted" tag so who knows... |
I haven't done coding for ages but I'm really interested in taking up this challenge. I just installed Android Studio and got the following error while trying to build Raccoon: Any suggestion on how to resolve this? Must be something straight forward but I've never done Android development before. And I am only familiar with Java and C#. I am hoping to help contribute more once I get a hold of the build process. |
This warning in the "sync" tab: prepareKotlinBuildScriptModel: |
The error about missing symbols is due to KSP (the symbol processor) not having run and generated the XmlString class... open the Gradle panel on the right, click the button "Execute Gradle task" and run the task called This will generate the messages class. It should be done automatically but, you know, Android Studio + Gradle + Kotlin Multiplatform + Kotlin Symbol Processor in a multi-module Gradle setup. 💥 |
As for the second message, which version of Android Studio are you using? There needs to be a consistency among:
I agree that (especially if you are not an Android developer) all this may seem a little intimidating, but welcome to our life. I have written in the CONTRIBUTING.md some notes about how to set up the environment and some more in the technical manual. Just in case you need further references. |
There should be several .kt files inside the build/generated/ksp/metadata/commonMain/kotlin directory, otherwise it means KSP failed to parse the XML resources and generate the Kotlin sources. I assume you are on Windows looking at the path in the logs? (I am on MacOS and Linux, never tried building on other OSes). |
@diegoberaldin I finally managed to build it. I was using Windows (no choice because of work). Then I tried Fedora, and installed Android Studio via Flatpak. Didn't work, got the exact same issues as with Windows. Finally I tried Ubuntu, and installed Android Studio via Snap. Got it working! I will see if I can find a solution to this particular issue. But with a working build I will play with the code and find other things to improve. Thanks a lot for your help. |
I am glad that you managed to get it building but I wonder what is wrong with KSP and Lyricist now... Everything involving the symbol processor and code generation across different modules has given me headaches (in your case it was the code in |
I have the same issue (XmlStrings), With latest Android Studio Jelly Fish. Even when manually running the task, the resources don't appear in the build directory |
@cloudlessx I discovered here an example of redefining the swipe to dismiss behaviour with the |
I had issues again when configuring the CI pipeline with the code generated by Lyricist's plugin, and I had to remove all messages using format specifiers. Another quirk of KMP + multi-module setup, I guess. 🤷🏻 The lack of documentation/samples is considerable unfortunately, and this with it being one of the best libraries out there! I can not complain because it does its job greatly, but there is a little room for improvement. |
I saw this feature used in Feeder RSS reader. Wanted to bring it up here after accidentally downvoting myself when trying to swipe down through comments.
I also get hung up on scrolling because the app will catch and try to swipe an article (an issue that plagues every app with swipe actions). An option to only allow swiping from the corresponding edges would bring a ton of quality of life.
Something like a third of the content card, so it doesn't clash with gesture navigation. This would allow for the middle third to be scrolling only.
The text was updated successfully, but these errors were encountered: