Giter Club home page Giter Club logo

Comments (7)

JessYanCoding avatar JessYanCoding commented on August 17, 2024

感谢兄弟的提醒,但你关注的东西 AndroidAutoSize 都已经具备,你可能还没使用过 AndroidAutoSize,所以还不了解这个框架,AndroidAutoSize 其实不只能使用以宽作为基准,每个 Activity 甚至每个 Fragment 都可以自定义以高还是宽为基准,以及使用不同的设计图尺寸,应用到你上面的需求无非就是在自定义的时候加个判断条件,可以先看下 Demo 了解下这个框架

from androidautosize.

houziershi avatar houziershi commented on August 17, 2024

是的。 AndroidAutoSize 已经具备。

from androidautosize.

JessYanCoding avatar JessYanCoding commented on August 17, 2024

你说的 AndroidScreenAdaptation 这个框架,我之前看过源码,本身原理和 AndroidAutoLayout 非常相似,它是遍历 View Tree,挨个设置所有 View 的属性,本身是有性能损耗的,但 AndroidAutoSize 不会有性能损耗,使用也比 AndroidScreenAdaptation 简单,在加上新增的副单位解决了,修改 density 所造成的对三方库和系统控件的影响,可以说是目前性价比最高的屏幕适配方案

from androidautosize.

houziershi avatar houziershi commented on August 17, 2024

是的。头条方案本身因为:一次修改,全局改变。后期维护无所适从。假如一处 UI 出问题了,你打算怎么改?你没法改,而且旧项目 UI 全都变了。所以才会放弃。 AndroidScreenAdaptation 这个框架,我使用后的总结是:放弃这个项目吧,不值得。光是缺点,你都改不过来。
对于你的这个项目: 我觉的最大的好处是解决了一次修改,全局改变的问题,利于修改和维护。这个方案这个时候就很值得推荐和使用了。同时,它还能自定义以宽或者高为维度进行适配。

from androidautosize.

JessYanCoding avatar JessYanCoding commented on August 17, 2024

其实只要能自定义设计图尺寸和高宽基准,就基本不会出现问题了,在加上现在框架支持 pt、in、mm 这个三个冷门单位布局,不会再影响其他使用 dp 布局的三方库控件或系统控件,问题无非就是有时候由于某些原因导致 DisplayMetrics 的修改被重置,这时在必要的时间点设置回来即可,方案不可能完美,只可能用的人多,让框架尽可能完美,不过现在这个方案的最大优点就是开发成本极低,如果按利弊来分析,可以说是目前性价比最高的方案

from androidautosize.

chenxi0203 avatar chenxi0203 commented on August 17, 2024

这样又会带来一个问题,如果以后要替换适配库那还不得改死,每个地方的单位都得变。

from androidautosize.

JessYanCoding avatar JessYanCoding commented on August 17, 2024

@chenxi0203 对,所以 AndroidAutoSize 可以同时支持 dp,sp 以及副单位,想使用哪个单位都可以自由选择,没有完美的方案,只可能选择一个最适合自己的方案,你要减轻工作量避免影响其他三方库就用副单位,想要低侵入性就用 dp

from androidautosize.

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.