Pugnotification icon indicating copy to clipboard operation
Pugnotification copied to clipboard

How to pass a parameter isVibrate and isSound ?

Open nguyencongbinh opened this issue 8 years ago • 0 comments

Thanks for your awesome lib. I want to pass a boolean vibrate and sound for notification depend on the user setting. How can I do it without if else ? Thanks.

PugNotification.with(context)
    .load()
    .identifier(identifier)
    .title(title)
    .message(message)
    .bigTextStyle(bigtext)
    .smallIcon(smallIcon)
    .largeIcon(largeIcon)
    .flags(Notification.DEFAULT_ALL)
    .button(icon, title, pendingIntent)
    .click(cctivity, bundle)
    .dismiss(activity, bundle)
    .color(color)
    .ticker(ticker)
    .when(when)
    .vibrate(vibrate)
    .lights(color, ledOnMs, ledOfMs)
    .sound(sound) 
    .autoCancel(autoCancel)
    .simple()
    .build();

nguyencongbinh avatar Nov 15 '16 08:11 nguyencongbinh