Transition animation based on continuous user input - android

I am experimenting with Transition animations following the Android Documentation here. I have a small POC where an ImageView and TextView are animated once the user clicks a button, as shown in the recording below.
This is working fine.
However, what I'm struggling to figure out next, is rather than triggering the animation with a click event, I would like the views to respond to continuous user input, such as dragging a Seekbar, and animate accordingly. So basically, if I drag the Seekbar let's say until mid point, then the views would perform only half of the animation and stop.
Any tips where should I look into, in order to achieve that?

Related

Sliding menu: closed, half-opened and opened

in an android application, I need to do the following:
I have a view, that acts like a menu, I can slide it from the bottom-up.
However I want to have 3 states: closed, half-opened and opened.
Please refer to this pic:
The blue section is the Handle, the user will use it to slide up/down or fling...
This is a bit similar to the android 5 notification bar, where you drag down to reveal half the view, then another drag down will reveal the whole view.
I can start implementing it in the onTouch of the blue section but that would require me to handle a lot of cases, especially the ones where the user flings vs slowly drag....
Is there any easier way or library that can help?
Thank you very much

How to create this type of slider to open next screen?

I want to create a slider to move through next and previous screen like below image
I have already implemented swipe feature to the application like if user swipes left or right he/she can move through next and previous screen but how to implement that swiping on particular area of screen and how to have this type of image.
You can use ViewPager for this.
http://developer.android.com/training/animation/screen-slide.html
this is the work of the following things
A background image repeated for the slider background,an image for the lock and unlock,an image for the button selection.
Events you need will be as follows
Touch event on the lock image
Action performed will be a translation of that button to x position of your thumb you can ger the coordinates in the touchevent
ActionDown will be the place you started the press and up will be the place you realeased it.
So that can help building this slider.

Pressing multiple buttons at the same time

I'm working on an app which presents users with four buttons and a timer. The users then tap as fast as they can, each user on his own button, and the one with the most taps at the end wins.
I can't use onClick here, because it locks up the UI thread until the button is released, effectively blocking other button presses. I have searched around for a bit and found that I could use onTouch, but it doesn't work the way I want it to. If a user has touched and is still holding a button, any subsequent touches on other buttons will behave as though this first button was pressed.
Someone suggested the use of an image, transparent and stretched across the entire visible UI. One could then read any touches on this imageview and assign a touch to a particular button based on the coordinates of the press. (I guess I would take a screenshot of my UI with the four buttons visible, open it in paint and write down the coordinates of the borders for each button, then use those coordinates in the code to figure out which button the user was trying to press.)
Can anyone help me with this method of work, give me a quick example, or link to where I can learn how to do it and implement it in my app? It would be much appreciated.
TL;DR: How to use an image, transparent and stretched across the entire visible UI and read the coordinates of each press (even if multiple at once)?

How to make Android share button appear on touch?

I am creating a news app which contains a 'share news' button. Currently this button is showing all the time when user reads the news, which makes news reading irritating. Now my question is how can I make that share button show up when user touch on the screen, and will disappear after 2-3 seconds if it is left without touching. It would be nice if I can make a little animation during the button appearing/disappearing (like, show up from bottom and disappear going down). Please help...
Thanks
add an on touch event on your view and change visibilty of your button visible when touched after that start an timer using handler for three seconds and set visibility gone there after three seconde for handler code check this answer
Running a thread for some seconds

how to create Equalizer Button in Android?

I am new to android i wish to create a button like a Equalizer Button. At the time of track the button i need to do some work.Can any one help me
I think you're looking for the SeekBar. That's a View derived from the ProgressBar, but with a "thumb" so it looks like a slider control. A user can use the thumb to move left or right from min to max. You don't have to use it like a progress bar to track the progress of something, and can receive notifications that the user is touching and moving the thumb using a SeekBar.OnSeekBarChangeListener.

Categories

Resources