Square 利用 Compose 提高了工作效率
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Square 可帮助数百万卖家经营业务,从安全的信用卡处理到销售点解决方案,再到设置免费网店,应有尽有。Square 一直在向声明式界面迁移,但他们没有继续构建自己的框架,而是决定改用 Jetpack Compose,这样既避免了维护费用,又可以利用它在 Android 视图系统上带来的改进。
策略
Square 团队开始使用 Compose 构建其设计系统,目标是让其设计系统团队和产品工程师能够更快地开展工作。
由于其应用已采用单向数据流架构进行整理,因此“产品工程师可以非常轻松地一次性替换一个屏幕中的 Compose 代码。”在采用 Compose 的过程中,他们发现“有时它几乎简单到让人觉得应该更复杂一些。一切就是可以正常工作。”
结果
“使用 Compose,我们可以专注于 Square 和界面基础架构中独特的东西,而不用解决构建声明性界面框架方面的更广泛问题。”
工程团队发现,Compose 提高了他们的工作效率,使代码更易于推理、整理和编写,而 Android Studio 工具则为他们节省了大量时间。
“设置组件样式更简单、更快速。查看复杂组件的代码也更轻松。在 Compose 中,代码更易于整理,也更易于阅读。Compose 的布局系统在概念上更简单,因此可以更轻松地推断。在构建组件时,预览功能可节省大量时间。”
开始使用
详细了解 Compose。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2021-07-28。
[null,null,["最后更新时间 (UTC):2021-07-28。"],[],[],null,["# Square sees increase productivity with Compose\n\n[Square](https://squareup.com/) helps millions of sellers run their\nbusiness -- from secure credit card processing to point of sale solutions to\nsetting up a free online store. Square has been moving to declarative UI for\na while but rather than continuing to build their own framework, they decided to move to\nJetpack Compose, avoiding the maintenance costs and taking advantage of the\nimprovements it brings over the Android Views system.\n\nWhat they did\n-------------\n\nThe Square team started building their design system in Compose, with the goal\nof enabling their design system team and product engineers to move faster.\nBecause their app is already organised with a unidirectional data flow\narchitecture, *\"It's really easy for product engineers to swap in Compose one\nscreen at a time.\"* While adopting Compose, they've seen that *\"sometimes it's\nalmost so simple you expect it to be more complicated. **Things just work.**\"*\n\nResults\n-------\n\n*\"By using Compose, we can **focus on things that are unique to Square** and our UI\ninfrastructure, rather than solving the broader issue of building a\ndeclarative UI framework.\"*\n\nThe engineering team found that Compose improved their productivity, making the\ncode easier to reason about, organise, and write, and the Android Studio\ntooling saved them a lot of time.\n\n*\"It's **simpler and faster to style components** . Reading the code for complicated\ncomponents is easier as well. It's **easier to organize code and make it\nreadable** in Compose. The layout system of Compose is conceptually simpler so\nit's **easier to reason about. Previews are a big time saver** when building\ncomponents.\"*\n\nGet started\n-----------\n\nLearn more about [Compose](/jetpack/compose)."]]