public interface SwipeBackTransformer
SwipeBackTransformer is responsible to manipulate the
swipe back view according to its current state (opening or closing)
#onSwiping(com.hannesdorfmann.swipeback.SwipeBack, float, int, int) with some nice animations.
Also onSwipeBackCompleted(com.hannesdorfmann.swipeback.SwipeBack, android.app.Activity) will be called
after the swipe back has been completed to let you finish the activity by setting your own animation transition.
Created by Hannes Dorfmann on 03.01.14.| Modifier and Type | Method and Description |
|---|---|
void |
onSwipeBackCompleted(SwipeBack swipeBack,
android.app.Activity activity)
This method is called after the swipe back has completed.
|
void |
onSwipeBackReseted(SwipeBack swipeBack,
android.app.Activity activity)
This method is called if the swipe back has been canceled / reseted.
|
void |
onSwipeBackViewCreated(SwipeBack swipeBack,
android.app.Activity activity,
android.view.View swipeBackView)
This is called if the swipe back view has been created.
|
void |
onSwiping(SwipeBack swipeBack,
float openRatio,
int pixelOffset)
Called while the swipe back view is opening or closing.
|
void onSwipeBackViewCreated(SwipeBack swipeBack, android.app.Activity activity, android.view.View swipeBackView)
View.findViewById(int) etc.swipeBack - The reference to the SwipeBack objectactivity - Tha activity the swipe back is attached toswipeBackView - The view that has been inflated as swipe back viewvoid onSwipeBackCompleted(SwipeBack swipeBack, android.app.Activity activity)
Activity.finish() and you may set the
activity animations by using
Activity.overridePendingTransition(int, int). You
should use Activity.finish() and not
Activity.onBackPressed(), because onBackPressed()
may cause a IllegalStateException if the user rotates the device
(screen rotation from landscape to portrait or vice versa), while the
SwipeBackView is fully open, but the user has not released yet the finger
(finger is still on the screen).swipeBack - The reference to the SwipeBack objectactivity - void onSwipeBackReseted(SwipeBack swipeBack, android.app.Activity activity)
#onSwipeBackCompleted(android.app.Activity).swipeBack - The reference to the SwipeBack objectactivity - Tha activity the swipe back is attached tovoid onSwiping(SwipeBack swipeBack, float openRatio, int pixelOffset)
swipeBack - The reference to the SwipeBack objectopenRatio - a value between 0 and 1 that indicates how much open (visible) the swiping view ispixelOffset - The number of pixels visible of the swipe back view