aboutsummaryrefslogtreecommitdiff
path: root/taler-kotlin-android
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-07 13:41:12 -0300
committerTorsten Grote <t@grobox.de>2020-09-07 13:41:12 -0300
commit663d264bf18d4af84553d969fd85e782d94faa41 (patch)
treec3e427b7863d0e68b619603cf732bbf3ad09a89b /taler-kotlin-android
parentd78c2003df1db7af448de1c91449201020109190 (diff)
downloadtaler-android-663d264bf18d4af84553d969fd85e782d94faa41.tar.gz
taler-android-663d264bf18d4af84553d969fd85e782d94faa41.tar.bz2
taler-android-663d264bf18d4af84553d969fd85e782d94faa41.zip
[wallet] add logcat viewer to dev settings
Diffstat (limited to 'taler-kotlin-android')
-rw-r--r--taler-kotlin-android/build.gradle7
-rw-r--r--taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt10
2 files changed, 17 insertions, 0 deletions
diff --git a/taler-kotlin-android/build.gradle b/taler-kotlin-android/build.gradle
index e57d365..872b1cd 100644
--- a/taler-kotlin-android/build.gradle
+++ b/taler-kotlin-android/build.gradle
@@ -69,6 +69,13 @@ dependencies {
// QR codes
implementation 'com.google.zxing:core:3.4.0' // needs minSdkVersion 24+
+ // Logcat viewer
+ implementation('com.github.pedrovgs:lynx:1.1.0') {
+ exclude group: 'com.android.support'
+ exclude group: 'com.squareup'
+ }
+ implementation 'com.github.pedrovgs:renderers:4.0.0'
+
// JSON parsing and serialization
api "org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC"
diff --git a/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt b/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
index ceb5ead..72740df 100644
--- a/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
+++ b/taler-kotlin-android/src/main/java/net/taler/common/AndroidUtils.kt
@@ -43,6 +43,9 @@ import androidx.core.content.ContextCompat.getSystemService
import androidx.fragment.app.Fragment
import androidx.navigation.NavDirections
import androidx.navigation.fragment.findNavController
+import com.github.pedrovgs.lynx.LynxActivity
+import com.github.pedrovgs.lynx.LynxConfig
+import com.github.pedrovgs.lynx.model.TraceLevel
import net.taler.lib.common.Version
fun View.fadeIn(endAction: () -> Unit = {}) {
@@ -90,6 +93,13 @@ fun Context.isOnline(): Boolean {
}
}
+fun Context.showLogViewer() {
+ val lynxActivityIntent = LynxActivity.getIntent(this, LynxConfig().apply {
+ maxNumberOfTracesToShow = 1500 // higher numbers seem to break share functionality
+ })
+ startActivity(lynxActivityIntent)
+}
+
fun Intent.isSafe(context: Context): Boolean {
return context.packageManager.queryIntentActivities(this, MATCH_DEFAULT_ONLY).isNotEmpty()
}