Coder Social home page Coder Social logo

xtablayout's Introduction

XTabLayout

Copy of TabLayout add support for adjusting width of Indicator.

主要对比集中修改TabLayout的Indicator的width的方法优缺点。

针对两种反射版本会压缩Tab边距的方式,采取最好的改源码的方式来支持TabLayout的Indicator的宽度的自定义。

添加,支持TabLayout的Indicator的width的自定义。

<declare-styleable name="XTabLayout">
        <attr name="indicatorPadding" format="dimension"/>
        <attr name="xy_tabIndicatorColor" format="color"/>
        <attr name="xy_tabIndicatorHeight" format="dimension"/>
        <attr name="xy_tabIndicatorWidth" format="dimension"/>
        <attr name="xy_tabContentStart" format="dimension"/>
        <attr name="xy_tabBackground" format="reference"/>
        <attr name="xy_tabMode">
            <enum name="scrollable" value="0"/>
            <enum name="fixed" value="1"/>
        </attr>
        <attr name="xy_tabGravity">
            <enum name="fill" value="0"/>
            <enum name="center" value="1"/>
        </attr>
        <attr name="xy_tabMinWidth" format="dimension"/>
        <attr name="xy_tabMaxWidth" format="dimension"/>
        <attr name="xy_tabTextAppearance" format="reference"/>
        <attr name="xy_tabTextColor" format="color"/>
        <attr name="xy_tabSelectedTextColor" format="color"/>
        <attr name="xy_tabPaddingStart" format="dimension"/>
        <attr name="xy_tabPaddingTop" format="dimension"/>
        <attr name="xy_tabPaddingEnd" format="dimension"/>
        <attr name="xy_tabPaddingBottom" format="dimension"/>
        <attr name="xy_tabPadding" format="dimension"/>
    </declare-styleable>

截图:

博客链接:关于TabLayout的indicator宽度的一次探索

xtablayout's People

Contributors

jasongaoh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.