Pages

Thursday, 24 May 2018

shortcuts and widgets in Android

Why use shortcuts and widgets?


One of our favorite features in Android O is the ability to pin shortcuts and widgets for your app onto the launcher through deep linking.
可以通过deep linking将应用的快捷方式和小部件固定到桌面上是Android O上最受欢迎的特性功能之一

Shortcuts let users quickly start a specific task, while widgets give users instant access to specific actions and information from your app. Users want to get things done, and get things done fast – shortcuts and widgets are a way to help them and to increase user engagement with your content.
快捷方式可以让用户快速启动特定任务,而小部件能让用户即时访问应用中的特定操作和信息。快捷方式和小部件不仅可以帮助用户快速有效的完成操作,并且可以增强用户与app内容之间的交互。
To pin a shortcut or widget, users long press your app’s icon for options and drag and drop the selected item to a location of their choice.
要固定快捷方式或小部件,用户可以长按应用的图标,将所选项目拖放到自己认为合适的位置。

Adding shortcuts and widgets from within your app

The API has a new flow for adding shortcuts and widgets from within your app. The new method uses a modal dialog, deprecating the old method of using a broadcast, which will not work on O devices.
新的API将通过新的流程来添加快捷方式和小部件到你的app,新的方式将使用一个对话框来实现,弃用了以往使用广播的方式,意味在Android O的设备上将不能使用广播来添加。


That’s not all. We’ve made improvements to the user interface and experience. In the old experience, there was no app icon on the shortcut, so users had no idea which app the shortcut was from. Marking shortcuts with the app icon provides better branding while protecting users from potential malware.
还有就是,我们改进了用户界面和体验。 在以往的体验中,快捷方式上没有应用程序图标,因此用户不知道快捷方式是哪个应用程序。 使用应用图标标记快捷方式可以提供更好的识别,同时保护用户免受潜在的恶意软件攻击。
Old shortcut
New shortcut
There is also a new option to add a specialized activity to help users create shortcuts. The activity is complete with custom options and confirmation.
还可以通过一个新选项来添加专门的activity来帮助用户创建快捷方式。 该activity包含了自定义选项和确认。

With these new additions and improvements, users will be more likely to use your shortcuts and widgets, leading to more meaningful and impactful engagement with your app and happier, more productive users.
通过这些新的增强和改进,用户将更有可能使用您的快捷方式和小部件,从而更有效,更有趣地和App交互。

原文地址

To learn more, head over to the shortcuts and widgets page on the Android Developers website.

No comments:

Post a Comment