From 78f935c59f8fe163e3bf4dca8711a6364ae7db6b Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 25 Aug 2018 17:02:04 -0700 Subject: [PATCH] Warning cleanup --- .../java/io/casey/musikcube/remote/framework/ViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt index 7ac3482e7..9870286e9 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt @@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicLong } open fun onDestroy() { - handler.postDelayed(cleanup, cleanupDelayMs) + handler.postDelayed(cleanup, CLEANUP_DELAY_MS) } open fun onCleanup() { @@ -45,7 +45,7 @@ import java.util.concurrent.atomic.AtomicLong .subscribeOn(AndroidSchedulers.mainThread()) } - val context: Context = Application.instance!! + val context: Context = Application.instance internal val cleanup = Runnable { idToInstance.remove(id) @@ -67,7 +67,7 @@ import java.util.concurrent.atomic.AtomicLong } companion object { - private val cleanupDelayMs = 3000L + private const val CLEANUP_DELAY_MS = 3000L private val nextId = AtomicLong(System.currentTimeMillis() + 0) private val handler by lazy { Handler(Looper.getMainLooper()) } private val idToInstance = mutableMapOf>()