From 8d79915b2aac9e2f811539ad746eaec31db82ccf Mon Sep 17 00:00:00 2001 From: Mahdi Malvandi Date: Sun, 7 Jul 2019 11:05:39 +0430 Subject: [PATCH 1/2] Create README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a07700 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Bark +An Android Log Viewer to Help debugging a program. Mostly made for debuggin stuff.
+Shows a realtime stream of logs happenning in the app, sdk, etc. + + From b42c07bce1abea4519663e15f838ed8a1f298373 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sun, 7 Jul 2019 11:20:18 +0430 Subject: [PATCH 2/2] Fixed clearLogs on mainThread --- .gitignore | 1 + .idea/misc.xml | 2 +- bark/src/main/java/sh/hadi/bark/ui/LogViewModel.kt | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index cf28ccc..109450c 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ captures/ .idea/assetWizardSettings.xml .idea/dictionaries .idea/libraries +.idea/misc.xml # Android Studio 3 in .gitignore file. .idea/caches .idea/modules.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 703e5d4..8a8f75b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/bark/src/main/java/sh/hadi/bark/ui/LogViewModel.kt b/bark/src/main/java/sh/hadi/bark/ui/LogViewModel.kt index 2944177..ca0b927 100644 --- a/bark/src/main/java/sh/hadi/bark/ui/LogViewModel.kt +++ b/bark/src/main/java/sh/hadi/bark/ui/LogViewModel.kt @@ -7,11 +7,9 @@ import sh.hadi.bark.db.LogItem class LogViewModel(private val dataSource: LogDao) : ViewModel() { - fun addLog(log: LogItem) { - dataSource.insertLog(log) - } + fun addLog(log: LogItem) = Thread { dataSource.insertLog(log) }.start() fun getLogs(): LiveData> = dataSource.getLogs() - fun clearLogs() = dataSource.deleteAlLogs() + fun clearLogs() = Thread{ dataSource.deleteAlLogs() }.start() } \ No newline at end of file