Facebook ChatHead Like Fling Animation Android - android

So I am working on a floating view. I have managed to create the complete view, it looks similar to a Facebook chathead.
What I want to do:
I want to add in that fling gesture to my view. For example: I want my view to be in either the right or left edge of the screen, so a user should be able to fling it to either edge of the screen like we can in fb messenger chat head as well.
Could someone please guide me how this can be achieved ?

You can use some of the motion tracking features from Android SDK.
Check this out: https://developer.android.com/training/gestures/movement.html
It's probably the VelocityTracker API that you need.

Related

Android slide out view

I am wondering how to achieve some kind of draggable view. I am not speaking about the navigation drawer!
Several other applications implement this kind of views, for example the new stock Android Lollipop Calculator application. There you can drag out the extended symbols view from the right hand corner.
Another application is Google maps. When checking out a location, it's possible to extend the location information by dragging up the bottom information view.
It appears that there are two points where the view is able to lock in, meaning that when pulling the view up to a specific point and releasing, will result in the drawer not closing entirely but to align to the specific locking points.
How is that achieved or is a library required?
Thanks in advance
The stock calculator app appears to use ViewPager to achieve the slideout numberpad. It's a part of android, no libraries so that would be a good starting point.
Here's the class in question (Rest of the code to the left)

swipe gesture! android in lazy swipe app

the lazy swipe app opens when user swipes from bottom left corner of the screen diagonally. how is this done? how lazy swipe app is only seen as an arc, and not on the whole screen? I want to make an app like that? please tell me how should I start to make that kind of swipe gesture?
I donw know the app, but there are serval ways to do that.
basically you have to override onInterceptTouchEvent() and onTouchEvent() for your View
or
you can override Activity.onTouchEvent() to let the activity intercept all touch events.
Have a look here:
https://developer.android.com/training/gestures/viewgroup.html
Update:
After reviewing LazySwipe: Lazy Swipe is using the same mechanism / android api as Facebook chats heads. It's not an activity. Basically its a Service. Here is a discussion and implementation. There are also libraries on Github (I have never used that one).
But as you see it's not an Activiy, hence you can not use Activity.onTouch(). However, you can display and interact any regular View or ViewGroup. Therefore, overriding ViewGoroup.onInterceptTouchEvent() and ViewGorup.onTouchEvent() is possible. So yes, you can detect Swipe gestures.
There are alredy some gesture detectors build in on Android that you can use. Have a look here: https://developer.android.com/training/gestures/scroll.html

Slide remove view Gmail-like for API 7+

I don't want to reinvent the wheel and this has been obviously already been done by Google in the Gmail app. I want to achieve effect identical to the finger slide message remove from gmail. It's also achieved in notofication bar in (you can remove notification by sliding it left or right)
I was wondering if I could get pointed in the right direction. Maybe this is described somewhere in google developers site.
What's most important I need it for API 7+.
You'll have to implement two different principles:
is the capture all the motion events to translate your view with the finger
use a Gesture Detector to detect the onFling(), check if the fling is in the right direction, and if yes, apply whatever action you need.
Unfortunately I've never implemented such, so I can't show you any code. But hopefully that points you to the right direction.

How to create Gestures in my application?

I have submit button. When I do click or tap below a submit button, it should be able to recognize the gesture by programmatically in android. How could I do this?
Do I need to download anything based on Gestures? Else what should I do for this Gestures?
And, like a Gesture point- If I draw a line using Gesture concept or anything, gesture should perform its actions . After I draw a line, it should be able to open another screen. It must be able to display the last page.
maybe you need this android gestures.
To get information with regard to creating Gesture application at http://androidresearch.wordpress.com/2012/01/10/working-with-gesture-api-in-android/

libgdx android style swipe

How do i implement android style left and right swipe using libgdx? (ex:flipping through imgaes)
I read about GuesterDetector and testcase http://code.google.com/p/libgdx/source/browse/trunk/tests/gdx-tests/src/com/badlogic/gdx/tests/GestureDetectorTest.java?r=2641.
But i am not sure once after guester identfied how to implement android style left and right swipe and also how to distinguish between left and right swipe with in fling method.
Implementing using adroid API is stright forward android Swipe event in listview inside tab widget understood admob example to implement native call backs, but integrating this seems not stright forward in this case.
Either way, Please let me know if some one experience with that.
From that example, you are wanting to use the fling method. To detect horizontal direction, check the velocityX -- positive means a swipe to the right (and you'll want to scroll your images to the left).

Categories

Resources