move screen from finger in android just like a slider please give me a example .
thanks
Ashish
This is called fling for what you are looking for.
Answer is already given in stack over flow Here is the link.
Programmatically Fling ListView Android
Related
I am developing an app and I would appreciate to get some input and your 2cents about this scenario:
I want to have 5 buttons in a circle and 1 button in the middle.
The buttons in the circle shall be able to be moved to the middle button and there are two scenarios:
if the button touches the middle button --> switch screen
if the button does not touch the middle button and you stop moving --> it should be moved back to the original place (gravity)
Is it optimal to solve this scenario with buttons or would you prefer any other item?
Thanks a lot!
Developing this will take a lot of time and effort. I don't know if this can be done using simple buttons or you need custom elements but I can help you get started. Try looking into the Facebook chat heads behaviour. I think the behavior of chat heads when removing them (with the X circle in middle bottom where you drag chat heads to remove) is similar to what you are trying to achieve.
Here is some useful information you can go through and maybe you find what you're looking for.
What APIs in Android is Facebook using to create Chat Heads?
https://github.com/henrychuangtw/Android-ChatHead
https://github.com/marshallino16/Demo-FloatingView
Note: I am still going through all the information in these links because it looks like it might be helpful for you. You also go through the links and we can further discuss in the comments and later edit the answer when we have a solution
While going through a IOS app in my company, I saw the buttons set in a horizontal scroll view in a animated manner which looked really good. When asked the IOS developers they said it is a pre built in function available in xcode. I want to know whether it can be achieved in Android.
Details regarding the scroll view.
There are buttons when scrolled over revolves around. To be more precise it moves in the anti-clockwise direction but doesn't disappear from view.
Thanks in advance for the help.
May be this is what you want or it may help you
http://www.codeproject.com/KB/android/androcarousel.aspx
If my understanding is correct about your question, We have HorizontalScrollView to achieve that in android. You have to do your own animation while scroll. There is no in build animations while scrolling.
Please go through the following link.
my question is not only about onTouch events but about every method I can use to recognise a touch on certain areas of the screen.
Right now, I have a "background" image, which I use as layout that contains 2 "buttons": Start and Options as you can see here:
Ok, what I want to know is which is the best way to identify when are the user touching each button. By the way, should be nice also some info about how to deal with the different screen sizes.
Lots of thanks.
PD: seems I didnt explain it well. they are not "Android buttons" theirselves. The background is a whole image, where you can find 2 "buttons", but they are a part of the image. Thats because I need to know how to do this
I think you're missing some fundamentals, so I recommend to take a tutorial track.
As a direct answer to your question , you can see this page from the tutorial.
Why do you want to set the touchListener on whole screen and find the buttons?..You can simply set the OnClickListener or onTouchListener on both the buttons itself..
i have 4 activities in which i have to swipe them right, left and if i am in last activity and swipe to the left then again first activity should be shown.
can anybody have any idea how i can achieve this? or some sample code?
thanks a lot.
you can achieve it by animaton..
But it will show as a Gallery view and you can swipe as well...
OnTouchEvent on every activity you can call another activity using intents by
overridePendingTransition(R.anim.act_back_slide_enter, R.anim.act_back_slide_leave);
//overridePendingTransition("animation for activity which enters", "animation for activity which leaves");
I have not yet tried this... but we can make it in this form.. If you get success let me know.
#sajjoo Here goes your answer in deezapps widget with the questions below pointing at it
How to show multiple screens with right/left slide Gesture
How to create a slider screen (As in Tweetdeck) in Android?
and many more linked questions..
I recently posted a question that covers a lot of this (my question is about using Swipe together with ScrollView, the Swipe gesture by itself works just fine):
Swipe/Fling tab-changing in conjunction with ScrollView?
If you read the sources I have listed and use the code I've provided then you should be able to do it.
It's work fine... just must to delete the redundant R.java file...!
http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/
Hi i was wondering if android has view that responds to user slides.
If you want to know exactly what i mean there is one in the galaxy tab for unlocking the phone and muting/activating sound on the bottom of the screen.
Seems like the iPhone slide to unlock feature.
Thanks in advance I appreciate the help!
GestureOverlayView might help you.
See also:
http://developer.android.com/design/patterns/gestures.html
http://www.vogella.com/tutorials/AndroidGestures/article.html
All the views can respond to "user slides". In Android, this is a gesture called fling or swipe. You can see this tutorial for a sample implementation.
Basically:
implement onFling of SimpleOnGestureListener in your own class
call your gesture listener from the onTouch method of the view