Android ViewPagerIndicator
==========================
Port of [Patrik Åkerfeldt][1]'s paging indicators that are compatible with the
ViewPager from the [Android Compatibility Library][2] and
[ActionBarSherlock][3].
Try out the sample application [on the Android Market][10].
![ViewPagerIndicator Sample Screenshots][9]
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);
*Note*: If you are using `TitlePageIndicator` your adapter must implement
`TitleProvider`.
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.2.2</version>
<type>apklib</type>
</dependency>
You must also include the following repository:
<repository>
<id>com.jakewharton</id>
<url>http://r.jakewharton.com/maven/release</url>
</repository>
This project depends on the `ViewPager` class which is available in the
[Android Compatibility 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 2011 Patrik Åkerfeldt
Copyright 2011 Francisco Figueiredo Jr.
Copyright 2011 Jake Wharton
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://market.android.com/details?id=com.viewpagerindicator.sample
没有合适的资源?快使用搜索试试~ 我知道了~
Android-ViewPagerIndicator-2.2.2.zip_CirclePageIndicator_android
共104个文件
png:42个
java:27个
xml:23个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 52 浏览量
2022-09-21
08:54:23
上传
评论
收藏 1.21MB ZIP 举报
温馨提示
为android PagerView 添加指示器。
资源详情
资源评论
资源推荐
收起资源包目录
Android-ViewPagerIndicator-2.2.2.zip_CirclePageIndicator_android (104个子文件)
.gitignore 139B
android-support-v4.jar 219KB
android-support-v4.jar 219KB
TitlePageIndicator.java 28KB
CirclePageIndicator.java 17KB
TabPageIndicator.java 8KB
ListSamples.java 5KB
PageIndicator.java 2KB
TestFragment.java 2KB
SampleTabsDefault.java 1KB
SampleTabsStyled.java 1KB
BaseSampleActivity.java 1KB
SampleTitlesStyledMethods.java 1KB
SampleTitlesCenterClickListener.java 1KB
SampleTitlesWithListener.java 1KB
SampleCirclesWithListener.java 1KB
SampleCirclesStyledMethods.java 990B
TitleProvider.java 896B
SampleTitlesTriangle.java 848B
SampleTitlesInitialPage.java 797B
SampleCirclesInitialPage.java 795B
TestFragmentAdapter.java 772B
SampleTitlesStyledTheme.java 741B
SampleCirclesStyledTheme.java 739B
SampleCirclesSnap.java 737B
SampleTitlesStyledLayout.java 676B
SampleCirclesStyledLayout.java 674B
SampleTitlesDefault.java 671B
SampleCirclesDefault.java 669B
TestTitleFragmentAdapter.java 425B
README.md 5KB
CHANGELOG.md 3KB
web.png 85KB
logo.png 52KB
screens.png 42KB
icon.png 8KB
icon.png 5KB
icon.png 4KB
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_unselected.9.png 183B
custom_tab_indicator_selected_pressed.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
vpi__tab_selected_holo.9.png 151B
vpi__tab_unselected_focused_holo.9.png 150B
vpi__tab_selected_pressed_holo.9.png 150B
vpi__tab_unselected_pressed_holo.9.png 149B
vpi__tab_selected_holo.9.png 148B
vpi__tab_unselected_focused_holo.9.png 148B
vpi__tab_selected_focused_holo.9.png 148B
vpi__tab_selected_focused_holo.9.png 147B
vpi__tab_selected_pressed_holo.9.png 147B
vpi__tab_selected_focused_holo.9.png 147B
vpi__tab_selected_pressed_holo.9.png 147B
vpi__tab_unselected_focused_holo.9.png 146B
vpi__tab_unselected_pressed_holo.9.png 145B
project.properties 399B
project.properties 381B
web.psd 1.05MB
logo.psd 480KB
icon_xhdpi.psd 91KB
icon_hdpi.psd 66KB
icon_mdpi.psd 49KB
AndroidManifest.xml 7KB
pom.xml 5KB
checkstyle.xml 5KB
vpi__styles.xml 4KB
vpi__attrs.xml 4KB
pom.xml 3KB
custom_tab_indicator.xml 2KB
styles.xml 2KB
vpi__tab_indicator.xml 2KB
vpi__defaults.xml 2KB
pom.xml 2KB
themed_titles.xml 2KB
themed_circles.xml 1KB
vpi__colors.xml 1KB
vpi__light_theme.xml 1KB
vpi__dark_theme.xml 1KB
simple_circles_vertical.xml 1KB
simple_circles.xml 1KB
simple_titles.xml 1KB
共 104 条
- 1
- 2
四散
- 粉丝: 49
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0