From 72c3a3436eea008304263f3f560bf928ff4b5db8 Mon Sep 17 00:00:00 2001 From: Bojan Date: Sat, 25 Sep 2021 12:20:51 +0200 Subject: [PATCH] Fix backwards compatibility issues. --- CHANGELOG.md | 7 +++++++ README.md | 8 ++++---- config.gradle | 4 ++-- .../dbinspector/ui/shared/base/BaseActivity.kt | 5 +++++ .../shared/base/BaseBottomSheetDialogFragment.kt | 16 ++++++++++++++++ dbinspector/src/main/res/values/themes.xml | 9 +++------ gradle/libs.versions.toml | 4 ++-- 7 files changed, 39 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9efbf26..90c16647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========= +## Version 5.4.1 + +_2021-09-25_ + +* Update to Kotlin 1.5.31. +* Fix backwards compatibility for specific Android API levels. + ## Version 5.4.0 _2021-09-13_ diff --git a/README.md b/README.md index de351267..26077ccc 100644 --- a/README.md +++ b/README.md @@ -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.0" -releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.0" +debugImplementation "com.infinum.dbinspector:dbinspector:5.4.1" +releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.1" ``` **KotlinDSL** ```kotlin -debugImplementation("com.infinum.dbinspector:dbinspector:5.4.0") -releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.0") +debugImplementation("com.infinum.dbinspector:dbinspector:5.4.1") +releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.1") ``` ### Usage diff --git a/config.gradle b/config.gradle index abc7ccbb..a3b440f5 100644 --- a/config.gradle +++ b/config.gradle @@ -7,7 +7,7 @@ ext { ] releaseConfig = [ "group" : "com.infinum.dbinspector", - "version" : "5.4.0", - "versionCode": 5 * 100 * 100 + 4 * 100 + 0 + "version" : "5.4.1", + "versionCode": 5 * 100 * 100 + 4 * 100 + 1 ] } \ No newline at end of file diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseActivity.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseActivity.kt index e1dc2a2a..1f6058a4 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseActivity.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseActivity.kt @@ -1,8 +1,10 @@ package com.infinum.dbinspector.ui.shared.base import android.os.Bundle +import androidx.annotation.CallSuper import androidx.annotation.RestrictTo import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.WindowInsetsControllerCompat import androidx.lifecycle.lifecycleScope import androidx.viewbinding.ViewBinding import com.infinum.dbinspector.R @@ -13,9 +15,12 @@ internal abstract class BaseActivity : AppCompatActivity(), BaseVi abstract val binding: ViewBinding + @CallSuper override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = false + setContentView(binding.root) collectFlows(lifecycleScope) diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseBottomSheetDialogFragment.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseBottomSheetDialogFragment.kt index 615fe413..1f553fd3 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseBottomSheetDialogFragment.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/base/BaseBottomSheetDialogFragment.kt @@ -1,15 +1,19 @@ package com.infinum.dbinspector.ui.shared.base +import android.app.Dialog +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.WindowManager import androidx.annotation.CallSuper import androidx.annotation.LayoutRes import androidx.annotation.RestrictTo import androidx.lifecycle.lifecycleScope import androidx.viewbinding.ViewBinding import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import com.infinum.dbinspector.R import com.infinum.dbinspector.di.LibraryKoinComponent @RestrictTo(RestrictTo.Scope.LIBRARY) @@ -19,6 +23,18 @@ internal abstract class BaseBottomSheetDialogFragment( abstract val binding: ViewBinding + @CallSuper + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog = + super.onCreateDialog(savedInstanceState).apply { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + window?.let { + it.addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND) + it.attributes.blurBehindRadius = resources.getDimensionPixelSize(R.dimen.dbinspector_blur_radius) + } + } + } + + @CallSuper override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? = inflater.inflate(contentLayoutId, container, false) diff --git a/dbinspector/src/main/res/values/themes.xml b/dbinspector/src/main/res/values/themes.xml index 3aab7e70..cfc98ed4 100644 --- a/dbinspector/src/main/res/values/themes.xml +++ b/dbinspector/src/main/res/values/themes.xml @@ -1,5 +1,5 @@ - +