From 6028376333344c90ba8dbaa75aad759b2915962d Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 15 May 2020 11:06:46 -0300 Subject: [wallet] cache transactions per currency --- taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'taler-kotlin-common') diff --git a/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt b/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt index f171039..3ab45ad 100644 --- a/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt +++ b/taler-kotlin-common/src/main/java/net/taler/common/AndroidUtils.kt @@ -23,6 +23,7 @@ import android.content.pm.PackageManager.MATCH_DEFAULT_ONLY import android.net.ConnectivityManager import android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET import android.os.Build.VERSION.SDK_INT +import android.os.Looper import android.text.format.DateUtils.DAY_IN_MILLIS import android.text.format.DateUtils.FORMAT_ABBREV_ALL import android.text.format.DateUtils.FORMAT_ABBREV_MONTH @@ -60,6 +61,10 @@ fun View.fadeOut(endAction: () -> Unit = {}) { }.start() } +fun assertUiThread() { + check(Looper.getMainLooper().thread == Thread.currentThread()) +} + /** * Use this with 'when' expressions when you need it to handle all possibilities/branches. */ -- cgit v1.2.3