百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

FlycoTabLayout

> 编程语言
开源

一个 Android TabLayout 库

11.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 Android TabLayout 库

FlycoTabLayout

中文版

An Android TabLayout Lib has 3 kinds of TabLayout at present.

  • SlidingTabLayout: deeply modified from PagerSlidingTabStrip.

    • new added attribute
    • new added kinds of indicators
    • new added unread msg tip
    • new added method for convenience
    java
        /** no need to set titles in adapter */
        public void setViewPager(ViewPager vp, String[] titles)
        
        /** no need to initialize even adapter */
        public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList<Fragment> fragments) 
  • CommonTabLayout:unlike SlidingTabLayout's dependence on ViewPager,it is a tabLayout without dependence on ViewPager and can be used freely with other widgets together.

    • support kinds of indicators and indicator animation
    • support unread msg tip
    • support icon and icon gravity.
    • new added method for convenience
    java
        /** support switch fragments itself */
        public void setTabData(ArrayList<CustomTabEntity> tabEntitys, FragmentManager fm, int containerViewId, ArrayList<Fragment> fragments)
  • SegmentTabLayout

Demo

Change Log

3.0.0 (2021-09-30)

  • upgrade to AndroidX
  • publish on Maven Central

Gradle

groovy
// AndroidX
dependencies {
    implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
}

// Old
dependencies{
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
}

Attributes

name format description
tl_indicator_color color set indicator color
tl_indicator_height dimension set indicator height
tl_indicator_width dimension set indicator width
tl_indicator_margin_left dimension set indicator margin,invalid when indicator width is greater than 0.
tl_indicator_margin_top dimension set indicator margin,invalid when indicator width is greater than 0.
tl_indicator_margin_right dimension set indicator margin,invalid when indicator width is greater than 0.
tl_indicator_margin_bottom dimension set indicator margin,invalid when indicator width is greater than 0.
tl_indicator_corner_radius dimension set indicator corner radius
tl_indicator_gravity enum set indicator gravity TOP or BOTTOM.
tl_indicator_style enum set indicator style NORMAL or TRIANGLE or BLOCK
tl_underline_color color set underline color
tl_underline_height dimension set underline height
tl_underline_gravity enum set underline gravity TOP or BOTTOM
tl_divider_color color set divider color
tl_divider_width dimension set divider width
tl_divider_padding dimension set divider paddingTop and paddingBottom
tl_tab_padding dimension set tab paddingLeft and paddingRight
tl_tab_space_equal boolean set tab space equal
tl_tab_width dimension set tab width
tl_textsize dimension set text size
tl_textSelectColor color set text select color
tl_textUnselectColor color set text unselect color
tl_textBold boolean set text is bold
tl_iconWidth dimension set icon width(only for CommonTabLayout)
tl_iconHeight dimension set icon height(only for CommonTabLayout)
tl_iconVisible boolean set icon is visible(only for CommonTabLayout)
tl_iconGravity enum set icon gravity LEFT or TOP or RIGHT or BOTTOM(only for CommonTabLayout)
tl_iconMargin dimension set icon margin with text(only for CommonTabLayout)
tl_indicator_anim_enable boolean set indicator support animation(only for CommonTabLayout)
tl_indicator_anim_duration integer set indicator animation duration(only for CommonTabLayout)
tl_indicator_bounce_enable boolean set indicator aniamtion with bounce effect(only for CommonTabLayout)
tl_indicator_width_equal_title boolean set indicator width same as text(only for SlidingTabLayout)

Dependence

  • NineOldAndroids
  • FlycoRoundView

Thanks

  • PagerSlidingTabStrip

Issues· 369 开放

查看全部 Issues在 GitHub 打开
  • #559

    NullPointerException 错误,代码行数:CommonTabLayout.calcIndicatorRect (CommonTabLayout.java:355)

    更新于 2025年12月25日
  • #566

    使用 AndroidX,你会发现很多东西在 xml 文件中已经设置好了,但并没有生效。

    更新于 2025年9月5日
  • #564

    拦截选中操作

    更新于 2025年7月2日
  • #510

    动态渲染的标签数量和标签宽度指示器未更新的问题

    更新于 2025年4月18日
  • #562

    代码拉一下,又无法通过 Gradle 编译了,别坑我了!!!(我使用的是 Android Studio | 2024.2.2)

    更新于 2025年3月25日
  • #563

    样式和 demo 不同。

    更新于 2025年3月11日
  • #560

    CommonTabLayout 多次嵌套 CommonTabLayout 后长时间后台回白屏

    更新于 2024年5月12日
  • #558

    动态修改底部标签数量

    更新于 2024年4月27日
  • #557

    在 Fragment 中无法使用建议:SlidingTabLayout 的 setViewPager 参数,将 FragmentActivity 更改为 FragmentManager

    更新于 2024年1月26日
  • #556

    支持 viewpage2

    更新于 2024年1月19日

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言