public abstract class BaseTransformer extends Object implements ViewPagerEx.PageTransformer
ViewPagerEx.PageTransformer
which is just same as ViewPager.PageTransformer.
After you call setPageTransformer(), transformPage() will be called by ViewPagerEx
when your slider are animating.
In onPreTransform() function, that will make BaseAnimationInterface
work.
if you want to make an acceptable transformer, please do not forget to extend from this class.| 构造器和说明 |
|---|
BaseTransformer() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
hideOffscreenPages()
If the position offset of a fragment is less than negative one or greater than one, returning true will set the
visibility of the fragment to
View.GONE. |
protected boolean |
isPagingEnabled()
Indicates if the default animations of the view pager should be used.
|
protected void |
onPostTransform(View view,
float position)
Called each
transformPage(View, float) call after onTransform(View, float) is finished. |
protected void |
onPreTransform(View view,
float position)
Called each
transformPage(View, float) before {onTransform(View, float) is called. |
protected abstract void |
onTransform(View view,
float position)
Called each
transformPage(View, float). |
void |
setCustomAnimationInterface(BaseAnimationInterface animationInterface) |
void |
transformPage(View view,
float position)
Apply a property transformation to the given page.
|
protected abstract void onTransform(View view, float position)
transformPage(View, float).view - position - public void transformPage(View view, float position)
ViewPagerEx.PageTransformertransformPage 在接口中 ViewPagerEx.PageTransformerview - Apply the transformation to this pageposition - Position of page relative to the current front-and-center
position of the pager. 0 is front and center. 1 is one full
page position to the right, and -1 is one page position to the left.protected boolean hideOffscreenPages()
View.GONE. Returning false will force the fragment to View.VISIBLE.protected boolean isPagingEnabled()
protected void onPreTransform(View view, float position)
transformPage(View, float) before {onTransform(View, float) is called.view - position - protected void onPostTransform(View view, float position)
transformPage(View, float) call after onTransform(View, float) is finished.view - position - public void setCustomAnimationInterface(BaseAnimationInterface animationInterface)