public class ViewsTransitionAnimator<ID> extends ViewsCoordinator<ID>
ViewsCoordinator that allows requesting enter(Object, boolean) or
exit(boolean) animations, keeps track of ViewPositionAnimator.PositionUpdateListener
listeners and provides correct implementation of isLeaving().
Usage of this class should be similar to ViewPositionAnimator class.ViewsCoordinator.OnRequestViewListener<ID>, ViewsCoordinator.OnViewsReadyListener<ID>| Constructor and Description |
|---|
ViewsTransitionAnimator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPositionUpdateListener(ViewPositionAnimator.PositionUpdateListener listener)
Adds listener to the set of position updates listeners that will be notified during
any position changes.
|
void |
enter(ID id,
boolean withAnimation)
Requests 'from' and 'to' views for given id
(see
OnRequestViewListener#onRequestView(Object)),
and starts enter animation when both views are ready. |
void |
exit(boolean withAnimation)
Plays exit animation, should only be called after corresponding call to
enter(Object, boolean). |
boolean |
isLeaving() |
protected void |
onViewsReady(ID id)
Called when both 'from' and 'to' views are ready for given index.
|
void |
removePositionUpdateListener(ViewPositionAnimator.PositionUpdateListener listener)
Removes listener added by
addPositionUpdateListener(ViewPositionAnimator.PositionUpdateListener). |
void |
setFromPos(ID id,
ViewPosition fromPos) |
void |
setFromView(ID id,
android.view.View fromView) |
void |
setToView(ID id,
AnimatorView toView) |
cleanupRequest, getFromPos, getFromView, getToView, request, setFromListener, setReadyListener, setToListenerpublic void enter(ID id, boolean withAnimation)
OnRequestViewListener#onRequestView(Object)),
and starts enter animation when both views are ready.public void exit(boolean withAnimation)
enter(Object, boolean).isLeaving()public boolean isLeaving()
public void setFromView(ID id, android.view.View fromView)
setFromView in class ViewsCoordinator<ID>public void setFromPos(ID id, ViewPosition fromPos)
setFromPos in class ViewsCoordinator<ID>public void setToView(ID id, AnimatorView toView)
setToView in class ViewsCoordinator<ID>protected void onViewsReady(ID id)
ViewsCoordinatoronViewsReady in class ViewsCoordinator<ID>ViewsCoordinator.getFromView(),
ViewsCoordinator.getFromPos(),
ViewsCoordinator.getToView()public void addPositionUpdateListener(ViewPositionAnimator.PositionUpdateListener listener)
public void removePositionUpdateListener(ViewPositionAnimator.PositionUpdateListener listener)
addPositionUpdateListener(ViewPositionAnimator.PositionUpdateListener).