本文整理汇总了Java中com.daimajia.slider.library.Tricks.ViewPagerEx类的典型用法代码示例。如果您正苦于以下问题:Java ViewPagerEx类的具体用法?Java ViewPagerEx怎么用?Java ViewPagerEx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewPagerEx类属于com.daimajia.slider.library.Tricks包,在下文中一共展示了ViewPagerEx类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSliderTransformDuration
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
/**
* set the duration between two slider changes.
* @param period
* @param interpolator
*/
public void setSliderTransformDuration(int period,Interpolator interpolator){
try{
Field mScroller = ViewPagerEx.class.getDeclaredField("mScroller");
mScroller.setAccessible(true);
FixedSpeedScroller scroller = new FixedSpeedScroller(mViewPager.getContext(),interpolator, period);
mScroller.set(mViewPager,scroller);
}catch (Exception e){
}
}
示例2: setViewPager
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
/**
* bind indicator with viewpagerEx.
* @param pager
*/
public void setViewPager(ViewPagerEx pager){
if(pager.getAdapter() == null){
throw new IllegalStateException("Viewpager does not have adapter instance");
}
mPager = pager;
mPager.addOnPageChangeListener(this);
((InfinitePagerAdapter)mPager.getAdapter()).getRealAdapter().registerDataSetObserver(dataChangeObserver);
}
示例3: setViewPager
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
/**
* bind indicator with viewpagerEx.
* @param pager
*/
public void setViewPager(ViewPagerEx pager){
if(pager.getAdapter() == null){
throw new IllegalStateException("Viewpager does not have adapter instance");
}
mPager = pager;
mPager.setOnPageChangeListener(this);
((InfinitePagerAdapter)mPager.getAdapter()).getRealAdapter().registerDataSetObserver(dataChangeObserver);
}
示例4: addOnPageChangeListener
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
public void addOnPageChangeListener(ViewPagerEx.OnPageChangeListener onPageChangeListener){
if(onPageChangeListener != null){
mViewPager.addOnPageChangeListener(onPageChangeListener);
}
}
示例5: removeOnPageChangeListener
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
public void removeOnPageChangeListener(ViewPagerEx.OnPageChangeListener onPageChangeListener) {
mViewPager.removeOnPageChangeListener(onPageChangeListener);
}
示例6: setTranslation
import com.daimajia.slider.library.Tricks.ViewPagerEx; //导入依赖的package包/类
private void setTranslation(View view) {
ViewPagerEx viewPager = (ViewPagerEx) view.getParent();
int scroll = viewPager.getScrollX() - view.getLeft();
ViewHelper.setTranslationX(view,scroll);
}