设计登录体验时,请遵循以下最佳实践。
在适当的时间提示用户
除非必要,否则请勿强制用户登录。Wear OS 应用不应对所有功能都要求进行身份验证。尽可能在不登录的情况下提供更多功能。
说明登录的好处
如果需要用户登录,请根据正在执行的操作解释原因并说明好处。不要假定用户了解登录的好处。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_10.png?hl=zh-cn)
正确做法
在用户启动某项操作后要求用户登录,提供上下文信息。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_6.png?hl=zh-cn)
错误做法
只显示登录选项而不说明登录的好处。
简化决策
将登录方法划分为数量最少的选项,并突出显示最简单的方法。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_13.png?hl=zh-cn)
正确做法
突出显示最方便的登录选项,将其他选项归入一组。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_4.png?hl=zh-cn)
错误做法
为用户提供许多具有相同结果的不同选项。
提供替代方案
提供两种不同的登录方法或跳过登录的选项,以防登录失败。没有备用登录方法的应用可能会导致用户体验不佳。例如,如果应用只提供了在手机上登录这一种方法,那么当用户的手机不在身边时,就会给用户造成麻烦。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_9.png?hl=zh-cn)
正确做法
提供备用登录选项。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_2.png?hl=zh-cn)
错误做法
仅提供一种登录方法。
精简
减少登录所需的步骤并避免多余的登录,从而精简流程。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_1.png?hl=zh-cn)
正确做法
在符合您的隐私和安全要求的前提下,让用户尽可能长时间保持已登录状态。
通过数据层获取凭据
如果用户已登录到对应的手机应用,请使用这些凭据帮其自动登录手表应用。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_3.png?hl=zh-cn)
正确做法
当用户在手机上输入凭据时,让其自动登录手表。
登录状态和确认
在用户首次登录时显示一条消息,说明登录过程或确认登录成功。首次打开应用之后,禁止显示说明登录过程的消息。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_12.png?hl=zh-cn)
正确做法
使用正在登录的进程状态,直到进程结束。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_8.png?hl=zh-cn)
正确做法
如果用户自动登录,显示确认消息。
手机不可用
如果手机不在身边,请显示其他登录方式或继续下一步。
![](https://developer.android.google.cn/static/wear/images/design/sign_in_5.png?hl=zh-cn)
正确做法
在手机无法使用时通知用户,并提供替代操作。