Giter VIP home page Giter VIP logo

infinitecycleviewpager's Introduction

InfiniteCycleViewPager

Infinite cycle ViewPager with two-way orientation and interactive effect.

DevLight

Android Arsenal Android Download Crates.io Codacy Badge

U can check the sample app here.

Download

You can download a .aar from GitHub's releases page.

Or use Gradle:

compile 'com.github.devlight:infinitecycleviewpager:1.0.0'

Or Maven:

<dependency>
  <groupId>com.github.devlight</groupId>
  <artifactId>infinitecycleviewpager</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Or Ivy:

<dependency org='com.github.devlight' name='infinitecycleviewpager' rev='1.0.0'>
  <artifact name='$AID' ext='pom'></artifact>
</dependency>

Android SDK Version

InfiniteCycleViewPager requires a minimum SDK version of 11.

Sample

Parameters

For InfiniteCycleViewPager you can set such parameters as:

  • min scale:

    allows you to set the minimum scale of left and right bottom pages.

  • max scale:

    allows you to set the maximum scale of center top page.

  • min scale offset:

    allows you to set offset from edge to minimum scaled pages.

  • center scale offset:

    allows you to set offset from center when two pages appears.

  • model selected icon:

    allows you to set selected icon when current model is active.

  • medium scaled:

    allows you to set is scaling would be min -> max or min -> medium -> max.

  • scroll duration:

    allows you to set snap scrolling duration.

  • scroll interpolator:

    allows you to set snap scrolling interpolator.

  • page transform listener:

    allows you to set page transform listener.

Tips

Two-way widget need a lot of memory.

Infinite scroll available when item count more then 2.

You can set vertical or horizontal infinite cycle ViewPager.

Init

Check out in code init:

//      final VerticalInfiniteCycleViewPager infiniteCycleViewPager =
//                (VerticalInfiniteCycleViewPager) view.findViewById(R.id.vicvp);
        final HorizontalInfiniteCycleViewPager infiniteCycleViewPager =
                (HorizontalInfiniteCycleViewPager) view.findViewById(R.id.hicvp);
        infiniteCycleViewPager.setAdapter(...);
        infiniteCycleViewPager.setScrollDuration(500);
        infiniteCycleViewPager.setInterpolator(...);
        infiniteCycleViewPager.setMediumScaled(true);
        infiniteCycleViewPager.setMaxPageScale(0.8F);
        infiniteCycleViewPager.setMinPageScale(0.5F);
        infiniteCycleViewPager.setCenterPageScaleOffset(30.0F);
        infiniteCycleViewPager.setMinPageScaleOffset(5.0F);
        infiniteCycleViewPager.setOnInfiniteCyclePageTransformListener(...);

If your want to get item position just call this metho:

infiniteCycleViewPager.getRealItem();

To update your ViewPager after some adapter update or else, you can call this method:

infiniteCycleViewPager.notifyDataSetChanged();

Other methods check out in sample.

And XML init:

<!--<com.gigamole.infinitecycleviewpager.VerticalInfiniteCycleViewPager-->
<com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:icvp_interpolator="..."
    app:icvp_center_page_scale_offset="30dp"
    app:icvp_max_page_scale="0.8"
    app:icvp_medium_scaled="true"
    app:icvp_min_page_scale="0.5"
    app:icvp_min_page_scale_offset="5dp"
    app:icvp_scroll_duration="500"/>

Getting Help

To report a specific problem or feature request, open a new issue on Github.

License

Apache 2.0 and MIT. See LICENSE file for details.

Inspiration

Author

Made in DevLight Mobile Agency

Created by Basil Miller - @gigamole

Support

If you'd like to support future development and new product features, please make a payments on Gratipay and Beerpay or become a patron on Patreon.

Gratipay Beerpay Patreon

Also, if you use this library in applications that are available on Google Play, please report it to us or author.

Thanks in advance.

infinitecycleviewpager's People

Contributors

gigamole avatar

Watchers

Chew Chit Siang avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.