יוצרים ריבועים בעזרת הניסוח האוטומטי
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Square עוזרת למיליוני מוכרים לנהל את העסק שלהם – מעיבוד מאובטח של כרטיסי אשראי ועד פתרונות לנקודות מכירה והקמת חנות אונליין בחינם. ב-Square עברו לממשק משתמש הצהרתי כבר לפני זמן מה, אבל במקום להמשיך לבנות את המסגרת שלהם, הם החליטו לעבור ל-Jetpack Compose כדי להימנע מעלויות התחזוקה ולנצל את השיפורים שהוא מציע בהשוואה למערכת Android Views.
מה הם עשו
הצוות של Square התחיל לבנות את מערכת העיצוב שלו ב-Compose, במטרה לאפשר לצוות מערכת העיצוב ולמהנדסי המוצר לעבוד מהר יותר.
האפליקציה שלהם כבר מאורגנת עם ארכיטקטורה של זרימת נתונים חד-כיוונית, ולכן “מהנדסי המוצר יכולים להחליף מסך אחד בכל פעם ב-Compose בקלות רבה”. במהלך ההטמעה של Compose, הם ראו ש“לפעמים זה כל כך פשוט שאתה מצפה שזה יהיה יותר מסובך. הדברים פשוט עובדים.”
תוצאות
"בעזרת Compose, אנחנו יכולים להתמקד בדברים הייחודיים ל-Square ולתשתית של ממשק המשתמש שלנו, במקום לפתור את הבעיה הרחבה יותר של בניית מסגרת הצהרתית לממשק משתמש".
צוות ההנדסה גילה ש-Compose שיפר את הפרודוקטיביות שלו, והקל על ניתוח, ארגון וכתיבה של הקוד. בנוסף, כלי Android Studio חסכו לצוות הרבה זמן.
“קל ומהיר יותר לעצב רכיבים. גם קל יותר לקרוא את הקוד של רכיבים מורכבים. ב-Compose קל יותר לארגן את הקוד ולקרוא אותו. מערכת הפריסה של Compose פשוטה יותר מבחינה רעיונית, ולכן קל יותר להבין אותה. תצוגות מקדימות חוסכות הרבה זמן כשיוצרים רכיבים".
שנתחיל?
מידע נוסף על כתיבת הודעות
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2021-07-28 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2021-07-28 (שעון UTC)."],[],[],null,["[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\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*\"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\nLearn more about [Compose](/jetpack/compose)."]]