diff options
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt index 9e0ad75..cdb49ea 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt @@ -7,6 +7,7 @@ import android.graphics.Canvas import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.os.Handler +import android.os.Looper import android.support.annotation.IntRange import ca.allanwang.kau.R import java.math.RoundingMode @@ -114,4 +115,7 @@ fun postDelayed(delay: Long, action: () -> Unit) { Handler().postDelayed(action, delay) } +inline val kauIsMainThread: Boolean + get() = Looper.myLooper() == Looper.getMainLooper() + class KauException(message: String) : RuntimeException(message)
\ No newline at end of file |