本文整理汇总了Java中android.support.v4.view.ViewPager.PageTransformer方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPager.PageTransformer方法的具体用法?Java ViewPager.PageTransformer怎么用?Java ViewPager.PageTransformer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewPager
的用法示例。
在下文中一共展示了ViewPager.PageTransformer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
@Override
public void setPageTransformer(final boolean reverseDrawingOrder, final ViewPager.PageTransformer transformer) {
super.setPageTransformer(
false, mInfiniteCycleManager == null ?
transformer : mInfiniteCycleManager.getInfinityCyclePageTransformer()
);
}
示例2: setPageTransfromer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
/**
* 设置切换动画
* 如果不设置动画,设置为null
*
* @param transformer
*/
public AdPlayBanner setPageTransfromer(ViewPager.PageTransformer transformer) {
if (mScrollerPager != null) {
mScrollerPager.setPageTransformer(true, transformer);
} else {
mScrollerPager.mTransformer = transformer;
}
return this;
}
示例3: AlphaPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public AlphaPageTransformer(ViewPager.PageTransformer pageTransformer) {
this(DEFAULT_MIN_ALPHA, pageTransformer);
}
示例4: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
/**
* 设置自定义页面切换动画
*
* @param transformer
*/
public void setPageTransformer(ViewPager.PageTransformer transformer) {
if (transformer != null && mViewPager != null) {
mViewPager.setPageTransformer(true, transformer);
}
}
示例5: ScaleInTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public ScaleInTransformer(float minScale, ViewPager.PageTransformer pageTransformer){
mMinScale = minScale;
mPageTransformer = pageTransformer;
}
示例6: TransformerItem
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public TransformerItem(Class<? extends ViewPager.PageTransformer> clazz) {
this.clazz = clazz;
title = clazz.getSimpleName();
}
示例7: getClazz
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public Class<? extends ViewPager.PageTransformer> getClazz() {
return clazz;
}
示例8: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
@Override
public void setPageTransformer(boolean reverseDrawingOrder, ViewPager.PageTransformer transformer) {
/**
继承ViewPager,重写setPageTransformer方法,移除版本限制,通过反射设置参数和方法
getDeclaredMethod*()获取的是【类自身】声明的所有方法,包含public、protected和private方法。
getMethod*()获取的是类的所有共有方法,这就包括自身的所有【public方法】,和从基类继承的、从接口实现的所有【public方法】。
getDeclaredField获取的是【类自身】声明的所有字段,包含public、protected和private字段。
getField获取的是类的所有共有字段,这就包括自身的所有【public字段】,和从基类继承的、从接口实现的所有【public字段】。
*/
Class viewpagerClass = ViewPager.class;
try {
boolean hasTransformer = transformer != null;
Field pageTransformerField = viewpagerClass.getDeclaredField("mPageTransformer");
pageTransformerField.setAccessible(true);
PageTransformer mPageTransformer = (PageTransformer) pageTransformerField.get(this);
boolean needsPopulate = hasTransformer != (mPageTransformer != null);
pageTransformerField.set(this, transformer);
Method setChildrenDrawingOrderEnabledCompatMethod = viewpagerClass.getDeclaredMethod("setChildrenDrawingOrderEnabledCompat", boolean.class);
setChildrenDrawingOrderEnabledCompatMethod.setAccessible(true);
setChildrenDrawingOrderEnabledCompatMethod.invoke(this, hasTransformer);
Field drawingOrderField = viewpagerClass.getDeclaredField("mDrawingOrder");
drawingOrderField.setAccessible(true);
if (hasTransformer) {
drawingOrderField.setInt(this, reverseDrawingOrder ? 2 : 1);
} else {
drawingOrderField.setInt(this, 0);
}
if (needsPopulate) {
Method populateMethod = viewpagerClass.getDeclaredMethod("populate");
populateMethod.setAccessible(true);
populateMethod.invoke(this);
}
} catch (Exception e) {
}
}
示例9: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public BannerViewPager setPageTransformer(ViewPager.PageTransformer pageTransformer) {
mPageTransformer = pageTransformer;
mViewPager.setPageTransformer(true, mPageTransformer);
return this;
}
示例10: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public void setPageTransformer(boolean reverseDrawingOrder, @Nullable ViewPager.PageTransformer transformer) {
vpCarousel.setPageTransformer(reverseDrawingOrder, transformer);
}
示例11: setAnimation
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public ImageLooper setAnimation(ViewPager.PageTransformer pageTransformer) {
if (viewPager != null)
viewPager.setPageTransformer(true, pageTransformer);
return this;
}
示例12: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
public void setPageTransformer(boolean reverseDrawingOrder, ViewPager.PageTransformer transformer) {
viewPager.setPageTransformer(reverseDrawingOrder, transformer);
}
示例13: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
/**
* 设置页面切换动画
*
* @param transformer
* @return
*/
public ADViewPager setPageTransformer(ViewPager.PageTransformer transformer) {
this.pageTransformer = transformer;
return this;
}
示例14: create
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
/**
* 完成创建
* @return
*/
public ViewPager.PageTransformer create() {
return new CardPageTransformer(this);
}
示例15: setPageTransformer
import android.support.v4.view.ViewPager; //导入方法依赖的package包/类
/**
* 设置页面切换动画
*
* @param transformer
* @return
*/
public OvSlideViewpager setPageTransformer(ViewPager.PageTransformer transformer) {
this.pageTransformer = transformer;
return this;
}