All Projects → loperSeven → tablayout-ext

loperSeven / tablayout-ext

Licence: other
⭐🎉google 原生 Tablayout( com.google.android.material.tabs.TabLayout) 零入侵拓展,帮你更便捷的使用原生TabLayout实现一些UI效果

Programming Languages

kotlin
9241 projects

Labels

Projects that are alternatives of or similar to tablayout-ext

Whatsappviewpager
Swipeable tabs like WhatsApp in Android
Stars: ✭ 115 (+66.67%)
Mutual labels:  tablayout
Apporder
骚操作之改造TabLayout,修改指示线宽增加切Tab过渡动画
Stars: ✭ 246 (+256.52%)
Mutual labels:  tablayout
GlueTabLayout
能精确修改TabLayout的下划线指示器的宽度,能使用粘动动画。
Stars: ✭ 39 (-43.48%)
Mutual labels:  tablayout
Pagerslidingtabstrip
一款android指示器TabLayout、PagerSlidingTabStrip,仿Boss直聘,带有红点未读提示
Stars: ✭ 152 (+120.29%)
Mutual labels:  tablayout
Tabscrollattacher
Attach TabLayout and RecyclerView. Useful for categorizing RecyclerView items.
Stars: ✭ 196 (+184.06%)
Mutual labels:  tablayout
UltimateTabLayout
A library for tab layout use with viewpager. Very useful, small
Stars: ✭ 33 (-52.17%)
Mutual labels:  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 (+12898.55%)
Mutual labels:  tablayout
un-material-tab
(deprecated) Custom tab layout which can be used as a material TabLayout alternative and contains basic functionality which Google's TabLayout has.
Stars: ✭ 83 (+20.29%)
Mutual labels:  tablayout
Jpagerslidingtabstrip
🔥A useful tablayout modify from astuetz/PagerSlidingTabStrip
Stars: ✭ 233 (+237.68%)
Mutual labels:  tablayout
PagerSlidingTabStrip
An interactive indicator to navigate between the different pages of a ViewPager
Stars: ✭ 2,194 (+3079.71%)
Mutual labels:  tablayout
Android Video Listing Mvp
Android video listing with swipe view tabs based on mvp design pattern with complete functionalities like search and sort
Stars: ✭ 151 (+118.84%)
Mutual labels:  tablayout
Android Tablayouthelper
A small library which helps to use TabLayout with ViewPager more easily.
Stars: ✭ 181 (+162.32%)
Mutual labels:  tablayout
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (-18.84%)
Mutual labels:  tablayout
Universal Collapsingtablayout
CollapsingToolbarLayout with TabLayout
Stars: ✭ 118 (+71.01%)
Mutual labels:  tablayout
multilayout
一个可以支持自动将分类标签拆分多行Tab标签的Layout
Stars: ✭ 14 (-79.71%)
Mutual labels:  tablayout
Tabbar
🔥空祖家的导航栏工具
Stars: ✭ 100 (+44.93%)
Mutual labels:  tablayout
ViewWorld
自定义View合集,展示各种自定义View/控件。项目包含了自定义Banner轮播图控件,自定义验证码输入框,自定义TabLayout等控件,持续更新中😉😉😉
Stars: ✭ 94 (+36.23%)
Mutual labels:  tablayout
BottomNavigationView
Bottom Navigation Example
Stars: ✭ 15 (-78.26%)
Mutual labels:  tablayout
JSTabLayout
简书tablayout
Stars: ✭ 29 (-57.97%)
Mutual labels:  tablayout
TabSync
A lightweight synchronizer between Android's Tabs and Lists. Available on the View system and Jetpack Compose.
Stars: ✭ 98 (+42.03%)
Mutual labels:  tablayout


API

Language

中文 | English

google 原生 Tablayout( com.google.android.material.tabs.TabLayout) 零入侵拓展,帮你更便捷的使用原生TabLayout实现一些UI效果

预览


无法加载可前往 简书掘金查看

如何引入

Step 1. 添加 JitPack repository

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Step 2. 添加 Gradle依赖

dependencies {
    ...
    implementation 'com.google.android.material:material:1.2.1'//google material 包
    implementation 'com.github.loperSeven:tablayout-ext:0.1.3'//  最新版本请看顶部jitpack标识,仅支持androidx
}


如何使用

注意:此库只是针对Tablayout做一些便捷性拓展,具体Tablayout属性及用法请查阅:developers 文档

Indicator

  /**
    * 线性指示器
    * buildIndicator<> 指定指示器类
    * setHeight() 设置指示器高度,默认为tablayout指定tabIndicatorHeight高度
    * setWidth() 设置指示器宽度,若tablayout设置了tabIndicatorFullWidth=true,则默认为tab项宽度,否则为tab实际文字宽度
    * setGravity() 等同于 Tablayout.setSelectedTabIndicatorGravity()
    * setColor() 等同于 Tablayout.setSelectedTabIndicatorColor()
    */
 tabLayout.buildIndicator<LinearIndicator>()
            .setHeight(22.toPx())
            .setWidth(BaseIndicator.MATCH)
            .setGravity(TabLayout.INDICATOR_GRAVITY_TOP)
            .setColor(ContextCompat.getColor(context!!,R.color.colorAccent))
            .bind()
 /**
    * 三角形指示器
    * buildIndicator<> 指定指示器类
    * setPath 设置三角形样式 [POSITIVE]正 [NEGATIVE] 反
    */
 tabLayout.buildIndicator<TriangleIndicator>()
            .setPath(TriangleIndicator.Path.NEGATIVE)//因path为该指示器专有属性,故需先于其他属性调用。
            .setWidth(10.toPx())
            .setHeight(10.toPx())
            .setColor(ContextCompat.getColor(context!!,R.color.colorAccent))
            .setGravity(TabLayout.INDICATOR_GRAVITY_TOP)
            .bind()
	    
 /**
    * 自定义deawable指示器
    * buildIndicator<> 指定指示器类
    * setDrawable 设置指示器drawable 可传入 Drawable 或 @DrawableRes resId:Int
    * 其他属性同上,皆为基础属性
    */
  tabLayout.buildIndicator<CustomIndicator>()
            .setDrawable(ContextCompat.getDrawable(context!!,R.mipmap.ic_indicator_fire)!!)
            .bind()
	    

如需拓展更多类型指示器,只需继承自BaseIndicator,添加专属属性,在bind()方法中实现逻辑即可。

Text

 /**
    * tab文字设置
    * buildText<> 指定文字设置类
    * setNormalTextBold() 未选中状态下文字是否加粗  默认false
    * setSelectTextBold() 选中状态下文字是否加粗 默认true
    * setNormalTextSize() 未选中状态下文字大小 默认14f(单位sp)
    * setSelectTextSize() 选中状态下文字大小 默认14f(单位sp)
    */
  tabLayout.buildText<BaseText>()
            .setNormalTextBold(true)
            .setSelectTextBold(true)
	    .setNormalTextSize(16f)
            .setSelectTextSize(18f)
            .bind()

更新计划

  • Indicator 动画拓展
  • Text 文字大小设置

您的star是我更新的动力

混淆

-dontwarn com.loper7.tablayout-ext.**
-keep class com.loper7.tablayout-ext.**{*;}

联系我

Issues:Issues
邮箱:[email protected]

Licenses

Copyright 2020 loperSeven

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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].