Skip to content

Commit 23daffc

Browse files
committed
Update README.md
1 parent e64cd00 commit 23daffc

File tree

1 file changed

+58
-10
lines changed

1 file changed

+58
-10
lines changed

README.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ An Android library that brings the Material Design 5.1 scrollbar to pre-5.1 devi
1010
[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UH23JHQ8K4U2C)
1111

1212
Preview
13-
-------
13+
======
1414

1515
[Video](https://youtu.be/CmcPsJYuzME)
1616

1717
![](http://i.imgur.com/9rY0e8h.png)
1818
![](http://i.imgur.com/8DNLqkn.png)
1919

2020
How to add
21-
--------
21+
======
2222

2323
```gradle
2424
maven {
@@ -32,11 +32,11 @@ dependencies {
3232
}
3333
```
3434
Documentation
35-
-------
35+
======
3636

3737
Note: All customisation methods (setAutoHide, setBarColour, etc) return the materialScrollBar, so they can be chained together if wanted. Alternativly, you can just operate on a variable.
3838

39-
###How to use - ScrollBar
39+
##How to use - ScrollBar
4040

4141
```java
4242
MaterialScrollBar materialScrollBar = new MaterialScrollBar(this, recyclerView, {{lightOnTouch}});
@@ -54,7 +54,7 @@ For devices running Lollipop and above, the accent colour will be read automatic
5454

5555
Also note that the library does not currently support recyclerViews which do not boarder the screen's edge on the right side.
5656

57-
###How to use - Section Indicator
57+
##How to use - Section Indicator
5858

5959
To add a section indicator, simply add the following line of code:
6060

@@ -66,8 +66,8 @@ The section indicator should be either AlphatbetIndicator, DateAndTimeIndicator,
6666

6767
To use an indicator, you **MUST** make your recyclerView's adapter implement the relevant interface. If you do not, the library will throw a runtime error informing you of your mistake. See documentation for the relevant interface.
6868

69-
###Indicators
70-
####AlphabetIndicator
69+
##Indicators
70+
###AlphabetIndicator
7171

7272
**Required Interface:** INameableAdapter
7373

@@ -76,7 +76,7 @@ To implement an AlphabetIndicator, which displays one character usually correspo
7676
...addSectionIndicator(new AlphabetIndicator(this));
7777
```
7878

79-
####DateAndTimeIndicator
79+
###DateAndTimeIndicator
8080

8181
**Required Interface:** IDateableAdapter
8282

@@ -87,14 +87,62 @@ To implement a DateAndTimeIndicator, which displays any combination of time, day
8787

8888
All of the arguments are booleans (except for this first one obviously). The indicator will dynamically size, add punctuation, and localise for you. All you need to do is provide a Date object for each element in your adapter. You should almost always use miliseconds since the epoch unless you have a good reason not to. Otherwise, the library might crash.
8989

90+
###CustomIndicator
91+
92+
**Required Interface:** ICustomAdapter
93+
94+
To implement a CustomIndicator, which displays any text you want, add the following to the end of your materialScrollBar instantiation, or add it as a seperate line.
95+
```java
96+
...addSectionIndicator(new CustomIndicator(this));
97+
```
98+
99+
##Customisation Options
100+
101+
The following are various methods that you can invoke to customise the behaviour of the library.
102+
103+
####setHideDuration(int hideDuration)
104+
105+
**Default:** 2500
106+
107+
Use this to alter the hide duration of the bar. Only has effect if autoHide is true.
108+
109+
####setHandleColour(String|int colour)
110+
111+
**Default:** App designated accent colour (API 19+), Dark grey (API 18-)
112+
113+
Use this to alter the colour of the handle. If lightOnPress is true, this affects the lit colour.
114+
115+
####setHandleOffColour(String|int colour)
116+
117+
**Default:** Dark grey
118+
119+
Use this to alter the colour of the handle when unpressed. Only effective if lightOnPress is true.
120+
121+
####setBarColour(String|int colour)
122+
123+
**Default:** Light grey
124+
125+
Use this to alter the colour of the bar's background.
126+
127+
####setTextColour(String|int colour)
128+
129+
**Default:** White
130+
131+
Use this to alter the colour of text in the indicator. Useful if the background is unusually light and the text needs to be darkened.
132+
133+
####setAutoHide(Boolean autoHide)
134+
135+
**Default:** True
136+
137+
Use this to change whether the bar should deploy and hide as motion occours (true) or if it should always be present (false).
90138

91139
Versioning Policy
92-
-------
140+
======
93141

94142
All versions have 3 nodes (X.X.X). The first increments every time that an application written for the previous version might be rendered incompatibile with the new version. This occurs whenever a feature's implementation must be changed on the developer's end to continue working. The second node changes whenever a new feature is added or previous features are updated, without breaking any code which was written for the previous version. The last node changes for bugfixes or dependancy updates.
95143

96144
License
97-
--------
145+
======
98146

99147
Copyright 2015 Wynne Plaga.
100148

0 commit comments

Comments
 (0)