Touch feedback during swipe left and right - ionic-framework

My app has a master-detail structure, where the user can tap on a master item to go to the detail view and then swipe left or right to navigate to other details items.
I'm using on-swipe-left and on-swipe-right to let users swipe between the detail views, however, when the user swipes, there is no visual feedback that there is a swipe happening. Only after the user has fully swiped does anything happen. I thought I could use the slide box, because the slidebox does provide visual feedback as soon as you start swiping, however, my views have vertical scroll and that conflicts with the left and right swipe actions due to the swipe sensitivity. In other words, when the user touches the screen to begin scrolling down, the swipe action takes over and it tries to swipe left or right instead of scrolling down.
So, what are my options? Is there any way I can provide some kind of an animation with on-swipe-left and on-swipe-right so that there is some kind of visual feedback (may be an ink trail on the screen) I can show the user? Or is there any way I can make the slidebox approach work so that the horizontal swipe and vertical scroll can function harmoniously? I have seen other apps that have scroll and swipe functions working harmoniously--gmail and pinterest are examples. Just not able to get it working with ionic.
Or is there another UI pattern that I am not thinking of? Worst case, I could provide buttons for next and previous, but this is a mobile app, so I really shouldn't have to resort to that.
Thanks!

Related

Flutter: Partially overlapping buttons that can switch overlapping on tap

I am trying to create a layout of two elevated buttons as below screen shots. One button is partially overlapping other button on the right side. When button on the right is tapped then it will partially overlap the button on left.
I can do it using stack but that will require a lot playing around with the positions.
I am wondering if someone could point me to the right direction on how to achieve this layout.
Regards,
Jamal

adding business logic to swiping with PageView or alike

how can I add conditions, popups etc to swiping?
I have a screen with 2 swiping areas (top and bottom) and a narrow middle input area. Now I want to implement some logic to the bottom swiping area. If the user starts swiping, the interface shall stop further swiping and show a countdown instead, after which swiping is possible (and similar interactions).
Not sure, if this is possible (with a reasonable effort), however, currently I am not even having an idea how to tackle this. And I haven't found anything close here on stackoverflow except onPageChanged which does not work for my case (I guess). The tricky part, I guess, is that one should first see a brief swiping movement before popups etc are shown.
I guess, this not relevant for the solution, but I am generally using BloC for business logic.
Anyone with a solution or a path what to dive into?

For Flutter Mobile, How to Push a New Route by a Drag/Swipe Gesture While Controlling the Position of the Routes (Like Swipe to Pop in iOS)

As most of you already know, Flutter offers a Cupertino navigation transition that represents the native iOS behavior when navigating to previous route. You can start swiping from the left edge of the device and a navigation animation is started. Unless the user ends touching to the screen, the user is in control of the position of the current (above) and the previous (below) routes.
According to the release position and velocity, whether the screen will be popped or not and the animation controller takes the rest of the job.
I want to implement exactly opposite of this. When the user starts swiping from the right edge of the screen to the left, the gesture will be detected. The new route will be created and be positioned on the right. User can drag the new route to the left (into the scene). After the release of the touch, it will be decided to whether center the new route (complete) or let it go away (cancel).
This behavior can be observed inside Safari browser, for example. You can navigate backwards by start swiping from the left edge. Moreover, you can navigate forward by starting to swipe from the right end of the screen.
Also, it is possible to experience a similar UI/UX behavior in TikTok app. When watching a video on the “For You” screen (that’s the default home page of the TikTok), the user can start dragging the screen from right to left and when the gesture detected, the profile screen of the current content’s owner will be shown. As mentioned above, the user will be in control of the position by dragging. When the user ends touching it will complete or cancel the navigation based on the situation.
Question is:
I am a power user of Flutter since the very early beta days of it. I made quite complex UX implementations till today. However, this type of a navigation need haven’t been an issue and didn’t come to my mind.
I did a deep research on the Flutter source code, internet, Flutter issues, pub.dev, etc. Yet, I couldn’t find a logically easy solution.
Does anybody know how to do that? Indeed we can use the CupertinoPageRoute and extend upon it but my mind just stopped at the moment.
Side note: The end result could be like a parallax effect or like a PageView.

Continuously scrolling UI Unity

So I am working working on something in unity (2d game). I have a list of button (UI) on my scene and I want to implement a scrolling mechanism. What is the best way to go about it? Currently , I can scroll through horizontally because I have added a "scroll rect" to the the canvas holding the buttons as I start the game. However when I try to scroll back (horizontally, it goes beyond the Buttons. Is there a way to make the scrolling continuous such that as I scroll, from the first UI element when I get to the last one and I keep scrolling, it continues with the first element. or what should I do. please let me Know If i should clarify.
In the Scroll rect you can set the movement type. I don't think the kind of "infinite scroll" you are asking for is available.
For your case, I think that the Use Elastic or Clamped mode to force the content to remain within the bounds of the Scroll Rect should do the work.
In the case of the infinite scroll specifically needed, you would need to ask for that explicitely and show your attempt for more specific help.

Animate card widget on button click Tinder like swipe

Hello all I am building Tinder like swipe in Flutter. So far so good I have made the stack of cards together with the gesture detector when the user swipes left/right. However my issue come when I try to animate on click of a button. Under the stack of cards there are 2 buttons which you can like or dislike on button click. I would like to get an advice how I can approach the animation when the user clicks on either button. Below is my code for displaying the stack. Best wishes
There are several options to animate the card off screen. Since you're already using a Stack, AnimatedPosition is probably the best option.
You could also use Transform.translate to set the transform property of an AnimatedContainer. Or, if you want more control over the animation you could use a SlideTransition.
For a good overview of how to decide which animations you need, see this video from two days ago: https://www.youtube.com/watch?v=GXIJJkq_H8g
There's also https://pub.dev/packages/animations for more pre-packed options.