public class HideViewOnScrollAnimation
extends RecyclerView.OnScrollListener
| Modifier and Type | Class and Description |
|---|---|
static class |
HideViewOnScrollAnimation.Direction
Contains all possible directions, which can be used to translate the animated view in order
hide it.
|
| Constructor and Description |
|---|
HideViewOnScrollAnimation(android.view.View view,
HideViewOnScrollAnimation.Direction direction)
Creates a new scroll listener, which allows to animate a view to become hidden or shown
depending on the observed list view's scrolling direction.
|
HideViewOnScrollAnimation(android.view.View view,
HideViewOnScrollAnimation.Direction direction,
long animationDuration)
Creates a new scroll listener, which allows to animate a view to become hidden or shown
depending on the observed list view's scrolling direction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(HideViewOnScrollAnimationListener listener)
Adds a new listener, which should be notified about the animation's internal state, to the
animation.
|
long |
getAnimationDuration()
Returns the duration of the animation, which is used to show or hide the view.
|
HideViewOnScrollAnimation.Direction |
getDirection()
Returns the direction, which should be be used to translate the view in order to hide it.
|
android.view.View |
getView()
Returns the view, which is animated by the listener.
|
void |
hideView()
Hides the view.
|
void |
onScrolled(RecyclerView recyclerView,
int dx,
int dy) |
void |
removeListener(HideViewOnScrollAnimationListener listener)
Removes a specific listener, which should not be notified about the animation's internal
state, from the animation.
|
void |
showView()
Shows the view.
|
public HideViewOnScrollAnimation(android.view.View view,
HideViewOnScrollAnimation.Direction direction)
view - The view, which should be animated by the listener, as an instance of the class
View. The view may not be nulldirection - The direction, which should be be used to translate the view in order to hide it, as
a value of the enum HideViewOnScrollAnimation.Direction. The direction may either be UP or
DOWNpublic HideViewOnScrollAnimation(android.view.View view,
HideViewOnScrollAnimation.Direction direction,
long animationDuration)
view - The view, which should be animated by the listener, as an instance of the class
View. The view may not be nulldirection - The direction, which should be be used to translate the view in order to hide it, as
a value of the enum HideViewOnScrollAnimation.Direction. The direction may either be UP or
DOWNanimationDuration - The duration of the animation, which is used to show or hide the view, in
milliseconds as a Long value. The duration must be greater than 0public final void showView()
public final void hideView()
public final android.view.View getView()
Viewpublic final HideViewOnScrollAnimation.Direction getDirection()
HideViewOnScrollAnimation.Direction. The direction may either be UP or
DOWNpublic final long getAnimationDuration()
Long valuepublic final void addListener(HideViewOnScrollAnimationListener listener)
listener - The listener, which should be added, as an instance of the type HideViewOnScrollAnimationListener. The listener may not be nullpublic final void removeListener(HideViewOnScrollAnimationListener listener)
listener - The listener, which should be removed, as an instance of the tpye HideViewOnScrollAnimationListener. The listener may not be nullpublic final void onScrolled(RecyclerView recyclerView,
int dx,
int dy)