Cuvva สร้างได้เร็วขึ้นและมีคุณภาพสูงขึ้นด้วยการเขียน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Cuvva กำลังทำให้การประกันภัยดีขึ้นอย่างมาก
ด้วยการมอบวิธีที่ยืดหยุ่นอย่างแท้จริงในการจัดการความคุ้มครอง ทั้งหมดนี้ทำได้จากโทรศัพท์
วิศวกร Android ที่ Cuvva ได้ใช้เวลาในการปรับโครงสร้างแอป
และตัดสินใจใช้การไหลของข้อมูลแบบทิศทางเดียวและ Jetpack Compose ซึ่งจะช่วยให้เปลี่ยนจากระบบการออกแบบที่อิงตาม View ที่กำหนดเอง ซึ่งทำงานช้ากว่า ใช้งานยากกว่า และคาดเดาได้น้อยกว่าใน Android เวอร์ชันเก่า
สิ่งที่พวกเขาทำ
ทีม Cuvva สร้างคอมโพเนนต์การออกแบบใหม่ตั้งแต่ต้น จากนั้นใช้
API การทำงานร่วมกันเพื่อวาง Composable ภายในเลย์เอาต์ที่มีอยู่ และเมื่อเวลาผ่านไป
จะแทนที่หน้าจอที่อิงตาม View และสร้างหน้าจอใหม่ด้วย Compose "เราพบว่า Compose ช่วยให้เราสร้างคอมโพเนนต์การออกแบบใหม่ๆ ตั้งแต่ต้นได้รวดเร็วยิ่งขึ้นและใช้เวลาน้อยลงในการพยายามหลีกเลี่ยงการจัดการสถานะหรือการแยกส่วน เมื่อเราสร้างคลังคอมโพเนนต์เหล่านี้จนมีขนาดใหญ่พอ
การเปิดตัวหน้าจอใหม่ก็ทำได้อย่างรวดเร็ว และช่วยให้เรา
ทำงานได้อย่างมีประสิทธิภาพมากขึ้นอย่างแน่นอน"
ผลลัพธ์
Compose ช่วยให้ทีมสร้างแอปที่มีคุณภาพสูงขึ้นได้เร็วขึ้น "ความเร็วที่ Compose ช่วยให้เราสามารถสร้างฟีเจอร์ใหม่ๆ หมายความว่าเราสามารถทำซ้ำได้อย่างรวดเร็วมากขึ้น ซึ่งจะช่วยให้ลูกค้าได้รับประสบการณ์การใช้งานที่มีคุณภาพสูงขึ้นได้เร็วกว่าแต่ก่อน"
Compose ช่วยลดจำนวนบรรทัดที่คุณต้องเขียนและอ่าน
ทำความเข้าใจ และบำรุงรักษาได้ "เรายินดีเป็นอย่างยิ่งที่ได้เห็นว่าต้องใช้โค้ดเพียงไม่กี่บรรทัด
ในการสร้างรายการหรือภาพเคลื่อนไหวในแอปของเรา Compose ช่วยลดจำนวนบรรทัดของโค้ดที่จำเป็นในการสร้าง UI ของเราได้อย่างมาก"
ติดตั้งใช้งานคอมโพเนนต์ที่กำหนดเองได้ง่ายขึ้น: "เราสร้างคอมโพเนนต์หน้าปัดวงกลม
ซึ่งใช้เพื่อแสดงคะแนนการขับขี่แก่ลูกค้า การสร้างภาพเคลื่อนไหวความคืบหน้าและสีด้วย Compose นั้นง่ายกว่าและสนุกกว่ามากเมื่อเทียบกับวิธีเดิม การทำสิ่งต่างๆ แบบกำหนดเอง ไม่ว่าจะเป็นคอมโพเนนต์ใหม่หรือการเปลี่ยนลักษณะการทำงานของคอมโพเนนต์ที่มีอยู่ ก็ทำได้ง่ายกว่ามากใน Compose"
เริ่มต้นใช้งาน
ดูข้อมูลเพิ่มเติมเกี่ยวกับฟีเจอร์เขียน
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2021-07-28 UTC
[null,null,["อัปเดตล่าสุด 2021-07-28 UTC"],[],[],null,["# Cuvva builds faster and with higher quality with Compose\n\n[Cuvva](https://www.cuvva.com/) is making insurance radically better\nby giving you a truly flexible way to manage your cover, all from your phone.\nThe Android engineers at Cuvva got to spend some time re-architecting their app\nand decided to adopt a unidirectional data flow and Jetpack Compose. That way\nthey could **move away from their custom View based design system**, which was\nslower and harder to work with, and less predictable on older versions of\nAndroid.\n\nWhat they did\n-------------\n\nThe Cuvva team created new design components from scratch, then used the\ninteroperability APIs to place Composables inside existing layouts and, with\ntime, replace View-based screens and build new screens with Compose. *\"We found\nthat Compose lets us create new design components from scratch **much more\nrapidly** and spend less time trying to work around state management or\nfragmentation. Once we had built up a large enough library of these components,\nshipping a new screen became very fast, and it has definitely helped us to be\nmore productive.\"*\n\nResults\n-------\n\nCompose allowed them to build a higher quality app faster: *\"The speed at which\nCompose allows us to put together a new feature means **we can iterate more\nrapidly, providing a higher-quality experience** for our customers faster than\nbefore.\"*\n\nWith Compose the number of lines you need to write, and therefore read,\nunderstand, and maintain, decreases: *\"we were very pleased to see how few lines\nwere required to create lists or animations in our app. Compose has definitely\n**dramatically reduced the number of lines of code** required to build our UI.\"*\n\nCustom components are easier to implement: *\"We created a circular dial\ncomponent which is used to show customers their driving score. **Animating** its\nprogress and colours with Compose was **far easier and a lot more fun** than it\nwould have been previously. Doing anything custom, whether that's new\ncomponents or changing the behaviour of existing ones, is far easier in\nCompose.\"*\n\nGet started\n-----------\n\nLearn more about [Compose](/jetpack/compose)."]]