ViewPagerTabs
=============
An implementation of the [swipey tabs][1] for the
ViewPager from the [Android Support Package][2]
![ViewPagerTabs Screenshots][7]
IMPORTANT
=========
Please note that this repository is no longer maintained.
Look at my [ViewPagerExtensions][8] project (especially SwipeyTabsView) for a better implementation of this view.
Usage
=====
For an example of how to use this, see [android-viewpagertabs-example][3]
1. Including In Your Project
This is an Android library project, you can include it by referencing it as a library project in
Eclipse or ant.
This project depends on the `ViewPager` class which is available in the Android Support Package.
*IMPORTANT* Make sure to use the latest version of the Support Package!
2. Include com.astuetz.viewpagertabs.ViewPagerTabs in your view.
<com.astuetz.viewpagertabs.ViewPagerTabs
android:id="@+id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FF3B3B3B" />
If you want to add a colored line below the tabs, use something like this:
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:background="#FF91A438" />
And then your ViewPager:
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
3. In your Activity, bind the ViewPager to the ViewPagerTabs in the `onCreate` method.
// Set the pager with an adapter
ViewPager pager = (ViewPager) findViewById(R.id.pager);
pager.setAdapter(new ExampleAdapter(this));
// Bind the ViewPager to ViewPagerTabs
ViewPagerTabs tabs = (ViewPagerTabs) findViewById(R.id.tabs);
tabs.setViewPager(pager);
*Note*: The adapter of the ViewPager has to implement `ViewPagerTabProvider`.
Styling
=======
You can customize the tabs either by xml-attributes or by setter-methods:
1. Customize by XML-attributes:
<com.astuetz.viewpagertabs.ViewPagerTabs
android:id="@+id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:backgroundColorPressed="#55333E73"
app:textColor="#D8D8D8"
app:textColorCenter="#FFFC7F"
app:lineColorCenter="#FFFC7F"
app:lineHeight="4dip"
app:tabPaddingLeft="15dip"
app:tabPaddingRight="15dip"
app:tabPaddingBottom="2dip"
app:tabPaddingTop="5dip"
app:textSize="12sp" />
*Note*: Don't forget to define the namespace: xmlns:app="http://schemas.android.com/apk/res/your.package.name"
2. Customize by setter-methods:
ViewPagerTabs tabs = (ViewPagerTabs) findViewById(R.id.tabs);
tabs.setBackgroundColor(0x00FFFFFF);
tabs.setBackgroundColorPressed(0x33333333);
tabs.setTextColor(0x44A80000);
tabs.setTextColorCenter(0xFFA80000);
tabs.setLineColorCenter(0xFFA80000);
tabs.setLineHeight(5);
tabs.setTextSize(22);
tabs.setTabPadding(5, 1, 5, 10);
Developed By
============
* Andreas Stütz - <andreas.stuetz@gmail.com>
License
=======
Copyright 2011 Andreas Stuetz
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]: http://www.pushing-pixels.org/2011/08/11/android-tips-and-tricks-swipey-tabs.html
[2]: http://developer.android.com/sdk/compatibility-library.html
[3]: https://github.com/astuetz/android-viewpagertabs-example
[4]: http://developer.android.com/guide/developing/projects/projects-eclipse.html
[5]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
[7]: https://github.com/astuetz/android-viewpagertabs-example/raw/master/tabs.png
[8]: https://github.com/astuetz/ViewPagerExtensions
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
为了满足广大Android开发爱好者与从业者的学习需求,我们精心整理并上传了一份全面而实用的Android项目资源包。这份资源包内容丰富,涵盖了从基础知识到实战应用的全方位内容,旨在为开发者们提供一个便捷、高效的学习平台。 一、文件手册 资源包中的文件手册部分,详细记录了Android开发的核心知识点和常用技术。无论是初学者还是有一定经验的开发者,都能从中找到所需的学习资料。手册采用了简洁明了的排版方式,使得查阅更加方便快捷。同时,手册内容深入浅出,既适合新手入门,也能为老手提供有价值的参考。 二、项目实战与练习 为了让学习者能够将理论知识与实践相结合,我们特别准备了项目实战与练习部分。这部分内容包含了多个精心设计的Android项目案例,从需求分析、设计思路到实现过程,都有详细的讲解和代码示例。学习者可以通过实际操作,深入了解Android开发的整个流程,提升自己的实战能力。 此外,我们还提供了一系列练习题,旨在巩固所学知识,检验学习成果。这些练习题既有基础题,也有难度较高的挑战题,适合不同层次的学习者进行练习。 三、Android开发工具集 在Android开发过程中,选择合适的工具能够大大提高开发效率。因此,我们整理了常用的Android开发工具集,包括开发工具、测试工具、性能优化工具等。这些工具都是经过我们精心筛选和测试的,能够帮助开发者们更加高效地进行Android开发工作。 总的来说,这份Android项目资源包是一份不可多得的学习资料,无论你是初学者还是有一定经验的开发者,都能从中受益匪浅。我们希望通过这份资源包,为广大Android开发爱好者与从业者提供一个更加便捷、高效的学习平台,共同推动Android开发领域的发展。
资源推荐
资源详情
资源评论
收起资源包目录
收藏Android开源项目.zip (734个子文件)
resources.ap_ 693KB
SogouGameMall.apk 1.48MB
SplashActivity.apk 848KB
test.bks 905B
jarlist.cache 120B
proguard.cfg 1KB
proguard.cfg 1KB
.classpath 538B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
.classpath 466B
classes.dex 449KB
sgm_20130815.rar.enc 3.82MB
sjg_20130815.rar.enc 1.91MB
.gitignore 241B
.gitignore 231B
.gitignore 186B
.gitignore 51B
.gitignore 45B
.gitignore 9B
build.gradle 772B
Shelves.iml 617B
Shelves.ipr 22KB
PieChart.java 33KB
DiskLruCache.java 33KB
TitlePageIndicator.java 31KB
ShelvesActivity.java 29KB
AsyncTask.java 27KB
Images.java 27KB
ImageCache.java 25KB
ImageLoader.java 19KB
AddBookActivity.java 19KB
BooksStore.java 18KB
CirclePageIndicator.java 18KB
ViewPagerTabs.java 18KB
Request.java 18KB
DiskBasedCache.java 17KB
ImageWorker.java 17KB
UserTask.java 17KB
LinePageIndicator.java 15KB
ImageUtilities.java 15KB
R.java 15KB
UnderlinePageIndicator.java 13KB
LayerDrawable.java 13KB
ImageGridFragment.java 12KB
ImageFetcher.java 11KB
ImageResizer.java 10KB
BooksProvider.java 10KB
RequestQueue.java 10KB
GoogleBooksStore.java 10KB
BasicNetwork.java 9KB
TabPageIndicator.java 9KB
HurlStack.java 9KB
ExtHttpClientStack.java 9KB
ImageRequest.java 8KB
CrossFadeDrawable.java 8KB
CheckedTextView1.java 8KB
ImageDetailActivity.java 8KB
BookStoreFactory.java 7KB
NetworkImageView.java 7KB
AppMainTabActivity.java 7KB
RequestQueueTest.java 7KB
TransitionDrawable.java 7KB
Act_NetworkListView.java 7KB
HttpHeaderParserTest.java 7KB
IcsLinearLayout.java 7KB
MyWindowManager.java 7KB
VolleyLog.java 6KB
BooksUpdater.java 6KB
CacheDispatcher.java 6KB
HttpClientStack.java 6KB
BooksAdapter.java 6KB
DiskBasedCacheTest.java 6KB
BubbleTextView.java 6KB
IconPageIndicator.java 5KB
BooksManager.java 5KB
NetworkDispatcher.java 5KB
ByteArrayPool.java 5KB
WeiBoActivity.java 5KB
Act_Params.java 5KB
ShelvesView.java 5KB
Act_Cookies.java 5KB
BookDetailsActivity.java 5KB
HttpHeaderParser.java 5KB
ListSamples.java 4KB
Act_Main.java 4KB
HurlStackTest.java 4KB
SsX509TrustManager.java 4KB
ViewPagerTab.java 4KB
CacheDispatcherTest.java 4KB
共 734 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
%小红书%bin
- 粉丝: 1983
- 资源: 2148
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功