问题
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.
回答1:
It is not available yet, most likely it will be in the future.
EDIT: 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();
}
来源:https://stackoverflow.com/questions/28603086/custom-ui-for-android-wear-notifications