Android samsung custom notification heads up view

偶尔善良 提交于 2020-06-29 14:08:45

问题


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.

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

It look's like this:


回答1:


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.



来源:https://stackoverflow.com/questions/46847679/android-samsung-custom-notification-heads-up-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!