'Whether to use the accent color for the background. Not applied in all cases.
'For most styles, the coloring will only be applied if the notification is for a foreground service notification.
Public Sub Colorized (Enabled As Boolean) As NB6
If IsBuilder Then
If SdkLevel >= 26 Then
NotificationBuilder.RunMethod("setColorized", Array(True))
End If
End If
Return Me
End Sub
Usage example:
B4X:
Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER
Dim icon As Bitmap = LoadBitmapResize(File.DirAssets, "smiley.png", 24dip, 24dip, False)
Dim n As NB6
n.Initialize("default", Application.LabelName, "DEFAULT").AutoCancel(True).SmallIcon(icon).Color(Colors.Red).Colorized(True)
Service.StartForeground(10, n.Build("Colorized", "This is a foreground service notification", "tag1", Me))
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.