Android三星自定义通知抬头视图 [英] Android samsung custom notification heads up view

查看:156
本文介绍了Android三星自定义通知抬头视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当来自某些应用程序的通知显示在Samsung S8 Touchwiz上时,将显示一个自定义视图,其中包含漂亮的动画和椭圆形的文本.例如,电报中的消息通知.

When notifications from some applications are displaying on Samsung S8 Touchwiz there is a custom view with nice animation and ellipsized text. For example message notifications in Telegram.

有什么想法可以使我的通知在三星上像这样工作吗?在NotificationCompat.Builder中尝试了所有参数,但尚未成功.谢谢.

Any ideas how to make my notification work like this on samsung? Tried all parameters in NotificationCompat.Builder but no success yet. Thanks.

看起来像这样:

推荐答案

我设法弄清楚了如何使通知以这种方式出现在Samsung设备上.三星具有边缘照明"设置.您可以通过从屏幕顶部滑动快速设置菜单来访问它.当您输入边缘照明"设置时,请确保将显示边缘照明"设置为始终打开".另外,进入详细信息",然后进入管理通知",以使您的应用程序能够以这种方式显示通知.我注意到默认情况下启用了某些应用程序,例如Viber,WhatsApp等.我不知道你怎么能影响到那. 同样对于我的应用程序中的通知,代码中的类别也设置为HIGH.我不知道这是否重要,但我认为值得一提. 如果有人知道如何才能将我们的应用程序设置为默认显示边缘照明通知(如某些应用程序一样),请共享.

I managed to figure out how you can make the notifications appear in such way on Samsung devices. The Samsung have "Edge lighting" setting. You can access it by sliding the quick settings menu from the top of the screen. When you enter the "Edge lighting" setting, make sure that "Show edge lighting" is set to "Always on". Also, go into "Details" and then "Manage notifications", to enable your application to show the notifications in such way. I noticed that some apps like Viber, WhatsApp and similar, were enabled by default. I don't know how you can influence that. Also for the notifications in my application, the category in code is set to HIGH. I don't know if this matter though, but I think it is worth mentioning. If someone knows how can we set our application to be enabled to show edge lighting notifications by default, like some apps do, please share.

这篇关于Android三星自定义通知抬头视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆