自定义用户界面的Andr​​oid Wear通知自定义、用户界面、通知、Andr

2023-09-05 03:51:14 作者:冷雨轩

许志国我想创建自定义用户界面为Android磨损通知,而不是AW应用程序。 请建议,如果有任何图书馆或所提供的任何这一点。

Hii I want to create Custom UI for android wear notification, and not AW app. Please suggest if there are any libraries or anything available for this.

推荐答案

这是尚未公布,最有可能将在未来。

It is not available yet, most likely it will be in the future.

编辑:未来就是现在。你可以通过自定义的活动做到这一点 setDisplayIntent(),code样品:

Future is now. You can do this by passing own custom Activity by setDisplayIntent(), code sample:

public Notification buildNotification(Context context) {
            Intent displayIntent = new Intent(context, AnimatedNotificationDisplayActivity.class);
            displayIntent.putExtra(BasicNotificationDisplayActivity.EXTRA_TITLE, context.getString(nameResId));
            PendingIntent displayPendingIntent = PendingIntent.getActivity(context, 0, displayIntent, 0);
            return buildBasicNotification(context)
.extend(new Notification.WearableExtender()
.setDisplayIntent(displayPendingIntent))
.build();
}
 
精彩推荐
图片推荐