تنشئ Monzo تطبيقًا أكثر فعالية وجودة باستخدام Compose
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
Monzo هو مصرف وتطبيق يقدّمان خدمات مالية رقمية. مهمتهم هي جعل المال يعمل لصالح الجميع. بدأ نظام تصميم Monzo في الانحراف عن Material Design، لذا أرادوا طريقة سهلة لكتابة المكوّنات المخصّصة والحفاظ عليها التي تتطوّر باستمرار، فاختاروا Jetpack Compose.
الإجراءات التي اتخذتها الشركة
باستخدام Compose، يتم توفير مكونات Material Design كطبقة فوق واجهات برمجة التطبيقات الأساسية المستقلة عن نظام التصميم. استخدمت شركة Monzo واجهات برمجة التطبيقات الأساسية لإنشاء مكتبة المكوّنات الخاصة بها، مع الاستعانة بمكوّنات Material كمراجع. وقد بدأوا بنقل شاشة واحدة في كل مرة، وأصبحوا الآن يستخدمون Compose في جميع الشاشات الجديدة.
يستخدم جميع مهندسي Android حاليًا Compose في مرحلة الإنتاج: "لم تواجهنا أي مشاكل كبيرة، لذا شعرنا بثقة كافية لبدء استخدامها في بعض الميزات الجديدة المحدّدة، ثم في جميع الميزات الجديدة".
النتائج
أنشأ فريق Monzo مكوّنات تتيح له إنشاء شاشات جديدة بسهولة: "المكوّنات التي نوفّرها جاهزة للاستخدام تجعل عملية إنشاء شاشة أثناء تعلُّم Compose تجربة أكثر سلاسة. تُعدّ واجهات برمجة التطبيقات المستندة إلى الخانات نموذجًا رائعًا يسهّل علينا إنشاء مكونات أكبر من خلال الكثير من الوحدات الأساسية الصغيرة".
باستخدام Compose، تمكّن فريق Monzo من إنشاء تطبيق عالي الجودة، وإضافة ميزات رائعة لم يتمكّنوا من إضافتها في إصداراتهم السابقة: "أحد الأمثلة على ذلك هو الرسوم المتحركة، فمن السهل جدًا إضافتها في Compose، ولا يوجد سبب يمنع إضافة رسوم متحركة، مثل تغييرات الألوان أو الأحجام أو الارتفاعات. وغالبًا ما يكون من الصعب جدًا تنفيذ هذه الرسوم المتحركة التي "من الجيد توفّرها"، ولا تستحق الجهد والتعقيد في نظام View".
أصبح الرمز البرمجي أقصر وأسهل في القراءة والفهم والصيانة: "الرمز البرمجي التعريفي أسهل بكثير في الفهم من الرمز البرمجي الذي يتلاعب بتسلسل هرمي قابل للتغيير لواجهة المستخدم. من الأسهل أيضًا تتبُّع الرموز
عندما تكون مكتوبة كلها باللغة نفسها وفي الملف نفسه غالبًا، بدلاً من
التنقّل ذهابًا وإيابًا بين Kotlin وXML. ولا أريد حتى أن أتحدث عن سمات XML وأنماطها. أصبح من الأسهل بكثير فهم تصميم السمات في Compose. لا يتضمّن المظهر سوى الخصائص التي نحدّدها، وتكون القيم متسقة على جميع الأجهزة، وبما أنّه مكتوب بلغة Kotlin، يسهل البحث عنه وتتبّعه في بيئة التطوير المتكاملة.
أتاحت Compose لفريق Monzo إمكانية اختبار التطبيق بسهولة والتأكّد من إمكانية استخدامه: "لقد ساعدتنا في كتابة اختبارات أقل عرضة للأخطاء، وتنفيذها بشكل موثوق،
ومنحتنا ثقة كبيرة في أنّ تطبيقنا يعمل بشكل جيد لدى المستخدمين. يضمن الاختبار من خلال نظام الدلالات أيضًا أنّ شاشاتنا يمكن الوصول إليها بشكل معقول تلقائيًا على الأقل".
البدء
مزيد من المعلومات حول ميزة "إنشاء"
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2021-07-28 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2021-07-28 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["[Monzo](https://monzo.com/) is a bank and app offering\ndigital financial services. Their mission is to make money work\nfor everyone. Monzo's design system started to deviate from Material Design so\nthey wanted an **easy way to write and maintain custom components** that are\nconstantly evolving---so they chose Jetpack Compose.\n\nWhat they did\n\nWith Compose the Material Design components are provided as a layer over the\ndesign-system-agnostic foundation APIs. Monzo used the foundation APIs to build\ntheir own component library, using the Material components as reference. They\nstarted by migrating a screen at a time, now using Compose in all new screens.\nNow, Compose is used in production, by all of the Android engineers: *\"We\ndidn't encounter any major problems, and so we felt confident enough to start\nusing it for some select new features, and eventually for all new features.\"*\n\nResults\n\nThe Monzo team created components that enable them to easily build new\nscreens: *\"The components we provide out of the box make building a screen\nwhile learning Compose a **much smoother experience**. The slot-based APIs is a\nfantastic pattern that makes it really easy for us to build larger components\nout of lots of small building blocks.\"*\n\nWith Compose, the Monzo team were able to build a higher quality app, adding\ndelightful features that previously they couldn't get to in their\nsprints: *\"One example is animations - they're so easy to add in Compose that\n**there's very little reason not to animate things** like color/size/elevation\nchanges. These 'nice to have' animations are often too difficult to be worth\nthe effort and complexity in the View system.\"*\n\nTheir code is now shorter, and it's easier to read, understand, and\nmaintain: *\"Declarative code is **much easier to reason about** than code that\nmanipulates a mutable UI hierarchy. It's also much **easier to trace through code**\nwhen it's all written in the same language and often the same file, rather than\njumping back and forth between Kotlin and XML. Don't even get me started on XML\nthemes and styles! **Theming is a lot easier to understand** in Compose. Our theme\nonly consists of the properties we define, the values are consistent across\ndevices, and because it's in Kotlin it is really easy to search and follow in\nthe IDE.\"*\n\nCompose allowed the Monzo team to easily test their app and ensure their app is\naccessible: *\"It's helped us **write tests that are less fragile, run reliably,\nand give us a lot of confidence** that our app actually works in the hands of our\nusers. Testing through the semantics system also ensures that our screens are\nat least reasonably **accessible by default**.\"*\n\nGet started\n\nLearn more about [Compose](/jetpack/compose)."]]