Learn about the new Picker API and important Library API changes.
Details here.
照片选择:用户看到的内容
本指南可帮助您了解用户在选择媒体内容时的体验。
按照标准 Picker API 流程,选择会在应用显示 pickerUri
后开始,并且在应用轮询 mediaItemsSet
返回 true 时进行。
如需在您自己的设备上查看任何这些步骤,请查看我们的示例应用。
开始选择会话
成功创建会话后,您的应用应向用户显示 pickerUri
。
- 以二维码和网址的形式显示
pickerUri
。
- 在
pickerUri
旁边提供实用文本。例如,“扫描此二维码以打开 Google 相册并选择您的内容”。
- 对于输入功能有限的设备(例如自助服务终端、平板电脑、智能电视),请查看硬件制造商针对文本大小和二维码宽度的建议。
搜索和选择照片
用户访问 pickerUri
后,会进入 Google 相册应用中的照片选择页面。
此页面始终会显示用户 Google 相册库中的最新照片。影集、收藏夹和其他常见照片类别不会直接显示。用户可以使用各种条件(例如关键字、日期、地点和影集标题)搜索照片。
如果您的应用使用影集、日期或其他常见的照片类别,请在用户进入 Google 相册应用后提示他们进行搜索,以便他们更轻松地找到所需内容。
例如,如果您要求用户分享特定影集,则可以在用户关联 Google 相册的同一页面上添加以下文字:“关联 Google 相册,然后搜索要分享的影集”。
搜索后,用户可以从结果中选择一个或多个项。
“完成”屏幕
用户按下“完成”按钮并完成选择后,会看到“完成”屏幕。
如需向用户提供选择更多照片的选项,请在应用中再次显示 pickerUri
。如果用户第二次访问 pickerUri
,系统会创建新的选择会话。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-19。
[null,null,["最后更新时间 (UTC):2025-02-19。"],[[["This guide explains the user experience within the Google Photos app when selecting media items using the Picker API."],["Users initiate the process by accessing the `pickerUri` displayed in your app, which opens a photo selection page within Google Photos."],["Users can search and select photos from their Google Photos library using various criteria before confirming their choices."],["After selection, users are presented with a \"Done\" screen, and your app can re-display the `pickerUri` to allow for further selections in a new session."]]],["The core process involves displaying a `pickerUri` (QR code and URL) to users, prompting them to access it. This takes them to Google Photos for photo selection. Users can search using keywords, dates, or locations to find specific photos. Upon selection and pressing \"Done,\" the process ends. Apps can offer to display the `pickerUri` again to initiate a new picking session, to select more items. While the app is polling for the media selection the process has begun.\n"]]