ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การโต้ตอบแบบแยกหน้าจอ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใน Android 7.0 ขึ้นไป ผู้ใช้สามารถแสดงแอปหลายแอปพร้อมกันบนหน้าจออุปกรณ์ได้ด้วยฟีเจอร์หลายหน้าต่างของแพลตฟอร์ม
โหมดเริ่มต้นคือโหมดแยกหน้าจอ ซึ่งมีแผงกิจกรรม 2 แผงเพื่อให้ผู้ใช้วางแอป
Android 8.0 ปรับปรุงการแยกหน้าจอด้วยการปรับแต่งฟีเจอร์และเพิ่มฟังก์ชันการทำงาน ในการใช้งานเริ่มต้น หากผู้ใช้แตะหน้าแรกหลังจากเข้าสู่โหมดแยกหน้าจอ แผงด้านบนจะบีบอัดและตัวเปิดแอปจะปรับขนาด วิธีนี้ช่วยให้ผู้ใช้เห็นว่าแอปด้านบนยังเปิดอยู่ขณะที่ยังคงเลย์เอาต์ตัวเปิดแอปเพื่อให้ผู้ใช้ค้นหาและเปิดแอปจากหน้าจอหลักได้
ตัวอย่างและแหล่งที่มา
การใช้งานอ้างอิงสำหรับฟังก์ชันการทำงานใหม่นี้มีอยู่ใน Launcher3
code ใน /platform/packages/apps/Launcher3/
รหัสการเปลี่ยนแปลงเหล่านี้เกี่ยวข้องกับการใช้การแยกหน้าจอใน Launcher3 และใช้เป็นข้อมูลอ้างอิงสำหรับผู้ผลิตอุปกรณ์ที่ต้องการทำการอัปเดตที่คล้ายกันกับ Launcher ได้
- Change-Id:
I48e5cb3bd15e70627d9bf007d93bc731612fba2e
- Change-Id:
I86753bab5b24aafc417e0f77d8c471fc4c0dc7f0
- Change-Id:
Id6557d070edb664aa1f4851de7abf494cf8a0677
- Change-Id:
Icdaf73ecd89a30e57fe7f405292d793f2d6a3ee8
- Change-Id:
Ie50279f4edb94812120dea492aefa4f18218162f
- Change-Id:
I6f9ee7be12d3266f021796576c771f86f6120246
- Change-Id:
I106fe12041565a090047f146a07d4bc80a074b4a
- Change-Id:
Ibb49c56aab29d1223a0ab36476a32d565566eb25
- Change-Id:
Id60c793730d982277c9d91860e9fb0e6a0df7d38
- Change-Id:
I9d358e74ab403989929dee87542d3dde78c2f229
- Change-Id:
I925d5ac9d29439c5d61cf089e7784065a8cb5ebd
- Change-Id:
I776c6f710e081645cff891487022cf787869ee3f
- Change-Id:
I2d17c89db2eb8d60b3393c2abc3b026e5574085d
- Change-Id:
Id6ee68826c4f3cc579880540812fd8ed834f8267
ตัวอย่าง UX
ต่อไปนี้คือตัวอย่างหน้าจอที่แสดงประสบการณ์ของผู้ใช้สำหรับการใช้งานฟีเจอร์นี้โดยค่าเริ่มต้น
รูปที่ 1 ตัวอย่างหน้าจอสำหรับ Launcher
การปรับขนาดในโหมดแยกหน้าจอ
การใช้งาน
แม้ว่า Android 8.0 จะมีการใช้งานอ้างอิงสำหรับการอัปเดตนี้เพื่อใช้โหมดแยกหน้าจอ แต่ผู้ผลิตอุปกรณ์จะเป็นผู้กำหนดการใช้งานในโปรแกรมเปิด วิธีรองรับฟีเจอร์นี้
- ใช้ (หรือมีการใช้งานอยู่แล้ว) ฟีเจอร์หลายหน้าต่างที่เป็นไปตามข้อกําหนดของเอกสารนิยามความเข้ากันได้ (CDD) ของ Android สำหรับหลายหน้าต่าง
- ทำให้ปรับขนาด Launcher ได้ การใช้งานอ้างอิงใน Launcher3 จะนําชื่อแอปออกเมื่อหน้าจอเล็กลง แต่การใช้งานอาจแตกต่างกันไป โดยขึ้นอยู่กับวิธีที่ตัวเปิดใช้บีบอัด โดยเฉพาะอย่างยิ่งหากมีโค้ดตัวเปิดใช้ที่กําหนดเอง
- กำหนดความสูงขั้นต่ำที่ระบุไว้ในไฟล์ Manifest ของ Launcher โดยทำดังนี้
ปรับค่า
task_height_of_minimized_mode
ใน
frameworks/base/core/res/res/values/dimens.xml
การทดสอบ
ใช้การทดสอบด้วยตนเองเพื่อให้แน่ใจว่าการติดตั้งใช้งานทํางานได้อย่างถูกต้อง
- เข้าสู่โหมดแยกหน้าจอ
- กดหน้าแรก
- สังเกตตัวเปิดใช้ที่ปรับขนาดได้
ตรวจสอบว่าตัวเปิดใช้ปรับขนาดอย่างถูกต้องในแนวการวางของอุปกรณ์ทั้งหมดที่รองรับ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 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"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Split-screen interactions\n\nIn Android 7.0 and later, users can have multiple apps simultaneously displayed\non their device screen with the platform feature [multi-window](/docs/core/display/multi-window).\nThe default mode is split-screen, which provides two activity panes for users to\nplace apps.\n\n\nAndroid 8.0 improves split-screen by refining the feature and adding more\nfunctionality to it. In the default implementation, if a user taps\n**Home** after entering split-screen, the top pane compresses and\nthe launcher resizes. This shows users that the top app is still open while\nmaintaining their launcher layout so they can find and launch apps from their\nhome screen.\n\nExamples and source\n-------------------\n\n\nThere is a reference implementation of this new functionality in the Launcher3\ncode in `/platform/packages/apps/Launcher3/`\n\n\nThese Change IDs are related to implementing split-screen in Launcher3, and can\nact as a reference for device manufacturers who want to make similar updates to\ntheir launchers.\n\n- Change-Id: `I48e5cb3bd15e70627d9bf007d93bc731612fba2e`\n- Change-Id: `I86753bab5b24aafc417e0f77d8c471fc4c0dc7f0`\n- Change-Id: `Id6557d070edb664aa1f4851de7abf494cf8a0677`\n- Change-Id: `Icdaf73ecd89a30e57fe7f405292d793f2d6a3ee8`\n- Change-Id: `Ie50279f4edb94812120dea492aefa4f18218162f`\n- Change-Id: `I6f9ee7be12d3266f021796576c771f86f6120246`\n- Change-Id: `I106fe12041565a090047f146a07d4bc80a074b4a`\n- Change-Id: `Ibb49c56aab29d1223a0ab36476a32d565566eb25`\n- Change-Id: `Id60c793730d982277c9d91860e9fb0e6a0df7d38`\n- Change-Id: `I9d358e74ab403989929dee87542d3dde78c2f229`\n- Change-Id: `I925d5ac9d29439c5d61cf089e7784065a8cb5ebd`\n- Change-Id: `I776c6f710e081645cff891487022cf787869ee3f`\n- Change-Id: `I2d17c89db2eb8d60b3393c2abc3b026e5574085d`\n- Change-Id: `Id6ee68826c4f3cc579880540812fd8ed834f8267`\n\nExample UX\n----------\n\n\nHere are example screens that show the user experience for the default\nimplementation of this feature.\n\n\n**Figure 1**. Example screens for launcher\nresizing in split-screen mode.\n\nImplementation\n--------------\n\n\nWhile Android 8.0 provides a reference implementation for this update to\nsplit-screen, it's up to device manufacturers to determine their implementations\nin their launchers. To support this feature:\n\n- Implement (or have an existing implementation of) multi-window that follows the Android Compatibility Definition Document (CDD) [requirements\n for multi-window](/docs/compatibility/android-cdd#3814-multi-windows).\n- Make the launcher resizable. The reference implementation in Launcher3 removes app names as the screen gets smaller, but implementations may vary depending on how the launcher compresses, especially if there is custom launcher code.\n- Set the minimum specified height in the launcher manifest. To do this, adjust `task_height_of_minimized_mode` value in: `frameworks/base/core/res/res/values/dimens.xml`\n\nTesting\n-------\n\n\nUse manual testing to ensure your implementation is working correctly.\n\n1. Enter split-screen.\n2. Press **Home**.\n3. Observe resizable launcher.\n\n\nEnsure that the launcher resizes correctly in all device orientations that it\nsupports."]]