public class ShowHideOnScroll extends ScrollDetector implements android.view.animation.Animation.AnimationListener
View.OnTouchListener
which shows/hides specified view
when onScrollUp()
and onScrollDown()
events recognized.Constructor and Description |
---|
ShowHideOnScroll(android.view.View view)
Construct object with defaults animations
R.anim#floating_action_button_show and R.anim#floating_action_button_hide . |
ShowHideOnScroll(android.view.View view,
int animShow,
int animHide)
Construct object with custom animations.
|
Modifier and Type | Method and Description |
---|---|
void |
onAnimationEnd(android.view.animation.Animation animation) |
void |
onAnimationRepeat(android.view.animation.Animation animation) |
void |
onAnimationStart(android.view.animation.Animation animation) |
void |
onScrollDown()
Called when
ScrollDetector.onScroll(MotionEvent, MotionEvent, float, float) recognize direction of user gesture as DOWN. |
void |
onScrollUp()
Called when
ScrollDetector.onScroll(MotionEvent, MotionEvent, float, float) recognize direction of user gesture as UP. |
onDown, onScroll, onTouch, setIgnore
public ShowHideOnScroll(android.view.View view)
R.anim#floating_action_button_show
and R.anim#floating_action_button_hide
.view
- null not allowedpublic ShowHideOnScroll(android.view.View view, int animShow, int animHide)
view
- null not allowedanimShow
- anim resource idanimHide
- anim resource idpublic void onScrollDown()
ScrollDetector
ScrollDetector.onScroll(MotionEvent, MotionEvent, float, float)
recognize direction of user gesture as DOWN.onScrollDown
in class ScrollDetector
public void onScrollUp()
ScrollDetector
ScrollDetector.onScroll(MotionEvent, MotionEvent, float, float)
recognize direction of user gesture as UP.onScrollUp
in class ScrollDetector
public void onAnimationStart(android.view.animation.Animation animation)
onAnimationStart
in interface android.view.animation.Animation.AnimationListener
public void onAnimationEnd(android.view.animation.Animation animation)
onAnimationEnd
in interface android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(android.view.animation.Animation animation)
onAnimationRepeat
in interface android.view.animation.Animation.AnimationListener