Android ViewPagerIndicator
==========================
Paging indicator widgets that are compatible with the `ViewPager` from the
[Android Support Library][2] to improve discoverability of content.
Try out the sample application [on the Android Market][10].
![ViewPagerIndicator Sample Screenshots][9]
These widgets can also be used in conjunction with [ActionBarSherlock][3]!
Usage
=====
*For a working implementation of this project see the `sample/` folder.*
1. Include one of the widgets in your view. This should usually be placed
adjacent to the `ViewPager` it represents.
<com.viewpagerindicator.TitlePageIndicator
android:id="@+id/titles"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
2. In your `onCreate` method (or `onCreateView` for a fragment), bind the
indicator to the `ViewPager`.
//Set the pager with an adapter
ViewPager pager = (ViewPager)findViewById(R.id.pager);
pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
//Bind the title indicator to the adapter
TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
titleIndicator.setViewPager(pager);
3. *(Optional)* If you use an `OnPageChangeListener` with your view pager
you should set it in the indicator rather than on the pager directly.
//continued from above
titleIndicator.setOnPageChangeListener(mPageChangeListener);
Theming
-------
There are three ways to style the look of the indicators.
1. **Theme XML**. An attribute for each type of indicator is provided in which
you can specify a custom style.
2. **Layout XML**. Through the use of a custom namespace you can include any
desired styles.
3. **Object methods**. Both styles have getters and setters for each style
attribute which can be changed at any point.
Each indicator has a demo which creates the same look using each of these
methods.
Including In Your Project
-------------------------
Android-ViewPagerIndicator is presented as an [Android library project][7]. A
standalone JAR is not possible due to the theming capabilities offered by the
indicator widgets.
You can include this project by [referencing it as a library project][8] in
Eclipse or ant.
If you are a Maven user you can easily include the library by specifying it as
a dependency:
<dependency>
<groupId>com.viewpagerindicator</groupId>
<artifactId>library</artifactId>
<version>2.4.1</version>
<type>apklib</type>
</dependency>
This project depends on the `ViewPager` class which is available in the
[Android Support Library][2] or [ActionBarSherlock][3]. Details for
including one of those libraries is available on their respecitve web sites.
Developed By
============
* Jake Wharton - <jakewharton@gmail.com>
Credits
-------
* [Patrik Åkerfeldt][1] - Author of [ViewFlow][4], a precursor to the ViewPager,
which supports paged views and is the original source of both the title
and circle indicators.
* [Francisco Figueiredo Jr.][5] - Idea and [first implementation][6] for
fragment support via ViewPager.
License
=======
Copyright 2012 Jake Wharton
Copyright 2011 Patrik Åkerfeldt
Copyright 2011 Francisco Figueiredo Jr.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
[1]: https://github.com/pakerfeldt
[2]: http://developer.android.com/sdk/compatibility-library.html
[3]: http://actionbarsherlock.com
[4]: https://github.com/pakerfeldt/android-viewflow
[5]: https://github.com/franciscojunior
[6]: https://gist.github.com/1122947
[7]: http://developer.android.com/guide/developing/projects/projects-eclipse.html
[8]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
[9]: https://raw.github.com/JakeWharton/Android-ViewPagerIndicator/master/sample/screens.png
[10]: https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample
没有合适的资源?快使用搜索试试~ 我知道了~
ViewPagerIndicator-master
共155个文件
png:69个
java:42个
xml:32个
需积分: 10 16 下载量 113 浏览量
2016-03-23
09:36:33
上传
评论
收藏 1.64MB ZIP 举报
温馨提示
发布在GitHub上的一款开源ViewPager指针项目,在使用ViewPager的时候能够指示ViewPager所在的位置,实际上就是ViewPager的分页指示器,比如很多应用的指引界面,下面的小圆点,还有一些应用上面的Tab等等,ViewPageIndicator都能很好的实现。
资源推荐
资源详情
资源评论
收起资源包目录
ViewPagerIndicator-master (155个子文件)
.gitignore 210B
android-support-v4.jar 265KB
android-support-v4.jar 265KB
TitlePageIndicator.java 31KB
CirclePageIndicator.java 18KB
LinePageIndicator.java 15KB
UnderlinePageIndicator.java 13KB
TabPageIndicator.java 9KB
IcsLinearLayout.java 7KB
IconPageIndicator.java 5KB
ListSamples.java 5KB
TestFragment.java 2KB
SampleTabsWithIcons.java 2KB
PageIndicator.java 2KB
BaseSampleActivity.java 2KB
SampleTabsStyled.java 2KB
SampleTabsDefault.java 2KB
TestFragmentAdapter.java 1KB
SampleCirclesWithListener.java 1KB
SampleTitlesWithListener.java 1KB
SampleTitlesStyledMethods.java 1KB
SampleTitlesCenterClickListener.java 1KB
SampleCirclesStyledMethods.java 1KB
SampleLinesStyledMethods.java 986B
SampleUnderlinesStyledMethods.java 920B
SampleTitlesTriangle.java 854B
SampleCirclesInitialPage.java 810B
SampleTitlesInitialPage.java 807B
SampleUnderlinesNoFade.java 773B
SampleUnderlinesStyledTheme.java 760B
SampleCirclesSnap.java 754B
SampleCirclesStyledTheme.java 748B
SampleTitlesStyledTheme.java 745B
SampleLinesStyledTheme.java 740B
SampleUnderlinesStyledLayout.java 691B
SampleUnderlinesDefault.java 686B
SampleCirclesStyledLayout.java 679B
SampleTitlesStyledLayout.java 676B
SampleTitlesBottom.java 676B
SampleCirclesDefault.java 674B
SampleTitlesDefault.java 671B
SampleLinesStyledLayout.java 671B
SampleIconsDefault.java 667B
SampleLinesDefault.java 666B
IconPagerAdapter.java 237B
CHANGELOG.md 5KB
README.md 4KB
screens.png 331KB
web.png 85KB
logo.png 52KB
icon.png 8KB
icon.png 5KB
icon.png 4KB
perm_group_device_alarms_selected.png 3KB
perm_group_device_alarms_normal.png 3KB
perm_group_camera_selected.png 2KB
perm_group_device_alarms_selected.png 2KB
perm_group_camera_normal.png 2KB
perm_group_device_alarms_normal.png 2KB
perm_group_location_selected.png 2KB
perm_group_location_normal.png 2KB
perm_group_camera_selected.png 2KB
perm_group_camera_normal.png 2KB
perm_group_calendar_normal.png 2KB
perm_group_calendar_selected.png 2KB
perm_group_location_normal.png 2KB
perm_group_device_alarms_normal.png 2KB
perm_group_location_selected.png 2KB
perm_group_camera_normal.png 1KB
perm_group_calendar_normal.png 1KB
perm_group_calendar_normal.png 1KB
perm_group_device_alarms_selected.png 1KB
perm_group_location_normal.png 1KB
perm_group_camera_selected.png 1KB
perm_group_calendar_selected.png 1KB
perm_group_calendar_selected.png 1KB
perm_group_location_selected.png 1KB
custom_tab_indicator_unselected_focused.9.png 225B
custom_tab_indicator_selected_pressed.9.png 225B
custom_tab_indicator_unselected_pressed.9.png 222B
custom_tab_indicator_focused.9.png 220B
custom_tab_indicator_unselected.9.png 194B
custom_tab_indicator_unselected_focused.9.png 192B
custom_tab_indicator_unselected_focused.9.png 189B
custom_tab_indicator_unselected_pressed.9.png 189B
custom_tab_indicator_selected_pressed.9.png 187B
custom_tab_indicator_selected_focused.9.png 187B
custom_tab_indicator_selected_focused.9.png 187B
custom_tab_indicator_unselected.9.png 186B
custom_tab_indicator_selected_pressed.9.png 183B
custom_tab_indicator_unselected.9.png 183B
custom_tab_indicator_unselected_pressed.9.png 182B
custom_tab_indicator_selected.9.png 180B
custom_tab_indicator_selected.9.png 179B
custom_tab_indicator_selected.9.png 178B
vpi__tab_unselected_holo.9.png 166B
vpi__tab_unselected_holo.9.png 157B
vpi__tab_unselected_pressed_holo.9.png 155B
vpi__tab_unselected_holo.9.png 153B
vpi__tab_selected_holo.9.png 153B
共 155 条
- 1
- 2
资源评论
嘴里有刀说破歌谣
- 粉丝: 5
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功