android.support.v4.view.ViewPager.PageTransformer Java Examples

The following examples show how to use android.support.v4.view.ViewPager.PageTransformer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ViewPagerCompat.java    From android-project-wo2b with Apache License 2.0 6 votes vote down vote up
/**
 * Set a {@link PageTransformer} that will be called for each attached page whenever
 * the scroll position is changed. This allows the application to apply custom property
 * transformations to each page, overriding the default sliding look and feel.
 *
 * <p><em>Note:</em> Prior to Android 3.0 the property animation APIs did not exist.
 * As a result, setting a PageTransformer prior to Android 3.0 (API 11) will have no effect.</p>
 *
 * @param reverseDrawingOrder true if the supplied PageTransformer requires page views
 *                            to be drawn from last to first instead of first to last.
 * @param transformer PageTransformer that will modify each page's animation properties
 */
// Compat Here...
public void setPageTransformer(boolean reverseDrawingOrder, PageTransformer transformer) {
    /*if (Build.VERSION.SDK_INT >= 11) */{
        final boolean hasTransformer = transformer != null;
        final boolean needsPopulate = hasTransformer != (mPageTransformer != null);
        mPageTransformer = transformer;
        setChildrenDrawingOrderEnabledCompat(hasTransformer);
        if (hasTransformer) {
            mDrawingOrder = reverseDrawingOrder ? DRAW_ORDER_REVERSE : DRAW_ORDER_FORWARD;
        } else {
            mDrawingOrder = DRAW_ORDER_DEFAULT;
        }
        if (needsPopulate) populate();
    }
}
 
Example #2
Source File: ViewPagerCompat.java    From android-auto-scroll-viewpager with Apache License 2.0 6 votes vote down vote up
/**
 * Set a {@link PageTransformer} that will be called for each attached page whenever
 * the scroll position is changed. This allows the application to apply custom property
 * transformations to each page, overriding the default sliding look and feel.
 *
 * <p><em>Note:</em> Prior to Android 3.0 the property animation APIs did not exist.
 * As a result, setting a PageTransformer prior to Android 3.0 (API 11) will have no effect.</p>
 *
 * @param reverseDrawingOrder true if the supplied PageTransformer requires page views
 *                            to be drawn from last to first instead of first to last.
 * @param transformer PageTransformer that will modify each page's animation properties
 */
// Compat Here...
public void setPageTransformer(boolean reverseDrawingOrder, PageTransformer transformer) {
    /*if (Build.VERSION.SDK_INT >= 11) */{
        final boolean hasTransformer = transformer != null;
        final boolean needsPopulate = hasTransformer != (mPageTransformer != null);
        mPageTransformer = transformer;
        setChildrenDrawingOrderEnabledCompat(hasTransformer);
        if (hasTransformer) {
            mDrawingOrder = reverseDrawingOrder ? DRAW_ORDER_REVERSE : DRAW_ORDER_FORWARD;
        } else {
            mDrawingOrder = DRAW_ORDER_DEFAULT;
        }
        if (needsPopulate) populate();
    }
}
 
Example #3
Source File: VerticalViewPager.java    From ankihelper with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Set a {@link ViewPager.PageTransformer} that will be called for each attached page whenever
 * the scroll position is changed. This allows the application to apply custom property
 * transformations to each page, overriding the default sliding look and feel.
 * <p/>
 * <p><em>Note:</em> Prior to Android 3.0 the property animation APIs did not exist.
 * As a result, setting a PageTransformer prior to Android 3.0 (API 11) will have no
 * effect.</p>
 *
 * @param reverseDrawingOrder true if the supplied PageTransformer requires page views
 *                            to be drawn from last to first instead of first to last.
 * @param transformer         PageTransformer that will modify each page's animation properties
 */
public void setPageTransformer(boolean reverseDrawingOrder, PageTransformer transformer) {
    if (Build.VERSION.SDK_INT >= 11) {
        final boolean hasTransformer = transformer != null;
        final boolean needsPopulate = hasTransformer != (mPageTransformer != null);
        mPageTransformer = transformer;
        setChildrenDrawingOrderEnabledCompat(hasTransformer);
        if (hasTransformer) {
            mDrawingOrder = reverseDrawingOrder ? DRAW_ORDER_REVERSE : DRAW_ORDER_FORWARD;
        } else {
            mDrawingOrder = DRAW_ORDER_DEFAULT;
        }
        if (needsPopulate) populate();
    }
}
 
Example #4
Source File: FlashView.java    From Social with Apache License 2.0 4 votes vote down vote up
/**
 * 设置切换效果
 * @param b
 * @param rotateTransformer
 */
public void setPageTransformer(boolean b, PageTransformer rotateTransformer)
{
 // TODO Auto-generated method stub
 mViewPager.setPageTransformer(b, rotateTransformer);
}
 
Example #5
Source File: FlashView.java    From Social with Apache License 2.0 4 votes vote down vote up
/**
 * 设置切换效果
 * @param b
 * @param rotateTransformer
 */
public void setPageTransformer(boolean b, PageTransformer rotateTransformer)
{
    // TODO Auto-generated method stub
    mViewPager.setPageTransformer(b, rotateTransformer);
}
 
Example #6
Source File: MainActivity.java    From android-viewpager-transformers with Apache License 2.0 4 votes vote down vote up
public TransformerItem(Class<? extends PageTransformer> clazz) {
    this.clazz = clazz;
    title = clazz.getSimpleName();
}
 
Example #7
Source File: ViewPagerTransformerActivity.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public TransformerItem(Class<? extends PageTransformer> clazz) {
    this.clazz = clazz;
    title = clazz.getSimpleName();
}
 
Example #8
Source File: ViewPagerTransformerActivity.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
public TransformerItem(Class<? extends PageTransformer> clazz) {
    this.clazz = clazz;
    title = clazz.getSimpleName();
}
 
Example #9
Source File: ConvenientBanner.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * 自定义翻页动画效果
 *
 * @param transformer
 * @return
 */
public ConvenientBanner setPageTransformer(PageTransformer transformer) {
    viewPager.setPageTransformer(true, transformer);
    return this;
}
 
Example #10
Source File: ConvenientBanner.java    From o2oa with GNU Affero General Public License v3.0 2 votes vote down vote up
/**
 * 自定义翻页动画效果
 *
 * @param transformer
 * @return
 */
public ConvenientBanner setPageTransformer(PageTransformer transformer) {
    viewPager.setPageTransformer(true, transformer);
    return this;
}
 
Example #11
Source File: ConvenientBanner.java    From AndroidBase with Apache License 2.0 2 votes vote down vote up
/**
 * 自定义翻页动画效果
 *
 * @param transformer
 * @return
 */
public ConvenientBanner setPageTransformer(PageTransformer transformer) {
    viewPager.setPageTransformer(true, transformer);
    return this;
}