diff options
author | Allan Wang <me@allanwang.ca> | 2019-04-04 16:00:14 -0400 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-04-04 16:00:14 -0400 |
commit | 5ee12e797934b8f5f9c24374ba809cfdc0239805 (patch) | |
tree | 0980ea93856976e73aaf1f18f943ea35e99f6fc9 | |
parent | 3f5ce21205354c087f83b0bd182cb6727c4ca3fe (diff) | |
download | kau-5ee12e797934b8f5f9c24374ba809cfdc0239805.tar.gz kau-5ee12e797934b8f5f9c24374ba809cfdc0239805.tar.bz2 kau-5ee12e797934b8f5f9c24374ba809cfdc0239805.zip |
Fix some lint issues
3 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt index 3dd4bb9..21141f1 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt @@ -95,7 +95,7 @@ inline fun Activity.restart(intentBuilder: Intent.() -> Unit = {}) { */ @RequiresApi(Build.VERSION_CODES.M) inline fun Activity.restartApplication() { - val intent = packageManager.getLaunchIntentForPackage(packageName) + val intent = packageManager.getLaunchIntentForPackage(packageName)!! intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) val pending = PendingIntent.getActivity(this, 666, intent, PendingIntent.FLAG_CANCEL_CURRENT) val alarm = getSystemService(Context.ALARM_SERVICE) as AlarmManager diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index fc8049d..94750e3 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -157,7 +157,7 @@ inline fun Context.animation(@AnimRes id: Int) = AnimationUtils.loadAnimation(th * Returns plural form of res. The quantity is also passed to the formatter as an int */ inline fun Context.plural(@PluralsRes id: Int, quantity: Number) = - resources.getQuantityString(id, quantity.toInt(), quantity.toInt())!! + resources.getQuantityString(id, quantity.toInt(), quantity.toInt()) //Attr retrievers fun Context.resolveColor(@AttrRes attr: Int, @ColorInt fallback: Int = 0): Int { diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt index 1c22f62..8765c69 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/Kotterknife.kt @@ -118,7 +118,7 @@ private inline val DialogFragment.viewFinder: DialogFragment.(Int) -> View? private inline val SupportDialogFragment.viewFinder: SupportDialogFragment.(Int) -> View? get() = { dialog.findViewById(it) } private inline val Fragment.viewFinder: Fragment.(Int) -> View? - get() = { view.findViewById(it) } + get() = { view!!.findViewById(it) } private inline val SupportFragment.viewFinder: SupportFragment.(Int) -> View? get() = { view!!.findViewById(it) } private inline val ViewHolder.viewFinder: ViewHolder.(Int) -> View? |