Created
April 26, 2018 10:31
-
-
Save ditn/0290f7d3dae1bc75f42a7464d6b3fec2 to your computer and use it in GitHub Desktop.
Naive Kotlin builder use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val builder = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) | |
.setSmallIcon(icon) | |
// Excluded for brevity | |
.ternaryBuilder( | |
{ AndroidUtils.is19orHigher() }, | |
{ setVibrate(longArrayOf(100)) }, | |
{ setVibrate(longArrayOf()) } | |
) | |
.setContentText(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment