自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
受保護的確認設計
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
受保護的確認作業使用者介面 (UI) 包含六個必要元素。部分元素可自訂,但必須遵循相關規定。自訂 UI 時,請遵循下列規範,並確保符合相關規定。如果元素標示為「Requirement」,則該元素必須使用所列屬性。
以下規範使用 Roboto 字型系列,您可以前往 fonts.google.com 下載。
Android 保護確認功能可使用裝置上的硬體按鈕,確認及取消輸入內容。
圖示
盾牌圖示
Icon |
 |
下載 |
安全盾牌 |
圖示大小 |
32dp |
「箭頭」圖示
Icon |
 |
下載 |
鍵盤向右鍵 |
圖示大小 |
24dp |
容器圓角半徑 |
4dp |
在 Protected Confirmation 中,有兩種輸入類型可用來確認和取消。
這則訊息必須指出要用哪個按鈕確認。
訊息 |
按兩下 (按鈕) 即可確認 |
長度上限 |
規定:確認訊息不得超過兩行。 |
顏色 |
#000000 87% |
字體 |
Roboto-Medium |
字型大小 |
需求條件:14sp |
行高 |
必要條件:20dp |
取消訊息必須清晰可見,並與確認按鈕清楚區分。請使用下列屬性,並搭配單字「Cancel」。
訊息 |
取消 |
顏色 |
#000000 87% |
字體 |
Roboto-Medium |
字型大小 |
需求條件:14sp |
行高 |
必要條件:20dp |
標題文字
在信任的 UI 中加入標頭文字「Android Protected Confirmation」,以便識別這項功能。請使用下列屬性設定標題文字。
訊息 |
規定:Android 保護確認 |
顏色 |
#000000 87% |
字體 |
Roboto-Regular |
字型大小 |
需求條件:22sp |
行高 |
需求條件:28dp |
內文
實作內文元素時,請使用下列屬性。實際訊息是由 API 開發人員 (應用程式開發人員) 編寫。
訊息 |
內文是由呼叫 Protected Confirmation 的應用程式開發人員提供。 |
顏色 |
#000000 87% |
字體 |
Roboto-Regular |
字型大小 |
需求條件:16sp |
行高 |
需求:24dp |
使用副標題文字說明使用者為何看到「Protected Confirmation」畫面。將這段文字放在畫面底部,並使用下列屬性。
訊息 |
必要條件:這項確認程序可為您即將採取的動作提供額外一層安全防護。 |
長度上限 |
規定:確認訊息不得超過四行。 |
顏色 |
#000000 87% |
字體 |
Roboto-Regular |
字型大小 |
需求條件:14sp |
行高 |
必要條件:20dp |
Android 保護確認功能可使用軟體按鈕確認及取消輸入內容。下列指南說明使用軟體按鈕的 UI。
盾牌圖示
請前往 Android Protected Confirmation Shield Icon 下載圖示素材資源。將圖示放在畫面頂端。
「Protected Confirmation」護盾圖示為必要元素。您可以自訂盾牌的顏色,但必須清晰可見。
請使用主要和次要按鈕的形式,用於確認和取消輸入內容。
按鈕標籤 |
按鈕標籤應採用句首字母大寫格式。 |
按鈕半徑 |
4dp |
強調色 |
#1a73e8 |
字體 |
Roboto-Medium |
字型大小 |
需求條件:14sp |
在信任的 UI 中加入標頭文字「Android Protected Confirmation」,以便識別這項功能。請使用下列屬性設定標題文字。
訊息 |
規定:Android 保護確認 |
顏色 |
#000000 87% |
字體 |
Roboto-Medium |
字型大小 |
需求條件:24sp |
行高 |
需求條件:20dp |
內文
實作內文元素時,請使用下列屬性。實際訊息是由應用程式開發人員編寫。
訊息 |
內文是由呼叫 Protected Confirmation 的應用程式開發人員提供 |
顏色 |
#000000 87% |
字體 |
Roboto-Medium |
字型大小 |
需求條件:16sp |
行高 |
需求:24dp |
使用副標題文字說明使用者為何看到「Protected Confirmation」畫面。將這段文字放在畫面底部,並使用下列屬性。
訊息 |
必要條件:這項確認程序可為您即將採取的動作提供額外安全防護。 |
長度上限 |
規定:確認訊息不得超過四行。 |
顏色 |
#000000 54% |
字體 |
Roboto-Medium |
字型大小 |
需求條件:14sp |
行高 |
必要條件:20dp |
本地化
您可以在 Android 開放原始碼計畫中,找到查詢表的自給自足 C 實作項目,並在其中找到上述元件的本地化項目。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Protected confirmation design\n\nThe Protected Confirmation user interface (UI) consists of six required\nelements. Some elements can be customized, but there are requirements that need\nto be followed. Use the following guidelines when customizing the UI and ensure\nthat the requirements are met. If an element is marked with\nRequirement: that element must use the\nlisted property.\n\nThe following guidelines use the Roboto font family, which you can download\nfrom [fonts.google.com](https://fonts.google.com/).\n\nUI with hardware buttons\n------------------------\n\nAndroid Protected Confirmation can use hardware buttons on the device for\nconfirming and canceling input.\n\n### Icons\n\n#### Shield icon\n\n| Icon | |\n| Download | [Security shield](https://www.gstatic.com/images/icons/material/system_gm/svg/security_24px.svg) |\n| Icon size | 32dp |\n|-----------|--------------------------------------------------------------------------------------------------|\n\n#### Arrow icon\n\n| Icon | |\n| Download | [Keyboard arrow right](https://www.gstatic.com/images/icons/material/system_gm/svg/keyboard_arrow_right_24px.svg) |\n| Icon size | 24dp |\n| Container corner radius | 4dp |\n|-------------------------|-------------------------------------------------------------------------------------------------------------------|\n\n### Input messages\n\nThere are two input types used in Protected Confirmation:\nconfirm and cancel.\n\n#### Confirmation string\n\nThis message must indicate which button is used as confirmation.\n\n| Message | Double-press (button) to confirm |\n| Maximum length | Requirement: The confirmation message can't be more than two lines. |\n| Color | #000000 87% |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 14sp |\n| Line height | Requirement: 20dp |\n|----------------|---------------------------------------------------------------------|\n\n#### Cancel string\n\nThe cancel message must be clearly visible and easily distinguished from\nthe confirmation button. Use the following properties along with the single word\n**Cancel**.\n\n| Message | Cancel |\n| Color | #000000 87% |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 14sp |\n| Line height | Requirement: 20dp |\n|-------------|-----------------------------------------------------------|\n\n### Header text\n\nInclude the header text **Android Protected Confirmation** in\nthe Trusted UI to identify the feature. Use the following properties for the\nheader text.\n\n| Message | Requirement: Android Protected Confirmation |\n| Color | #000000 87% |\n| Font face | [Roboto-Regular](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 22sp |\n| Line height | Requirement: 28dp |\n|-------------|------------------------------------------------------------|\n\n### Body text\n\nUse the following properties when implementing the body text element. The\nactual message is written by the API developer (app developer).\n\n| Message | The body text is provided by the app developer calling Protected Confirmation. |\n| Color | #000000 87% |\n| Font face | [Roboto-Regular](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 16sp |\n| Line height | Requirement: 24dp |\n|-------------|--------------------------------------------------------------------------------|\n\n### Subheader text\n\nUse the subheader text to explain why the user is seeing the Protected\nConfirmation screen. Place this text at the bottom of the screen and use the\nfollowing properties.\n\n| Message | Requirement: This confirmation provides an extra layer of security for the action you're about to take. |\n| Maximum length | Requirement: The confirmation message can't be more than four lines. |\n| Color | #000000 87% |\n| Font face | [Roboto-Regular](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 14sp |\n| Line height | Requirement: 20dp |\n|----------------|---------------------------------------------------------------------------------------------------------|\n\nUI with software buttons\n------------------------\n\nAndroid Protected Confirmation can use software buttons for\nconfirming and canceling input. The following guidelines describe the UI using\nsoftware buttons.\n\n### Shield icon\n\nDownload the icon asset at [Android\nProtected Confirmation Shield Icon](https://www.gstatic.com/images/icons/material/system_gm/svg/security_24px.svg).\nPlace the icon at the top of the screen.\n\nThe Protected Confirmation shield icon is a required element. The color\nof the shield can be customized but it must be plainly visible.\n\n### Input\n\nUse the form of a primary and secondary button for the confirmation and\ncancel inputs.\n\n| Button label | Use sentence case for button labels. |\n| Button radius | 4dp |\n| Accent color | #1a73e8 |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 14sp |\n|---------------|-----------------------------------------------------------|\n\n### Header text\n\nInclude the header text **Android Protected Confirmation** in\nthe Trusted UI to identify the feature. Use the following properties for the\nheader text.\n\n| Message | Requirement: Android Protected Confirmation |\n| Color | #000000 87% |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 24sp |\n| Line height | Requirement: 20dp |\n|-------------|-----------------------------------------------------------|\n\n### Body text\n\nUse the following properties when implementing the body text element. The\nactual message is written by the app developer.\n\n| Message | The body text is provided by the app developer calling Protected Confirmation |\n| Color | #000000 87% |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 16sp |\n| Line height | Requirement: 24dp |\n|-------------|-------------------------------------------------------------------------------|\n\n### Subheader text\n\nUse the subheader text to explain why the user is seeing the Protected\nConfirmation screen. Place this text at the bottom of the screen and use the\nfollowing properties.\n\n| Message | Requirement: This confirmation provides an extra layer of security for the action you're about to take. |\n| Maximum length | Requirement: The confirmation message can't be more than four lines. |\n| Color | #000000 54% |\n| Font face | [Roboto-Medium](https://fonts.google.com/specimen/Roboto) |\n| Font size | Requirement: 14sp |\n| Line height | Requirement: 20dp |\n|----------------|---------------------------------------------------------------------------------------------------------|\n\nLocalization\n------------\n\nYou can find localizations for the described components\nin a self-contained C-implementation of a lookup table as part of [AOSP](https://android.googlesource.com/platform/hardware/interfaces/+/android16-release/confirmationui/support/src/ConfirmationUITranslations.c)."]]