Android - swipe to flip card - android

I want to flip a card view (show the different layout for front/back) using a swipe gesture (swiping from left to right).
Is there a way to achieve this? All examples that I managed to find are using click functionality (on a button, view that is being flipped, etc.) but not a swipe.

Related

ViewPager2 without using Viewpager2

I want to create my own version of ViewPager2 so that I can control the animation design and orientation capabilities. Basically, I'm trying to have a scrolling up and down load new users while left and right would be more information about that user.
I tried using custom animations with swipe gestures, which works exactly as I wanted, except I don't get the control of dynamically animating the swiping direction. Essentially, it still works like a button animation - you might swipe in the direction you want but the animation speed/feel/etc is always the same animation vs. ViewPager2's ability to move with the gesture.
I experimented with OnDragListeners which do give me the "Tinder card movement" animation effect but I don't want to allow for animations in all directions. I was able to use a ViewPager2 for the horizontal direction while using the OnDragListener to override the swiping (using OnLongClick). When you drag up or down it has the same issue of the transition animation being the same speed/feel/etc everytime instead of the nice ViewPager2 slide on touch effect.
I only need 4 fragments for each user so my next idea was to try a horizontalscrollview in a recyclerview but that's working either.
Any suggestions for an approach I might not have considered?

Ignore Button Existence When Swiping On Android ViewPager?

I was wondering if there's a way to ignore buttons on the view pager when swiping. For instance, I have a panel of buttons located at the bottom of the screen and the users may swipe left or right to display more of the buttons available. The problem I'm having is that the margins between the buttons a relatively small compared to the buttons themselves so more often than not I'm on a button when swiping, which the viewpager does not respond to so I have to go back and try and get inbetween the buttons with my finger and then swipe. Is there a way to prevent this from happening?

Android - swipe in/out view from/to the right screen edge

I'd like to implement a view that when invisible, slides in when swiping from the right (from outside of the screen). When visible, slides back out to the right when swiping to the right from outside that view.
So I guess this is called a swipe gesture while showing the slide animation as the swipe is still being done. I want it to be fluent, which means that if the swipe gesture is only part made, the view will only part slide, meaning the view follows the gesture.
I'm thinking of something very similar to Amazon's Cloud Drive months view. See screenshot below.
Any idea how to do this? An Example code? 3rd party library?
I tried to search for this. Found how to do the animation: here and here. Found how to recognize the gestures: here and here. Found even the combination of both but not when swiping from the edge of the screen to open nor when swiping from outside of the view to close.
Here are the things I investigated that didn't do the job and why:
SlidingMenu - Slides from the edge and from outside of the view but animates the main window and not just the side view. Also, it's very complicated and hard to get only the required behavior of sliding from/to the edge.
Roman Nurik's Android-SwipeToDismiss - Doesn't recognize swiping from outside of the view nor from the edge of the screen.
Wunderlists - Doesn't recognize swiping from outside of the view nor from the edge of the screen.

Swiping to make ImageButton disappear / appear

I've a menu in Android app with several ImageButton (all grouped in a RelativeLayout) and I would like to make it disappear when swiping with finger towards the outside of the screen.
Swiping with finger towards the inside of the screen, instead, the menu should re-appear.
Any suggestion to do this ?
Try writing a gesture detection as given here Fling gesture detection on grid layout and in that code instead of toast write your code.

Android swipe transition

I'm trying to implement an Android swipe transition on an image within my layout so the user can get some feedback while they are selecting the image.
So, the user would ideally place their finger on the image, and drag it right, and have the image track it until the user has sufficiently dragged it far enough right, just like it is shown here (from the Android dropdown menu in the second item):
http://farm8.staticflickr.com/7301/8716433318_d58aaaa567.jpg
Thanks!
This should be easily implemented with a ViewPager

Categories

Resources