mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Migrate library to Kotlin.
This commit is contained in:
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.util
|
||||
|
||||
import android.app.AlarmManager
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.support.annotation.StringRes
|
||||
import android.support.v4.app.NotificationCompat
|
||||
@@ -27,6 +28,12 @@ inline fun Context.notification(func: NotificationCompat.Builder.() -> Unit): No
|
||||
return builder.build()
|
||||
}
|
||||
|
||||
/**
|
||||
* Property to get the notification manager from the context.
|
||||
*/
|
||||
val Context.notificationManager : NotificationManager
|
||||
get() = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
|
||||
/**
|
||||
* Property to get the alarm manager from the context.
|
||||
* @return the alarm manager.
|
||||
|
||||
@@ -12,4 +12,4 @@ import android.view.ViewGroup
|
||||
*/
|
||||
fun ViewGroup.inflate(@LayoutRes layout: Int, attachToRoot: Boolean = false): View {
|
||||
return LayoutInflater.from(context).inflate(layout, this, attachToRoot)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user