Giter VIP home page Giter VIP logo

viewpagerwithindicator's Introduction

ViewPagerwithIndicator

API MIT licensed Release

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

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.

viewpagerwithindicator's People

Contributors

kassisdion avatar

Watchers

James Cloos avatar Ranjan Kumar Singh 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.