simplezhli / Changetablayout
Licence: apache-2.0
[停止维护]一款炫酷的TabLayout
Stars: ✭ 345
Programming Languages
java
68154 projects - #9 most used programming language
Projects that are alternatives of or similar to Changetablayout
Funtablayout
An efficient tablayout for Android with added FUN!
Stars: ✭ 20 (-94.2%)
Mutual labels: viewpager, tablayout
Android Tab Animation
Easily create TabLayout.Tab animations that sync with the scrolling progress of ViewPager
Stars: ✭ 68 (-80.29%)
Mutual labels: viewpager, tablayout
Snaptablayout
Android library for fluid tablayout animation as seen on Snapchat.
Stars: ✭ 547 (+58.55%)
Mutual labels: viewpager, tablayout
Dsltablayout
♥️ Android界最万能的TabLayout(不仅仅是TabLayout), 支持任意类型的item, 支持Drawable类型的指示器,智能开启滚动,支持横竖向布局等
Stars: ✭ 489 (+41.74%)
Mutual labels: viewpager, tablayout
UltimateTabLayout
A library for tab layout use with viewpager. Very useful, small
Stars: ✭ 33 (-90.43%)
Mutual labels: viewpager, tablayout
Flowhelper
帮助您迅速构建顶部Tab,比如今日头条效果,热搜、搜索记录、与ViewPager/ViewPager2搭配的工具类;
Stars: ✭ 295 (-14.49%)
Mutual labels: viewpager, tablayout
Viewpagerhelper
这个一个 viewpager/viewpager2工具类,能够帮你快速实现导航栏轮播图,app引导页,viewpager/viewpager2 + fragment;内置多种tab指示器,让你告别 viewpager 的繁琐操作,专注逻辑功能
Stars: ✭ 957 (+177.39%)
Mutual labels: viewpager, tablayout
Magicindicator
A powerful, customizable and extensible ViewPager indicator framework. As the best alternative of ViewPagerIndicator, TabLayout and PagerSlidingTabStrip —— 强大、可定制、易扩展的 ViewPager 指示器框架。是ViewPagerIndicator、TabLayout、PagerSlidingTabStrip的最佳替代品。支持角标,更支持在非ViewPager场景下使用(使用hide()、show()切换Fragment或使用setVisibility切换FrameLayout里的View等),http://www.jianshu…
Stars: ✭ 8,969 (+2499.71%)
Mutual labels: viewpager, tablayout
ViewWorld
自定义View合集,展示各种自定义View/控件。项目包含了自定义Banner轮播图控件,自定义验证码输入框,自定义TabLayout等控件,持续更新中😉😉😉
Stars: ✭ 94 (-72.75%)
Mutual labels: viewpager, tablayout
Whatsappviewpager
Swipeable tabs like WhatsApp in Android
Stars: ✭ 115 (-66.67%)
Mutual labels: viewpager, tablayout
PagerSlidingTabStrip
An interactive indicator to navigate between the different pages of a ViewPager
Stars: ✭ 2,194 (+535.94%)
Mutual labels: viewpager, tablayout
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (-83.77%)
Mutual labels: viewpager, tablayout
tablayout-ext
⭐🎉google 原生 Tablayout( com.google.android.material.tabs.TabLayout) 零入侵拓展,帮你更便捷的使用原生TabLayout实现一些UI效果
Stars: ✭ 69 (-80%)
Mutual labels: tablayout
Reside-Menu
By applying viewpager animation you can also make AMAZING Reside Menu's
Stars: ✭ 72 (-79.13%)
Mutual labels: viewpager
ChangeTabLayout
ChangeTabLayout是模仿乐视LIVE App主界面TabLayout效果。
Preview
原效果图
原效果图转为Gif过大,所以将录制的MP4效果视频已经放入了根目录的preview文件夹内,有兴趣可去查看。
实现效果图
ChangeTabLayout
在打开状态时
- 垂直方向切换时,文字的颜色大小变化。
- 水平方向切换时,文字的渐变与图片的变化。
ChangeTabLayout
在收起状态时
- 垂直方向切换时,图片的变化。
- 点击
ChangeTabLayout
,切换为打开状态。
使用说明
因为使用场景的局限性等原因,暂时不上传至Maven中心仓库中,仅提供参考学习用途。
xml使用部分
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.VerticalViewPager
android:id="@+id/viewpager"
android:background="@color/bg"
android:layout_width="match_parent"
android:fadingEdge="none"
android:overScrollMode="never"
android:layout_height="match_parent"/>
<com.github.zl.changetablayout.ChangeTabLayout
android:id="@+id/tabLayout"
android:layout_width="110dp"
android:layout_height="match_parent"/>
</FrameLayout>
代码使用部分
VerticalViewPager mViewPager = (VerticalViewPager) this.findViewById(R.id.viewpager);
//只传入自己想要变化的图片,颜色属性生效
mTabLayout.setViewPager(mViewPager, icon, null);
//传入默认图片与选中图片,颜色属性不生效
mTabLayout.setViewPager(mViewPager, iconDefault, iconSelected);
//监听TabLayout点击事件
mTabLayout.setOnTabClickListener(new ChangeTabLayout.OnTabClickListener() {
@Override
public void onTabClicked(int position) {
}
});
//出入水平方向Page滚动参数,实现TabLayout的收缩效果(可选)
mTabLayout.setPageScrolled(page, position, positionOffset);
属性说明
xml | 默认值 | 说明 |
---|---|---|
app:ctl_tabViewColor | 默认为#161616 | Tab背景颜色 |
app:ctl_indicatorColor | 默认为#70000000 | 指示器背景色 |
app:ctl_leftBorderColor | 默认为#cf212b | 指示器左侧竖条颜色 |
app:ctl_tabViewHeight | 默认为50dp | Tab高度 |
app:ctl_tabImageHeight | 默认为18dp | Tab中图片高度(宽度) |
app:ctl_tabViewShadowColor | 默认为#161616 | Tab收起时阴影颜色 |
app:ctl_indicatorPadding | 默认为4dp | 指示器与Tab的上下边距之和 |
app:ctl_defaultTabTextSize | 默认为14sp | Tab中文字默认大小 |
app:ctl_leftBorderThickness | 默认为3dp | 指示器左侧竖条宽度 |
app:ctl_defaultTabTextColor | 默认为#494949 | Tab中文字默认颜色 |
app:ctl_selectedTabTextColor | 默认为#ffffff | Tab中文字选中颜色 |
app:ctl_defaultTabImageColor | 默认为#494949 | Tab中图片默认颜色 |
app:ctl_selectedTabImageColor | 默认为#cf212b | Tab中图片选中颜色 |
实现过程
具体参考这篇博客:ChangeTabLayout实现过程
TODO
TabView
中兼容多行文字。竖屏状态下ViewPage
的onPageScrolled
监听不正常。
Thanks For
- https://github.com/ogaclejapan/SmartTabLayout
- https://github.com/castorflex/VerticalViewPager
- https://gist.github.com/rharter/34051da57f8a6a0991ff
License
Copyright 2017 simplezhli
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.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].