InfiniteCycleViewPager


Source link: https://github.com/Devlight/InfiniteCycleViewPager



InfiniteCycleViewPager

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

                       


 

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.2'

Or Maven:

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

Or Ivy:

<dependency org='com.github.devlight' name='infinitecycleviewpager' rev='1.0.2'>
<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.

  • auto scroll:
    allows you to set auto scroll in positive and negative directions.

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 you want to get item position just call this method:

infiniteCycleViewPager.getRealItem();

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

infiniteCycleViewPager.notifyDataSetChanged();

If you want to start auto scroll or stop call this methods:

// true - positive // false - negative infiniteCycleViewPager.startAutoScroll(...);
 infiniteCycleViewPager.stopAutoScroll();

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.

Xamarin

Thanks to Martijn van Dijk for developing Xamarin bindings library for InfiniteCycleViewPager.
Plugin is available on Nuget.

Credits

Yehor Kosinov Prakhar Neel Sharma

Author

Created by Basil Miller - @gigamole

Company

           

Here you can see open source work developed by Devlight LLC.
This and another works is an exclusive property of Devlight LLC.

If you want to use this library in applications which will be available on Google Play, please report us about it or author of the library.

Whether you're searching for a new partner or trusted team for creating your new great product we are always ready to start work with you.

You can contact us via [email protected] or [email protected].
Thanks in advance.

Devlight LLC, 2016
devlight.io

Resources

Forecast / DarkSky's Skycons, Animated Weather icons recreated for Android.

Demo application

material-design-icons are the official open-source icons featured in the Google Material Design specification.

What's included?

  • SVG versions of all icons in both 24px and 48px flavours
  • SVG and CSS sprites of all icons
  • 1x, 2x icons targeted at the Web (PNG)
  • 1x, 2x, 3x icons targeted at iOS (PNG)
  • Hi-dpi versions of all icons (hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi) (PNG)

Sick of writing ViewHolder classes, inflate xml and distinguish ViewTypes in your adapters?

Write less code with AnnotatedAdapter, an annotation processor for generating RecyclerView and AbsListView adapters.

Make Android screenshots of scrollable screen content.

This tool makes a number of screenshots, scrolling screen content by half height each time. Status bar and navigation bar are included only once.

A beautiful Android custom View that works similar to a range or seek bar. Selection by gesture. With animations. Supporting API level 11+.

Useful logger for Android based on standard android.util.Log class. Simple lightweight (< 50 Kb) implementation of SLF4J API. Easy but powerful configuration via properties file and some additional helpful logging methods. Easy analogue of popular log4j library.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes