android :: native_notification $ NativeContext
An Android activity contextandroid :: native_notification $ NativeContext
An Android activity contextcore :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Native Java classes for notifications
module native_notification is android_api_min 11
import android::assets_and_resources
in "Java" `{
import android.content.Context;
import android.app.NotificationManager;
import android.app.Notification;
`}
redef class NativeContext
fun notification_manager: NativeNotificationManager in "Java" `{
return (NotificationManager)self.getSystemService(Context.NOTIFICATION_SERVICE);
`}
end
extern class NativeNotificationManager in "Java" `{ android.app.NotificationManager `}
fun notify(tag: JavaString, id: Int, notif: NativeNotification) in "Java" `{
self.notify(tag, (int)id, notif);
`}
fun cancel(tag: JavaString, id: Int) in "Java" `{ self.cancel(tag, (int)id); `}
fun cancel_all in "Java" `{ self.cancelAll(); `}
end
extern class NativeNotification in "Java" `{ android.app.Notification `}
end
extern class NativeNotificationBuilder in "Java" `{ android.app.Notification$Builder `}
new (context: NativeContext) in "Java" `{ return new Notification.Builder(context); `}
fun create: NativeNotification in "Java" `{
// Deprecated since API 16, which introduces `build`,
// refinement and global compilation should prevent warnings.
return self.getNotification();
`}
fun title=(value: JavaString) in "Java" `{ self.setContentTitle(value); `}
fun text=(value: JavaString) in "Java" `{ self.setContentText(value); `}
fun ticker=(value: JavaString) in "Java" `{ self.setTicker(value); `}
fun small_icon=(value: Int) in "Java" `{ self.setSmallIcon((int)value); `}
fun auto_cancel=(value: Bool) in "Java" `{ self.setAutoCancel(value); `}
fun number=(value: Int) in "Java" `{ self.setNumber((int)value); `}
fun ongoing=(value: Bool) in "Java" `{ self.setOngoing(value); `}
end
lib/android/notification/native_notification.nit:17,1--71,3