louiscad
03/09/2020, 11:47 AMNotificationCompat
Kotlin extensions? I personally made some, and I'm looking for folks to discuss API design regarding extensions for these APIs. I'm looking forward exchanging inspiration to get to a DSL that is the lest error-prone and forget-prone possible, and very readable (can't stand these NotificationCompat.PRIORITY_
and similar prefixes).
Right, this is what I have, and I know I can make improvements, but I'd like to bounce off improvement ideas.
val notification = buildNotification(ChannelIds.Something) {
priority = NotificationCompat.PRIORITY_MAX
category = NotificationCompat.CATEGORY_STATUS
visibility = Public
contentText = "Some content text"
smallIcon = R.drawable.ic_some_icon_white_24dp
}
dave08
03/10/2020, 6:00 AMlouiscad
03/10/2020, 8:12 AMtxt(R.string.some_text)
, that problem is already resolved :)dave08
03/11/2020, 6:04 AMlouiscad
03/11/2020, 8:20 AMFlow
from #coroutines can already handle that perfectly.
About the Context
, I stopped minding about that for a while. I can either use it as a receiver in the function calling the buildNotification
function, or use appTxt
which will use the application context.dave08
03/11/2020, 8:31 AMlouiscad
03/11/2020, 1:59 PMNotification
with same id (and tag if used)