Android Image fade button

I want to implement fade-out / float buttons, similar to MediaController's play / pause buttons, if the screen does not touch "n" sec. Is it possible to implement this on my custom image button?

+3
source share
1 answer

Yes,

You can do this .... Use a timer, say, for 20 seconds .... after 20 seconds, use the animation to fade the buttons and if the user touches the screen for 20 seconds, reset the timer again.

It is very simple ... u need to know how to use timer and animation

these links can help you ...

http://developer.android.com/reference/android/view/animation/AlphaAnimation.html http://www.hascode.com/2010/09/playing-around-with-the-android-animation-framework/ http://www.barebonescoder.com/2010/06/android-development-more-animations-part-1/

+2

Source: https://habr.com/ru/post/1773823/


All Articles