如何创建一个类似于从谷歌Play音乐应用的通知 [英] How to create a notification similar to Play Music app from Google
问题描述
我试图创建一个通知是非常相似,从谷歌的播放音乐应用程序使用。
几个问题,希望有人能回答。
- 在此通知进行自定义RemoteViews?
- 是对X用于关闭NotificationCompat.Builder的API的小部件的一部分?或者只是一个自定义的远程视窗的一部分?
- 如果它是所有自定义视图我如何可以设置自定义远程视窗的最小化和最大化状态?
是的,这一切与定制完成 RemoteViews
。在文档的<一个你会看到href="http://developer.android.com/reference/android/app/Notification.html"><$c$c>Notification$c$c>,有一个领域<一个href="http://developer.android.com/reference/android/app/Notification.html#bigContentView"><$c$c>bigContentView$c$c>随着<一href="http://developer.android.com/reference/android/app/Notification.html#contentView"><$c$c>contentView$c$c>.
I'm trying to create a notification that is very similar to what the "Play Music" app from Google uses.
Few questions that hopefully someone can answer.
- Is this notification done with custom RemoteViews?
- Is the X for closing the widget part of the NotificationCompat.Builder APIs? or simply part of a custom RemoteView?
- If it is all custom views how can I set a custom RemoteView for minimized and maximized states?
Yes, all of that is done with custom RemoteViews
. You'll see in the docs for Notification
, there's a field for bigContentView
along with contentView
.
这篇关于如何创建一个类似于从谷歌Play音乐应用的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!