ViewPagerWithIndicator


Source link: https://github.com/kassisdion/ViewPagerWithIndicator

ViewPagerwithIndicator

What's ViewPagerwithIndicator ?

A simple ViewPager indicator implementation compatible with the Android Support Library. It can use arrows on the left and on right and it can display a pageIndicator.

Demo

Feature

  • Can enable/desable Arrows
  • Can select arrows width/height
  • Can custom arrows drawable
  • Can enable/desable PageIndicator
  • Can select PageIndicator size
  • Can custom PageIndicator colors (default/selected)

Import

JitPack

Add it in your project's build.gradle at the end of repositories:

repositories {

// ...
maven {
 url "https://jitpack.io" 
}
 
}

Step 2. Add the dependency in the form

dependencies {

compile 'com.github.kassisdion:ViewPagerWithIndicator:v1.0' 
}

Usage

Step 1 : Define your viewPager under your xml (This should usually be placed adjacent to the viewPager) :

 <com.kassisdion.library.ViewPagerWithIndicator

app:arrow.enable="true"

app:arrow.width="50dip"

app:arrow.height="50dip"

app:left_arrow.drawable="@drawable/ic_action_arrow_left"

app:right_arrow.drawable="@drawable/ic_action_arrow_right"

app:round.enable="true"

app:round.size="15dip"

app:round.drawable="@drawable/background_rounded"

app:round.color.default="@android:color/white"

app:round.color.selected="@android:color/holo_blue_light"

android:id="@+id/viewPagerWithIndicator"

android:layout_width="match_parent"

android:layout_height="wrap_content">

</com.kassisdion.library.ViewPagerWithIndicator>

Step 2 : Initialize the ViewPagerIndicator under your activity (or fragment) :

 @Override
  protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

//Set the pager with an adapter

ViewPager pager = (ViewPager)findViewById(R.id.pager);

List<Integer> objects = Arrays.asList(Color.BLUE, Color.GREEN, Color.RED);

pager.setAdapter(new ViewPagerCustomAdapter(objects));

//Bind the title indicator to the adapter

ViewPagerWithIndicator viewPagerWithIndicator = (ViewPagerWithIndicator)findViewById(R.id.viewPagerWithIndicator);

viewPagerWithIndicator.setViewPager(pager);

  
}

Sample

For a working implementation of this project see the app/ folder.

Javadoc

You can take a look at the javadoc

License

See LICENSE.txt

Contact

If you have any new idea about this project, feel free to contact me.

Resources

It is a java wrapper for querying books information on Google Books Api.

CountryPicker is an Android library created to show a custom fragment which allows to choose a country.

HoverTouchView simulates Apple's Force Touch or 3D Touch on Android App with Hover Gesture.

PageStateLayout could let you show Loading / Empty / Error / Succeed / Requesting state in Activity, Fragment, ViewGroup as you want.

SimpleWaveform is a widget to show a sequence data in waveform or bar chart.

A powerful library for loading images from Qiniu service.

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