From 8a84ab5250e0af6386ddbe4b2c3998c21fb2a03c Mon Sep 17 00:00:00 2001 From: Bojan Date: Tue, 23 Aug 2022 16:51:39 +0200 Subject: [PATCH 1/2] WIP 5.4.9 --- CHANGELOG.md | 6 +++++ config.gradle | 8 +++---- .../infinum/dbinspector/extensions/Bundle.kt | 10 ++++++++ .../infinum/dbinspector/extensions/Context.kt | 11 +++++++++ .../ui/DbInspectorShortcutManager.kt | 24 +++++++++++++------ .../shared/preview/PreviewContentDialog.kt | 17 +++++++++---- .../databases/remove/RemoveDatabaseDialog.kt | 6 ++++- .../databases/rename/RenameDatabaseDialog.kt | 9 +++++-- gradle/libs.versions.toml | 2 +- 9 files changed, 74 insertions(+), 19 deletions(-) create mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Bundle.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 28ae9b93..3909af5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========= +## Version 5.4.9 + +_2022-MM-DD_ + +* Implement Android 13 compatibility and changes. + ## Version 5.4.8 _2022-08-05_ diff --git a/config.gradle b/config.gradle index 0fdbe11c..9d2cb3ca 100644 --- a/config.gradle +++ b/config.gradle @@ -1,13 +1,13 @@ ext { def major = 5 def minor = 4 - def patch = 8 + def patch = 9 buildConfig = [ "minSdk" : 21, - "compileSdk": 32, - "targetSdk" : 32, - "buildTools": "32.0.0" + "compileSdk": 33, + "targetSdk" : 33, + "buildTools": "33.0.0" ] releaseConfig = [ "group" : "com.infinum.dbinspector", diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Bundle.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Bundle.kt new file mode 100644 index 00000000..fd84b124 --- /dev/null +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Bundle.kt @@ -0,0 +1,10 @@ +import android.os.Build +import android.os.Bundle + +internal fun Bundle.getParcelableCompat(key: String?, clazz: Class): T? = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + getParcelable(key, clazz) + } else { + @Suppress("DEPRECATION") + getParcelable(key) + } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Context.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Context.kt index 6a505470..edde32ee 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Context.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/extensions/Context.kt @@ -1,8 +1,11 @@ package com.infinum.dbinspector.extensions import android.content.Context +import android.content.Intent +import android.content.pm.PackageManager import android.content.res.TypedArray import android.graphics.drawable.Drawable +import android.os.Build import android.util.TypedValue import androidx.annotation.AttrRes import androidx.annotation.ColorInt @@ -30,3 +33,11 @@ internal fun Context.getColorFromAttribute(@AttrRes attrId: Int): Int { typedArray.recycle() return color } + +internal fun Context.queryIntentActivitiesCompat(intent: Intent) = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + packageManager.queryIntentActivities(intent, PackageManager.ResolveInfoFlags.of(0L)) + } else { + @Suppress("DEPRECATION") + packageManager.queryIntentActivities(intent, 0) + } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt index a96fb61b..4b8e904f 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt @@ -10,6 +10,7 @@ import android.graphics.drawable.Icon import android.os.Build import com.infinum.dbinspector.R import com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger +import com.infinum.dbinspector.extensions.queryIntentActivitiesCompat import com.infinum.dbinspector.ui.databases.DatabasesActivity @SuppressLint("StaticFieldLeak") @@ -17,34 +18,38 @@ internal object DbInspectorShortcutManager { private const val ACTIVITY_INFO_NAME = "com.infinum.dbinspector.ui.databases.DatabasesActivity" - private const val LAUNCHER_DYNAMIC_SHORTCUT_ID = "com.infinum.dbinspector.ui.dynamic_shortcut_launcher" + private const val LAUNCHER_DYNAMIC_SHORTCUT_ID = + "com.infinum.dbinspector.ui.dynamic_shortcut_launcher" fun init(context: Context) = addDynamicShortcut(context) @Suppress("LongMethod", "NestedBlockDepth") private fun addDynamicShortcut(context: Context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { - val shortcutManager: ShortcutManager = context.getSystemService(ShortcutManager::class.java) + val shortcutManager: ShortcutManager = + context.getSystemService(ShortcutManager::class.java) val dynamicShortcuts: MutableList = shortcutManager.dynamicShortcuts dynamicShortcuts .none { shortcut -> shortcut.id == LAUNCHER_DYNAMIC_SHORTCUT_ID } .takeIf { it } ?.let { - context.packageManager.queryIntentActivities( + context.queryIntentActivitiesCompat( Intent(Intent.ACTION_MAIN, null) .apply { addCategory(Intent.CATEGORY_LAUNCHER) setPackage(context.packageName) - }, - 0 + } ) .filter { it.activityInfo.name != ACTIVITY_INFO_NAME } .takeIf { it.isNotEmpty() } ?.let { activities -> val dbInspectorActivity = activities.first().activityInfo - val componentName = ComponentName(dbInspectorActivity.packageName, dbInspectorActivity.name) + val componentName = ComponentName( + dbInspectorActivity.packageName, + dbInspectorActivity.name + ) dynamicShortcuts.let { it.count { shortcutInfo -> @@ -70,7 +75,12 @@ internal object DbInspectorShortcutManager { .setLongLabel(context.getString(R.string.dbinspector_launcher_name)) .setShortLabel(context.getString(R.string.dbinspector_launcher_name)) .setActivity(componentName) - .setIcon(Icon.createWithResource(context, R.mipmap.dbinspector_launcher)) + .setIcon( + Icon.createWithResource( + context, + R.mipmap.dbinspector_launcher + ) + ) .setIntent(intent) .build() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/content/shared/preview/PreviewContentDialog.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/content/shared/preview/PreviewContentDialog.kt index cd6b2b2a..20ceae4f 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/content/shared/preview/PreviewContentDialog.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/content/shared/preview/PreviewContentDialog.kt @@ -22,6 +22,7 @@ import com.infinum.dbinspector.ui.Presentation.Constants.Keys.PREVIEW_CELL import com.infinum.dbinspector.ui.shared.base.BaseBottomSheetDialogFragment import com.infinum.dbinspector.ui.shared.base.BaseViewModel import com.infinum.dbinspector.ui.shared.delegates.viewBinding +import getParcelableCompat import java.io.File import java.io.FileOutputStream @@ -53,7 +54,10 @@ internal class PreviewContentDialog : super.onCreate(savedInstanceState) arguments?.let { - cell = it.getParcelable(PREVIEW_CELL) + cell = it.getParcelableCompat( + PREVIEW_CELL, + Cell::class.java + ) } } @@ -166,7 +170,10 @@ internal class PreviewContentDialog : imageLayout.isVisible = true imageView.setImageBitmap(image) descriptionView.text = "${image.width} x ${image.height} " + - Formatter.formatShortFileSize(descriptionView.context, imageBytes.size.toLong()) + Formatter.formatShortFileSize( + descriptionView.context, + imageBytes.size.toLong() + ) } } } @@ -180,7 +187,9 @@ internal class PreviewContentDialog : content ) ) - Toast.makeText(activity, R.string.dbinspector_preview_success, Toast.LENGTH_SHORT).show() + Toast.makeText(activity, R.string.dbinspector_preview_success, Toast.LENGTH_SHORT) + .show() } - ?: Toast.makeText(activity, R.string.dbinspector_preview_failed, Toast.LENGTH_SHORT).show() + ?: Toast.makeText(activity, R.string.dbinspector_preview_failed, Toast.LENGTH_SHORT) + .show() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/remove/RemoveDatabaseDialog.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/remove/RemoveDatabaseDialog.kt index 2c290f0a..87b611b3 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/remove/RemoveDatabaseDialog.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/remove/RemoveDatabaseDialog.kt @@ -13,6 +13,7 @@ import com.infinum.dbinspector.ui.Presentation.Constants.Keys.SHOULD_REFRESH import com.infinum.dbinspector.ui.shared.base.BaseActivity import com.infinum.dbinspector.ui.shared.base.BaseBottomSheetDialogFragment import com.infinum.dbinspector.ui.shared.delegates.viewBinding +import getParcelableCompat import org.koin.androidx.viewmodel.ext.android.viewModel internal class RemoveDatabaseDialog : @@ -39,7 +40,10 @@ internal class RemoveDatabaseDialog : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - database = arguments?.getParcelable(REMOVE_DATABASE_DESCRIPTOR) + database = arguments?.getParcelableCompat( + REMOVE_DATABASE_DESCRIPTOR, + DatabaseDescriptor::class.java + ) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/rename/RenameDatabaseDialog.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/rename/RenameDatabaseDialog.kt index ac29510b..c311387b 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/rename/RenameDatabaseDialog.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/databases/rename/RenameDatabaseDialog.kt @@ -15,6 +15,7 @@ import com.infinum.dbinspector.ui.Presentation.Constants.Keys.RENAME_DATABASE_DE import com.infinum.dbinspector.ui.shared.base.BaseActivity import com.infinum.dbinspector.ui.shared.base.BaseBottomSheetDialogFragment import com.infinum.dbinspector.ui.shared.delegates.viewBinding +import getParcelableCompat import org.koin.androidx.viewmodel.ext.android.viewModel internal class RenameDatabaseDialog : @@ -46,7 +47,10 @@ internal class RenameDatabaseDialog : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - database = arguments?.getParcelable(RENAME_DATABASE_DESCRIPTOR) + database = arguments?.getParcelableCompat( + RENAME_DATABASE_DESCRIPTOR, + DatabaseDescriptor::class.java + ) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -64,7 +68,8 @@ internal class RenameDatabaseDialog : nameInput.setText(database?.name) nameInput.doOnTextChanged { text, _, _, _ -> if (text.isNullOrBlank()) { - nameInputLayout.error = getString(R.string.dbinspector_rename_database_error_blank) + nameInputLayout.error = + getString(R.string.dbinspector_rename_database_error_blank) } else { nameInputLayout.error = null } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e154177..27841779 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -dbinspector = "5.4.8" +dbinspector = "5.4.9" gradle = "7.2.2" kotlin = "1.7.10" coroutines = "1.6.4" From ec4fc74887f8d12235b737b1debf835d838c25c2 Mon Sep 17 00:00:00 2001 From: Bojan Date: Fri, 21 Oct 2022 22:33:28 +0200 Subject: [PATCH 2/2] * Update Kotlin to 1.7.20. * Update dependencies to stable version. * Implement Android 13 compatibility and changes. * Refactor logger interface and classes. * Add KDoc on all public classes. --- CHANGELOG.md | 6 ++- README.md | 12 ++--- dbinspector-no-op/proguard-rules.txt | 9 ++-- .../com/infinum/dbinspector/DbInspector.kt | 23 +++++++- .../data/models/memory/logger/Level.kt | 8 --- .../sources/memory/logger/AndroidLogger.kt | 24 --------- .../data/sources/memory/logger/EmptyLogger.kt | 8 --- .../data/sources/memory/logger/Logger.kt | 39 -------------- .../dbinspector/logger/AndroidLogger.kt | 52 +++++++++++++++++++ .../com/infinum/dbinspector/logger/Level.kt | 26 ++++++++++ .../com/infinum/dbinspector/logger/Logger.kt | 51 ++++++++++++++++++ dbinspector/build.gradle | 1 - dbinspector/proguard-rules.txt | 11 ++-- .../com/infinum/dbinspector/DbInspector.kt | 23 +++++++- .../data/models/memory/logger/Level.kt | 8 --- .../sources/memory/logger/AndroidLogger.kt | 24 --------- .../data/sources/memory/logger/EmptyLogger.kt | 8 --- .../data/sources/memory/logger/Logger.kt | 39 -------------- .../com/infinum/dbinspector/di/LibraryKoin.kt | 5 +- .../dbinspector/logger/AndroidLogger.kt | 52 +++++++++++++++++++ .../com/infinum/dbinspector/logger/Level.kt | 26 ++++++++++ .../com/infinum/dbinspector/logger/Logger.kt | 51 ++++++++++++++++++ .../ui/DbInspectorShortcutManager.kt | 2 +- .../infinum/dbinspector/ui/Presentation.kt | 2 +- .../ui/shared/base/BaseViewModel.kt | 7 ++- dokka.gradle | 46 ++++++++++++++++ gradle/libs.versions.toml | 32 ++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- .../dbinspector/sample/MainActivity.kt | 5 +- 29 files changed, 393 insertions(+), 209 deletions(-) delete mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt delete mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt delete mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt delete mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt create mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt create mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt create mode 100644 dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt delete mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt delete mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt delete mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt delete mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt create mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt create mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt create mode 100644 dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 3909af5d..8302e977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,13 @@ Changelog ## Version 5.4.9 -_2022-MM-DD_ +_2022-10-21_ +* Update Kotlin to 1.7.20. +* Update dependencies to stable version. * Implement Android 13 compatibility and changes. +* Refactor logger interface and classes. +* Add KDoc on all public classes. ## Version 5.4.8 diff --git a/README.md b/README.md index 0d9952aa..2755723f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ _DbInspector_ provides a simple way to view the contents of the in-app database for debugging purposes. There is no need to pull the database from a connected device. -This library supports inspecting of the SQLite databases created by CouchBase Lite out of the box. +This library also supports inspecting of the SQLite databases created by CouchBase Lite out of the box. With this library you can: * preview all application sandbox databases * import single or multiple databases at once @@ -44,13 +44,13 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle. **Groovy** ```groovy -debugImplementation "com.infinum.dbinspector:dbinspector:5.4.8" -releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.8" +debugImplementation "com.infinum.dbinspector:dbinspector:5.4.9" +releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.9" ``` **KotlinDSL** ```kotlin -debugImplementation("com.infinum.dbinspector:dbinspector:5.4.8") -releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.8") +debugImplementation("com.infinum.dbinspector:dbinspector:5.4.9") +releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.9") ``` ### Usage @@ -86,7 +86,7 @@ Further modification can be done according to rules of [manifest merging](https: _DbInspector_ has a build in editor scoped per database connection currently used. It offers autocomplete of SQLite3 keywords and functions, current table and column names. Built in editor also provides a history of executed statements, not matter if they were successful or not. -Hisotry of statements is persisted between sessions and can be cleared on demand at any point. +History of statements is persisted between sessions and can be cleared on demand at any point. Panes between editors' input and result are scalable and can be adjusted by dragging the splitter between them. Landscape mode is supported too for better result preview of large datasets. diff --git a/dbinspector-no-op/proguard-rules.txt b/dbinspector-no-op/proguard-rules.txt index a19fcfca..03ccb991 100644 --- a/dbinspector-no-op/proguard-rules.txt +++ b/dbinspector-no-op/proguard-rules.txt @@ -2,16 +2,13 @@ -keep public class com.infinum.dbinspector.DbInspector { public protected *; } --keep public class com.infinum.dbinspector.data.models.memory.logger.Level { +-keep public class com.infinum.dbinspector.logger.Level { public protected *; } --keep public class com.infinum.dbinspector.data.sources.memory.logger.Logger { +-keep public class com.infinum.dbinspector.logger.Logger { public protected *; } --keep public class com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger { - public protected *; -} --keep public class com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger { +-keep public class com.infinum.dbinspector.logger.AndroidLogger { public protected *; } diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt index 8c2d0c20..fe14f9e3 100644 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt +++ b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt @@ -2,11 +2,32 @@ package com.infinum.dbinspector -import com.infinum.dbinspector.data.sources.memory.logger.Logger +import com.infinum.dbinspector.logger.Logger +/** + * _DbInspector_ provides a simple way to view the contents of the in-app database for debugging purposes. + * There is no need to pull the database from a connected device. + * This library also supports inspecting of the SQLite databases created by CouchBase Lite out of the box. + * With this library you can: + * - preview all application sandbox databases + * - import single or multiple databases at once + * - search, delete, rename, copy, share a database + * - preview tables, views and triggers + * - preview table or view pragma + * - delete table contents + * - drop view or trigger + * - search table, view or trigger + * - sort table, view or trigger per column + * - execute any valid SQL command in editor per database connection + */ @Suppress("UnusedPrivateMember") public object DbInspector { + /** + * Show a list of databases. + * + * @param[logger] Optional logger implementation of [Logger][com.infinum.dbinspector.logger.Logger] interface. + */ @JvmStatic @JvmOverloads public fun show(logger: Logger? = null): Unit = Unit diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt deleted file mode 100644 index 65097e1e..00000000 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.infinum.dbinspector.data.models.memory.logger - -public enum class Level { - DEBUG, - INFO, - ERROR, - NONE -} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt deleted file mode 100644 index 5ca49697..00000000 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import android.util.Log -import com.infinum.dbinspector.data.models.memory.logger.Level - -public class AndroidLogger( - level: Level = Level.INFO -) : Logger(level) { - - override fun log(level: Level, message: String) { - if (this.level <= level) { - logOnLevel(message, level) - } - } - - private fun logOnLevel(message: String, level: Level) { - when (level) { - Level.DEBUG -> Log.d(tag(), message) - Level.INFO -> Log.i(tag(), message) - Level.ERROR -> Log.e(tag(), message) - else -> Log.e(tag(), message) - } - } -} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt deleted file mode 100644 index ebe1025c..00000000 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import com.infinum.dbinspector.data.models.memory.logger.Level - -internal class EmptyLogger : Logger(Level.NONE) { - - override fun log(level: Level, message: String) = Unit -} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt deleted file mode 100644 index 50dde2ef..00000000 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import com.infinum.dbinspector.data.models.memory.logger.Level - -public abstract class Logger( - public var level: Level = Level.INFO -) { - - public companion object { - internal const val DEFAULT_LOG_TAG = "[DbInspector]" - } - - @Suppress("MemberVisibilityCanBePrivate") - public var tag: String? = null - - public abstract fun log(level: Level, message: String) - - public fun debug(message: String) { - doLog(Level.DEBUG, message) - } - - public fun info(message: String) { - doLog(Level.INFO, message) - } - - public fun error(message: String) { - doLog(Level.ERROR, message) - } - - protected fun tag(): String = tag ?: DEFAULT_LOG_TAG - - private fun canLog(level: Level): Boolean = this.level <= level - - private fun doLog(level: Level, message: String) { - if (canLog(level)) { - log(level, message) - } - } -} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt new file mode 100644 index 00000000..c6d6a6ce --- /dev/null +++ b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt @@ -0,0 +1,52 @@ +package com.infinum.dbinspector.logger + +import android.util.Log + +/** + * Android specific logger implementation. + * + * @constructor Create an Android logger instance without any parameters. + */ +public class AndroidLogger : Logger { + + internal companion object { + internal const val DEFAULT_LOG_TAG = "[DbInspector]" + } + + private var logTag: String? = null + + private var logLevel: Level = Level.INFO + + override fun log(level: Level, message: String) { + if (canLog(level)) { + doLog(level, message) + } + } + + override fun debug(message: String): Unit = doLog(Level.DEBUG, message) + + override fun info(message: String): Unit = doLog(Level.INFO, message) + + override fun error(message: String): Unit = doLog(Level.ERROR, message) + + override fun setTag(tag: String) { + this.logTag = tag + } + + override fun setLevel(level: Level) { + this.logLevel = level + } + + private fun tag(): String = logTag ?: DEFAULT_LOG_TAG + + private fun canLog(level: Level): Boolean = this.logLevel <= level + + private fun doLog(level: Level, message: String) { + when (level) { + Level.DEBUG -> Log.d(tag(), message) + Level.INFO -> Log.i(tag(), message) + Level.ERROR -> Log.e(tag(), message) + else -> Log.e(tag(), message) + } + } +} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt new file mode 100644 index 00000000..19d7edf0 --- /dev/null +++ b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt @@ -0,0 +1,26 @@ +package com.infinum.dbinspector.logger + +/** + * Level of a log message. + */ +public enum class Level { + /** + * Debug log level. + */ + DEBUG, + + /** + * Info log level. + */ + INFO, + + /** + * Error log level. + */ + ERROR, + + /** + * No log level. + */ + NONE +} diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt new file mode 100644 index 00000000..bc597247 --- /dev/null +++ b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt @@ -0,0 +1,51 @@ +package com.infinum.dbinspector.logger + +/** + * Logger interface exposing logging messages by level, or using direct overloads for debug, info and error messages. + * Implementation class also must support setting a tag and level. + */ +public interface Logger { + + /** + * Log a message with an explicit level. + * + * @param level Level for any output in terminal. + * @param message Text output in terminal. + */ + public fun log(level: Level, message: String) + + /** + * Log a debug message. + * + * @param message Text output in terminal. + */ + public fun debug(message: String) + + /** + * Log an info message. + * + * @param message Text output in terminal. + */ + public fun info(message: String) + + /** + * Log an error message. + * + * @param message Text output in terminal. + */ + public fun error(message: String) + + /** + * Set a tag for a logger instance. + * + * @param tag Textual tag for any output in terminal. + */ + public fun setTag(tag: String) + + /** + * Set a default level for a logger instance. + * + * @param level Level for any output in terminal. + */ + public fun setLevel(level: Level) +} diff --git a/dbinspector/build.gradle b/dbinspector/build.gradle index 97a37027..4f373177 100644 --- a/dbinspector/build.gradle +++ b/dbinspector/build.gradle @@ -131,7 +131,6 @@ protobuf { } kover { - disabled = false coverageEngine.set(kotlinx.kover.api.CoverageEngine.INTELLIJ) intellijEngineVersion.set(libs.versions.intellij.get()) jacocoEngineVersion.set(libs.versions.jacoco.get()) diff --git a/dbinspector/proguard-rules.txt b/dbinspector/proguard-rules.txt index f0c5cce4..2c428ede 100644 --- a/dbinspector/proguard-rules.txt +++ b/dbinspector/proguard-rules.txt @@ -5,18 +5,13 @@ -keep public class com.infinum.dbinspector.DbInspector { public protected *; } --keep public class com.infinum.dbinspector.data.models.memory.logger.Level { +-keep public class com.infinum.dbinspector.logger.Level { public protected *; } - --keep public class com.infinum.dbinspector.data.sources.memory.logger.Logger { +-keep public class com.infinum.dbinspector.logger.Logger { public protected *; } - --keep public class com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger { - public protected *; -} --keep public class com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger { +-keep public class com.infinum.dbinspector.logger.AndroidLogger { public protected *; } -keep class androidx.datastore.*.* {*;} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt index cbb0fb2e..c0b6096e 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt @@ -1,12 +1,33 @@ package com.infinum.dbinspector import android.content.Intent -import com.infinum.dbinspector.data.sources.memory.logger.Logger +import com.infinum.dbinspector.logger.Logger import com.infinum.dbinspector.ui.Presentation import com.infinum.dbinspector.ui.databases.DatabasesActivity +/** + * _DbInspector_ provides a simple way to view the contents of the in-app database for debugging purposes. + * There is no need to pull the database from a connected device. + * This library also supports inspecting of the SQLite databases created by CouchBase Lite out of the box. + * With this library you can: + * - preview all application sandbox databases + * - import single or multiple databases at once + * - search, delete, rename, copy, share a database + * - preview tables, views and triggers + * - preview table or view pragma + * - delete table contents + * - drop view or trigger + * - search table, view or trigger + * - sort table, view or trigger per column + * - execute any valid SQL command in editor per database connection + */ public object DbInspector { + /** + * Show a list of databases. + * + * @param[logger] Optional logger implementation of [Logger][com.infinum.dbinspector.logger.Logger] interface. + */ @JvmStatic @JvmOverloads public fun show(logger: Logger? = null) { diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt deleted file mode 100644 index 65097e1e..00000000 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/models/memory/logger/Level.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.infinum.dbinspector.data.models.memory.logger - -public enum class Level { - DEBUG, - INFO, - ERROR, - NONE -} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt deleted file mode 100644 index 5ca49697..00000000 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/AndroidLogger.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import android.util.Log -import com.infinum.dbinspector.data.models.memory.logger.Level - -public class AndroidLogger( - level: Level = Level.INFO -) : Logger(level) { - - override fun log(level: Level, message: String) { - if (this.level <= level) { - logOnLevel(message, level) - } - } - - private fun logOnLevel(message: String, level: Level) { - when (level) { - Level.DEBUG -> Log.d(tag(), message) - Level.INFO -> Log.i(tag(), message) - Level.ERROR -> Log.e(tag(), message) - else -> Log.e(tag(), message) - } - } -} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt deleted file mode 100644 index ebe1025c..00000000 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/EmptyLogger.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import com.infinum.dbinspector.data.models.memory.logger.Level - -internal class EmptyLogger : Logger(Level.NONE) { - - override fun log(level: Level, message: String) = Unit -} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt deleted file mode 100644 index 50dde2ef..00000000 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/data/sources/memory/logger/Logger.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.infinum.dbinspector.data.sources.memory.logger - -import com.infinum.dbinspector.data.models.memory.logger.Level - -public abstract class Logger( - public var level: Level = Level.INFO -) { - - public companion object { - internal const val DEFAULT_LOG_TAG = "[DbInspector]" - } - - @Suppress("MemberVisibilityCanBePrivate") - public var tag: String? = null - - public abstract fun log(level: Level, message: String) - - public fun debug(message: String) { - doLog(Level.DEBUG, message) - } - - public fun info(message: String) { - doLog(Level.INFO, message) - } - - public fun error(message: String) { - doLog(Level.ERROR, message) - } - - protected fun tag(): String = tag ?: DEFAULT_LOG_TAG - - private fun canLog(level: Level): Boolean = this.level <= level - - private fun doLog(level: Level, message: String) { - if (canLog(level)) { - log(level, message) - } - } -} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/di/LibraryKoin.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/di/LibraryKoin.kt index 2ef9eda6..bfeb5039 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/di/LibraryKoin.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/di/LibraryKoin.kt @@ -2,8 +2,7 @@ package com.infinum.dbinspector.di import android.content.Context import com.infinum.dbinspector.BuildConfig -import com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger -import com.infinum.dbinspector.data.sources.memory.logger.Logger +import com.infinum.dbinspector.logger.Logger import com.infinum.dbinspector.ui.Presentation import org.koin.android.ext.koin.androidContext import org.koin.android.ext.koin.androidLogger @@ -20,10 +19,8 @@ internal object LibraryKoin { koinApplication.apply { androidLogger(if (BuildConfig.DEBUG) Level.ERROR else Level.NONE) androidContext(context) - module { single { EmptyLogger() } } modules(Presentation.modules()) } - setLibraryLogger(EmptyLogger()) } fun koin(): Koin = koinApplication.koin diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt new file mode 100644 index 00000000..c6d6a6ce --- /dev/null +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/AndroidLogger.kt @@ -0,0 +1,52 @@ +package com.infinum.dbinspector.logger + +import android.util.Log + +/** + * Android specific logger implementation. + * + * @constructor Create an Android logger instance without any parameters. + */ +public class AndroidLogger : Logger { + + internal companion object { + internal const val DEFAULT_LOG_TAG = "[DbInspector]" + } + + private var logTag: String? = null + + private var logLevel: Level = Level.INFO + + override fun log(level: Level, message: String) { + if (canLog(level)) { + doLog(level, message) + } + } + + override fun debug(message: String): Unit = doLog(Level.DEBUG, message) + + override fun info(message: String): Unit = doLog(Level.INFO, message) + + override fun error(message: String): Unit = doLog(Level.ERROR, message) + + override fun setTag(tag: String) { + this.logTag = tag + } + + override fun setLevel(level: Level) { + this.logLevel = level + } + + private fun tag(): String = logTag ?: DEFAULT_LOG_TAG + + private fun canLog(level: Level): Boolean = this.logLevel <= level + + private fun doLog(level: Level, message: String) { + when (level) { + Level.DEBUG -> Log.d(tag(), message) + Level.INFO -> Log.i(tag(), message) + Level.ERROR -> Log.e(tag(), message) + else -> Log.e(tag(), message) + } + } +} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt new file mode 100644 index 00000000..19d7edf0 --- /dev/null +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Level.kt @@ -0,0 +1,26 @@ +package com.infinum.dbinspector.logger + +/** + * Level of a log message. + */ +public enum class Level { + /** + * Debug log level. + */ + DEBUG, + + /** + * Info log level. + */ + INFO, + + /** + * Error log level. + */ + ERROR, + + /** + * No log level. + */ + NONE +} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt new file mode 100644 index 00000000..bc597247 --- /dev/null +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/logger/Logger.kt @@ -0,0 +1,51 @@ +package com.infinum.dbinspector.logger + +/** + * Logger interface exposing logging messages by level, or using direct overloads for debug, info and error messages. + * Implementation class also must support setting a tag and level. + */ +public interface Logger { + + /** + * Log a message with an explicit level. + * + * @param level Level for any output in terminal. + * @param message Text output in terminal. + */ + public fun log(level: Level, message: String) + + /** + * Log a debug message. + * + * @param message Text output in terminal. + */ + public fun debug(message: String) + + /** + * Log an info message. + * + * @param message Text output in terminal. + */ + public fun info(message: String) + + /** + * Log an error message. + * + * @param message Text output in terminal. + */ + public fun error(message: String) + + /** + * Set a tag for a logger instance. + * + * @param tag Textual tag for any output in terminal. + */ + public fun setTag(tag: String) + + /** + * Set a default level for a logger instance. + * + * @param level Level for any output in terminal. + */ + public fun setLevel(level: Level) +} diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt index 4b8e904f..5e482ed6 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/DbInspectorShortcutManager.kt @@ -9,7 +9,7 @@ import android.content.pm.ShortcutManager import android.graphics.drawable.Icon import android.os.Build import com.infinum.dbinspector.R -import com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger +import com.infinum.dbinspector.logger.AndroidLogger import com.infinum.dbinspector.extensions.queryIntentActivitiesCompat import com.infinum.dbinspector.ui.databases.DatabasesActivity diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt index b2f4584e..eefa251e 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt @@ -2,9 +2,9 @@ package com.infinum.dbinspector.ui import android.annotation.SuppressLint import android.content.Context -import com.infinum.dbinspector.data.sources.memory.logger.Logger import com.infinum.dbinspector.di.LibraryKoin import com.infinum.dbinspector.domain.Domain +import com.infinum.dbinspector.logger.Logger import com.infinum.dbinspector.ui.content.table.TableViewModel import com.infinum.dbinspector.ui.content.trigger.TriggerViewModel import com.infinum.dbinspector.ui.content.view.ViewViewModel diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseViewModel.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseViewModel.kt index 1803d13e..7d110fac 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseViewModel.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseViewModel.kt @@ -2,9 +2,9 @@ package com.infinum.dbinspector.ui.shared.base import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.infinum.dbinspector.data.sources.memory.logger.Logger import com.infinum.dbinspector.di.LibraryKoin import com.infinum.dbinspector.di.LibraryKoinComponent +import com.infinum.dbinspector.logger.Logger import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -49,7 +49,10 @@ internal abstract class BaseViewModel : ViewModel(), LibraryKoinCo supervisorJob.cancel() } - protected fun launch(scope: CoroutineScope = runningScope, block: suspend CoroutineScope.() -> Unit) { + protected fun launch( + scope: CoroutineScope = runningScope, + block: suspend CoroutineScope.() -> Unit + ) { scope.launch(errorHandler + mainDispatchers + supervisorJob) { block.invoke(this) } } diff --git a/dokka.gradle b/dokka.gradle index 0a2e4647..cc0b5d9e 100644 --- a/dokka.gradle +++ b/dokka.gradle @@ -5,7 +5,10 @@ tasks.named("dokkaJavadoc") { dokkaSourceSets { named("main") { + moduleName.set(rootProject.name) includeNonPublic.set(false) + suppressObviousFunctions.set(true) + suppressInheritedMembers.set(true) skipDeprecated.set(true) reportUndocumented.set(true) skipEmptyPackages.set(true) @@ -39,3 +42,46 @@ tasks.named("dokkaJavadoc") { } } } + +tasks.named("dokkaHtml") { + outputDirectory.set(file("$buildDir/html")) + + dokkaSourceSets { + named("main") { + moduleName.set(rootProject.name) + includeNonPublic.set(false) + suppressObviousFunctions.set(true) + suppressInheritedMembers.set(true) + skipDeprecated.set(true) + reportUndocumented.set(true) + skipEmptyPackages.set(true) + platform.set(org.jetbrains.dokka.Platform.jvm) + jdkVersion.set(8) + noStdlibLink.set(false) + noJdkLink.set(false) + noAndroidSdkLink.set(false) + androidVariants.set(["debug"]) + sourceLink { + localDirectory.set(file("src/main/kotlin")) + remoteUrl.set(uri("https://github.com/infinum/android_dbinspector/")) + remoteLineSuffix.set("#L") + } + perPackageOption { + prefix.set("com.infinum.dbinspector.extensions") + suppress.set(true) + } + perPackageOption { + prefix.set("com.infinum.dbinspector.domain.shared") + suppress.set(true) + } + perPackageOption { + prefix.set("com.infinum.dbinspector.ui.shared") + suppress.set(true) + } + perPackageOption { + prefix.set("com.infinum.dbinspector.sample") + suppress.set(true) + } + } + } +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 27841779..fe0e50ea 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] dbinspector = "5.4.9" -gradle = "7.2.2" -kotlin = "1.7.10" +gradle = "7.3.1" +kotlin = "1.7.20" coroutines = "1.6.4" -core = "1.8.0" -appcompat = "1.4.2" -activity = "1.5.1" -fragment = "1.5.1" +core = "1.9.0" +appcompat = "1.5.1" +activity = "1.6.0" +fragment = "1.5.3" lifecycle = "2.5.1" viewpager = "1.0.0" paging = "3.1.1" @@ -15,23 +15,23 @@ startup = "1.1.1" swiperefresh = "1.1.0" datastore = "1.0.0" dynamicanimation = "1.0.0" -design = "1.6.1" -protobuf-core = "3.21.4" -protobuf-plugin = "0.8.19" -koin = "3.2.0" +design = "1.7.0" +protobuf-core = "3.21.8" +protobuf-plugin = "0.9.1" +koin = "3.2.2" detekt = "1.21.0" ktlintplugin = "10.3.0" ktlint = "0.45.2" cpd = "3.2" -dokka = "1.7.10" -kover = "0.5.1" +dokka = "1.7.20" +kover = "0.6.1" jacoco = "0.8.8" intellij = "1.0.647" -junit5 = "5.8.2" -mockk = "1.12.3" -mockito = "4.5.1" +junit5 = "5.9.1" +mockk = "1.13.2" +mockito = "4.8.1" mockitokotlin = "4.0.0" -turbine = "0.8.0" +turbine = "0.12.0" [libraries] library = { module = "com.infinum.dbinspector:dbinspector", version.ref = "dbinspector" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fce..ae04661e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt b/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt index 2434554d..07a4a99b 100644 --- a/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt @@ -2,8 +2,8 @@ package com.infinum.dbinspector.sample import android.os.Bundle import androidx.appcompat.app.AppCompatActivity +import com.infinum.dbinspector.logger.AndroidLogger import com.infinum.dbinspector.DbInspector -import com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger import com.infinum.dbinspector.sample.databinding.ActivityMainBinding import org.koin.androidx.viewmodel.ext.android.viewModel @@ -14,7 +14,8 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - supportActionBar?.title = "${supportActionBar?.title?.toString().orEmpty()} (${BuildConfig.BUILD_TYPE})" + supportActionBar?.title = + "${supportActionBar?.title?.toString().orEmpty()} (${BuildConfig.BUILD_TYPE})" ActivityMainBinding.inflate(layoutInflater) .also { setContentView(it.root) }