自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
分割畫面互動
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
在 Android 7.0 以上版本中,使用者可以透過平台功能「多視窗」,在裝置畫面上同時顯示多個應用程式。預設模式為分割畫面,可為使用者提供兩個活動窗格,用於放置應用程式。
Android 8.0 透過精進功能並新增更多功能,改善分割畫面。在預設實作方式中,如果使用者在進入分割畫面後輕觸「Home」,頂端窗格會壓縮,啟動器會調整大小。這可讓使用者知道頂端應用程式仍處於開啟狀態,同時維持啟動器版面配置,方便他們從主畫面尋找及啟動應用程式。
範例和來源
/platform/packages/apps/Launcher3/
中的 Launcher3 程式碼中,有這項新功能的參考實作項目。
這些變更 ID 與在 Launcher3 中實作分割畫面有關,可供想為自家啟動器進行類似更新的裝置製造商參考。
- 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
使用者體驗範例
以下是顯示這項功能預設實作方式的使用者體驗範例畫面。
圖 1. 分割畫面模式中啟動器調整大小的範例畫面。
實作
雖然 Android 8.0 為這項分割畫面更新提供參考實作項目,但裝置製造商仍可自行決定在啟動器中實作。如要支援這項功能,請按照下列步驟操作:
- 依循 Android 相容性定義說明文件 (CDD) 多視窗功能的規定,實作 (或已實作) 多視窗功能。
- 讓啟動器可調整大小。Launcher3 中的參考實作項目會在螢幕縮小時移除應用程式名稱,但實作方式可能會因啟動器的壓縮方式而異,尤其是在有自訂啟動器程式碼的情況下。
- 在啟動器資訊清單中設定指定的最小高度。如要這麼做,請調整
task_height_of_minimized_mode
值:
frameworks/base/core/res/res/values/dimens.xml
測試
請使用手動測試,確保導入作業能正常運作。
- 進入分割畫面。
- 按下「Home」鍵。
- 觀察可調整大小的啟動器。
請確認啟動器在支援的所有裝置方向上,都能正確調整大小。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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 (世界標準時間)。"],[],[],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."]]