Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/liangfeidotme/AndroidRubberIndicator

A rubber indicator
https://github.com/liangfeidotme/AndroidRubberIndicator

Last synced: 13 days ago
JSON representation

A rubber indicator

Awesome Lists containing this project

README

        

# RubberIndicator

[![Join the chat at https://gitter.im/LyndonChin/AndroidRubberIndicator](https://badges.gitter.im/LyndonChin/AndroidRubberIndicator.svg)](https://gitter.im/LyndonChin/AndroidRubberIndicator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A rubber indicator for ViewPager

* Designed by [Valentyn Khenkin](https://dribbble.com/shots/2090803-Rubber-Indicator?list=searches&tag=indicator&offset=7)
* [Here](http://codepen.io/machycek/full/eNvyjb/) is the CSS version

## Usage

The attributes for `RubberIndicator` are not yet finished.
A toy example is provided in [sample](sample/src/main/java/com/liangfeizc/rubberindicator/MainActivity.java).

## Introduction

APIs offered by **RubberIndicator**.

|APIs | Usage|
|---|---|
|setCount(int count)|Set the count of indicators|
|setCount(int count, int focusPos)|Set the count and specify the focusing indicator|
|setFocusPosition(int pos)|Set focusing indicator|
|getFocusPosition()|Get focusing indicator|
|moveToLeft()|Move the focusing indicator to left|
|moveToRight()|Move the focusing indicator to right|

In addition to the APIs listed in the table, **RubberIndicator** also provides a callback listener - **OnMoveListener** for the user should be notified when the moving animator finished.

```java
public interface OnMoveListener {
void onMovedToLeft();
void onMovedToRight();
}
```

## Me

* [weibo](http://weibo.com/liangfeizc)
* [twitter](https://twitter.com/JpRyouhi)

## License

MIT