GithubHelp home page GithubHelp logo

morristech / timdicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tsurkis/timdicator

0.0 2.0 0.0 2.42 MB

A lightweight page Indicator library

License: Apache License 2.0

Java 100.00%

timdicator's Introduction

Timdicator API

This library was created for educational purposes first and embodies simplicity in its design. You can read more at: https://android.jlelse.eu/become-an-android-painter-aadf91cec9d4

Timdicator demo

Implementation

There are two steps:

  1. Adding the Jitpack repository: There are two options:

    • Add it in your root build.gradle at the end of repositories:
      allprojects {
        repositories {
          ...
          maven { url 'https://jitpack.io' }
        }
      }
    
    • Add it in the build.gradle of your desired module:
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    
  2. Adding the library:

  dependencies {
    compile 'com.github.tsurkis:timdicator:1.1.0'
  }

How to use

  1. Create Timdicator in a layout or programmatically:
  <com.tsurkis.timdicator.Timdicator
      android:id="@+id/timdicator"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"/>
  Timdicator timdicator = new Timdicator(context);
  1. Attach your ViewPager to Timdicator:
    • Version 1.1.0+:

      • Regular attachment:
        TimdicatorBinder.attachViewPager(timdicator, viewPager);
      
      • Dynamic attachment:
        TimdicatorBinder.attachViewPagerDynamically(timdicator, viewPager);
      
    • Version 1.0.3 and lower:

      • Regular attachment:
        timdicator.attach(viewPager);
      
      • Dynamic attachment:
        timdicator.attachDynamically(viewPager);
      

Regular attachment: This attachment will bind Timdicator view to the ViewPager as an OnPageChangeListener interface and will allow it to automatically switch states according to page selection.

Dynamic attachment: Initializes Timdicator according to the number of pages present in the ViewPager. Therefore, when using this method there is no need to declare number of circles in your layout. Additionaly, this attachment will bind Timdicator view to the ViewPager as an OnPageChangeListener interface and will allow it to automatically switch states according to page selection.

Life Cycle Handling

All the life cycle handling is done internally. Therefore, there is no need to call any destroy or nullifing method.

Parameters

Parameters Xml Attritube Setter Method Value
radius circle_radius setCircleRadiusInDp(Context, float) dp
distance between each circle distance_between_circles setDistanceBetweenCircleInDp(Context, float) dp
number of circles number_of_circles setNumberOfCircles(int) int
chosen circle color chosen_circle_color setChosenCircleColor(Context, @ColorRes int) color
default circle color default_circle_color setDefaultCircleColor(Context, @ColorRes int) color

timdicator's People

Contributors

wrimmer avatar tsurkis avatar

Watchers

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.