aboutsummaryrefslogtreecommitdiff
path: root/wallet/src
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 /wallet/src
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 'wallet/src')
-rw-r--r--wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt9
-rw-r--r--wallet/src/main/res/drawable/ic_bug_report.xml10
-rw-r--r--wallet/src/main/res/values/strings.xml2
-rw-r--r--wallet/src/main/res/xml/settings_main.xml8
4 files changed, 29 insertions, 0 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt b/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt
index 63492f4..b321061 100644
--- a/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/settings/SettingsFragment.kt
@@ -25,6 +25,7 @@ import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.google.android.material.snackbar.BaseTransientBottomBar.LENGTH_SHORT
import com.google.android.material.snackbar.Snackbar
+import net.taler.common.showLogViewer
import net.taler.common.toRelativeTime
import net.taler.wallet.BuildConfig.FLAVOR
import net.taler.wallet.BuildConfig.VERSION_CODE
@@ -42,6 +43,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
private lateinit var prefBackup: Preference
private lateinit var prefDevMode: SwitchPreferenceCompat
private lateinit var prefWithdrawTest: Preference
+ private lateinit var prefLogcat: Preference
private lateinit var prefVersionApp: Preference
private lateinit var prefVersionCore: Preference
private lateinit var prefVersionExchange: Preference
@@ -51,6 +53,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
listOf(
prefBackup,
prefWithdrawTest,
+ prefLogcat,
prefVersionApp,
prefVersionCore,
prefVersionExchange,
@@ -64,6 +67,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
prefBackup = findPreference("pref_backup")!!
prefDevMode = findPreference("pref_dev_mode")!!
prefWithdrawTest = findPreference("pref_testkudos")!!
+ prefLogcat = findPreference("pref_logcat")!!
prefVersionApp = findPreference("pref_version_app")!!
prefVersionCore = findPreference("pref_version_core")!!
prefVersionExchange = findPreference("pref_version_protocol_exchange")!!
@@ -103,6 +107,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
true
}
+ prefLogcat.setOnPreferenceClickListener {
+ requireContext().showLogViewer()
+ true
+ }
+
prefReset.setOnPreferenceClickListener {
showResetDialog()
true
diff --git a/wallet/src/main/res/drawable/ic_bug_report.xml b/wallet/src/main/res/drawable/ic_bug_report.xml
new file mode 100644
index 0000000..233af37
--- /dev/null
+++ b/wallet/src/main/res/drawable/ic_bug_report.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="?attr/colorControlNormal"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z" />
+</vector>
diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml
index d49f5f7..b419766 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -158,6 +158,8 @@ GNU Taler is immune against many types of fraud, such as phishing of credit card
<string name="settings_dev_mode_summary">Shows more information intended for debugging</string>
<string name="settings_withdraw_testkudos">Withdraw TESTKUDOS</string>
<string name="settings_withdraw_testkudos_summary">Get money for testing</string>
+ <string name="settings_logcat">Debug log</string>
+ <string name="settings_logcat_summary">View/send internal log</string>
<string name="settings_version_app">App Version</string>
<string name="settings_version_core">Wallet Core Version</string>
<string name="settings_version_protocol_exchange">Supported Exchange Versions</string>
diff --git a/wallet/src/main/res/xml/settings_main.xml b/wallet/src/main/res/xml/settings_main.xml
index 4c2f149..a713838 100644
--- a/wallet/src/main/res/xml/settings_main.xml
+++ b/wallet/src/main/res/xml/settings_main.xml
@@ -47,6 +47,14 @@
tools:isPreferenceVisible="true" />
<Preference
+ app:icon="@drawable/ic_bug_report"
+ app:isPreferenceVisible="false"
+ app:key="pref_logcat"
+ app:summary="@string/settings_logcat_summary"
+ app:title="@string/settings_logcat"
+ tools:isPreferenceVisible="true" />
+
+ <Preference
app:icon="@drawable/ic_account_balance_wallet"
app:isPreferenceVisible="false"
app:key="pref_version_app"