Skip to content

Commit 3f4738e

Browse files
committed
updated readme
1 parent a4a0b63 commit 3f4738e

File tree

1 file changed

+51
-31
lines changed

1 file changed

+51
-31
lines changed

README.md

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,88 @@
1-
Android PagerSlidingTabStrip
2-
============================
1+
# Android PagerSlidingTabStrip
32

43
Interactive paging indicator widget, compatible with the `ViewPager` from the
54
Android Support Library.
65

7-
Try out the sample application [on the Play Store][3].
6+
Try out the sample application [on the Play Store](https://play.google.com/store/apps/details?id=com.astuetz.viewpager.extensions.sample).
87

9-
![PagerSlidingTabStrip Sample Screenshot 1][4] ![PagerSlidingTabStrip Sample Screenshot 2][5]
8+
![PagerSlidingTabStrip Sample Screenshot 1](https://lh3.ggpht.com/PXS7EmHhQZdT1Oa379iy91HX3ByWAQnFZAthMAFa_QHAOHNClEaXU5nxDEAj1F2eqbk)![PagerSlidingTabStrip Sample Screenshot 2](https://lh3.ggpht.com/oaksDoUcQlGB4j7VEkBCOjrvSzjtzVHHcKq8pAnGVfm6oxkcJg_w1QS4tyP3fLcqrwcX)
109

11-
Usage
12-
=====
10+
# Usage
1311

1412
*For a working implementation of this project see the `sample/` folder.*
1513

16-
1. Include the PagerSlidingTabStrip widget in your view. This should usually be placed
17-
adjacent to the `ViewPager` it represents.
14+
1. Include the library as local library project or add the dependency in your build.gradle.
15+
16+
dependencies {
17+
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
18+
}
1819

19-
<com.astuetz.viewpager.extensions.PagerSlidingTabStrip
20+
2. Include the PagerSlidingTabStrip widget in your layout. This should usually be placed
21+
above the `ViewPager` it represents.
22+
23+
<com.astuetz.PagerSlidingTabStrip
2024
android:id="@+id/tabs"
2125
android:layout_width="match_parent"
2226
android:layout_height="48dip" />
2327

24-
2. In your `onCreate` method (or `onCreateView` for a fragment), bind the
28+
3. In your `onCreate` method (or `onCreateView` for a fragment), bind the
2529
widget to the `ViewPager`.
2630

27-
// Set the pager with an adapter
31+
// Initialize the ViewPager and set an adapter
2832
ViewPager pager = (ViewPager) findViewById(R.id.pager);
2933
pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
30-
31-
// Bind the widget to the adapter
34+
35+
// Bind the tabs to the ViewPager
3236
PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
3337
tabs.setViewPager(pager);
3438

35-
3. *(Optional)* If you use an `OnPageChangeListener` with your view pager
39+
4. *(Optional)* If you use an `OnPageChangeListener` with your view pager
3640
you should set it in the widget rather than on the pager directly.
3741

3842
// continued from above
3943
tabs.setOnPageChangeListener(mPageChangeListener);
4044

45+
# Customization
46+
47+
To not just look like another Play Store styled app, go and adjust these values to match
48+
your brand:
49+
50+
* `pstsIndicatorColor` Color of the sliding indicator
51+
* `pstsUnderlineColor` Color of the full-width line on the bottom of the view
52+
* `pstsDividerColor` Color of the dividers between tabs
53+
* `pstsIndicatorHeight`Height of the sliding indicator
54+
* `pstsUnderlineHeight` Height of the full-width line on the bottom of the view
55+
* `pstsDividerPadding` Top and bottom padding of the dividers
56+
* `pstsTabPaddingLeftRight` Left and right padding of each tab
57+
* `pstsScrollOffset` Scroll offset of the selected tab
58+
* `pstsTabBackground` Background drawable of each tab, should be a StateListDrawable
59+
* `pstsShouldExpand` If set to true, each tab is given the same weight, default false
60+
* `pstsTextAllCaps` If true, all tab titles will be upper case, default true
61+
62+
*All attributes have their respective getters and setters to change them at runtime*
63+
64+
# Changelog
65+
66+
### Current Version: 1.0.1
4167

42-
Developed By
43-
============
68+
### [1.0.1](https://github.com/astuetz/PagerSlidingTabStrip/tree/v1.0.1)
69+
70+
* Upgraded gradle build files
71+
* Changed package name to `com.astuetz.PagerSlidingTabStrip`
72+
* [#37](https://github.com/astuetz/PagerSlidingTabStrip/pull/37), [#41](https://github.com/astuetz/PagerSlidingTabStrip/pull/41) Added `psts` prefix to all attributes in `attrs.xml`
73+
* [#46](https://github.com/astuetz/PagerSlidingTabStrip/pull/46) Changed the shouldExpand behavior to set the layout at the time the tab is added
74+
75+
# Developed By
4476

4577
* Andreas Stuetz - <andreas.stuetz@gmail.com>
4678

4779

48-
Credits
49-
-------
80+
### Credits
5081

51-
* [Kirill Grouchnikov][1] - Author of [an explanation post on Google+][2]
82+
* [Kirill Grouchnikov](https://plus.google.com/108761828584265913206/posts) - Author of [an explanation post on Google+](https://plus.google.com/108761828584265913206/posts/Cwk7joBV3AC)
5283

5384

54-
License
55-
=======
85+
# License
5686

5787
Copyright 2013 Andreas Stuetz
5888

@@ -67,13 +97,3 @@ License
6797
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6898
See the License for the specific language governing permissions and
6999
limitations under the License.
70-
71-
72-
73-
74-
75-
[1]: https://plus.google.com/108761828584265913206/posts
76-
[2]: https://plus.google.com/108761828584265913206/posts/Cwk7joBV3AC
77-
[3]: https://play.google.com/store/apps/details?id=com.astuetz.viewpager.extensions.sample
78-
[4]: https://lh3.ggpht.com/PXS7EmHhQZdT1Oa379iy91HX3ByWAQnFZAthMAFa_QHAOHNClEaXU5nxDEAj1F2eqbk
79-
[5]: https://lh3.ggpht.com/oaksDoUcQlGB4j7VEkBCOjrvSzjtzVHHcKq8pAnGVfm6oxkcJg_w1QS4tyP3fLcqrwcX

0 commit comments

Comments
 (0)