GithubHelp home page GithubHelp logo

缺少 TintTabLayout about magicasakura HOT 2 CLOSED

bilibili avatar bilibili commented on July 20, 2024
缺少 TintTabLayout

from magicasakura.

Comments (2)

xyczero avatar xyczero commented on July 20, 2024

我的设想是作为一个UI库,核心的构成代码是封装的在库中的,不允许外部调用,原因如下:

  • 如果类似如loadFromAttribute方法外部可以随意调用,那么需要自定义控件或扩展系统控件时就可以直接在外部扩展,当这样的外部控件逐渐增多的话,UI库的封装就会变的松散且毫无意义。所以只有使用高频的控件才会被封装在库中,方便外部直接使用,而使用低频的控件在外部自己使用ThemeUtils染色即可。
  • 一些如loadFromAttribut不允许外部调用的方法,除了处理染色功能外,还缓存了相关染色资源,以便在同一个activity中可以达到染色资源复用,节省性能开销的目的。所以使用频次低的控件可以做直接使用ThemeUtils中的方法直接染色即可(一般的使用频次低的控件资源是单独使用的,不会被其他控件使用)。
  • 还有一点是为了便于内部代码的重构优化。如果核心的构成代码暴露给外部调用,当框架重构涉及相关代码时将会变的非常麻烦。如果只在内部调用,那重构就只涉及内部自己的事情了,UI库也可以做到独立的发布。

扩展控件方法:
当在使用过程发现目前封装的系统控件无法满足项目需求时, 你可以:

  • 提issue , 我帮你添加支持
  • 提一个PR
  • 可以自己扩展后打包一个aar内部使用
  • 频次低的控件就直接用ThemeUtils即可 (hemeUtils里提供的染色功能已比较齐全)

from magicasakura.

icris avatar icris commented on July 20, 2024

确实不多,tabLayout 一个界面最多一个,手动变色也可以。

from magicasakura.

Related Issues (20)

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.