GithubHelp home page GithubHelp logo

pagerbullet's Introduction

PagerBullet

Android Arsenal

Android ViewPager with bottom dots

#Quick start

  1. Just add this dependency into your build.gradle
compile 'com.robohorse.pagerbullet:pagerbullet:1.0.7'
  1. Replace your default ViewPager by com.robohorse.pagerbullet.PagerBullet

  2. Call this

pagerBullet.invalidateBullets();

when

pagerAdapter.notifyDataSetChanged();
  1. Profit!

#Customization Text indicator

This library can show dots or text indicator, when ViewPager contains a lot of pages. You can set limit of pages, when you want to show text indicator (default value is 20).

Just add

pagerBullet.setTextSeparatorOffset(5);

and you will see text instead of dots, when pages more than 5:

You can customize this text by override

    <string name="pager_bullet_separator" formatted="false">%s / %s</string>

or color

    <color name="pager_bullet_text_indicator">#ffffff</color>

Dot color:

    <color name="pager_bullet_active">#836556</color>
    <color name="pager_bullet_inactive">#219382</color>

or

pagerBullet.setIndicatorTintColorScheme(Color.WHITE, Color.BLUE);

Dot size:

    <dimen name="pager_bullet_indicator_active_dot_diameter">12dp</dimen>
    <dimen name="pager_bullet_indicator_inactive_dot_diameter">8dp</dimen>

Dot margin:

    <dimen name="pager_bullet_indicator_dot_margin">4dp</dimen>

Dot container height:

   <dimen name="pager_bullet_indicator_height">52dp</dimen>

or

   app:panelHeightInDp="52dp"

like this:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.robohorse.pagerbullet.PagerBullet
        android:id="@+id/pagerBullet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:panelHeightInDp="52dp" />
    
</FrameLayout>

#About Copyright 2016 Vadim Shchenev, and licensed under the MIT license. No attribution is necessary but it's very much appreciated. Star this project if you like it.

pagerbullet's People

Contributors

robohorse avatar

Watchers

James Cloos 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.