Migrate library to Kotlin.

This commit is contained in:
inorichi
2016-02-23 14:51:18 +01:00
parent 9062e40ec5
commit 59276b7160
20 changed files with 1149 additions and 925 deletions

View File

@@ -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.

View File

@@ -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)
}
}