diff --git a/.idea/misc.xml b/.idea/misc.xml index 703e5d4..af0bbdd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/backdrop/build.gradle b/backdrop/build.gradle index 323c21d..febd53c 100644 --- a/backdrop/build.gradle +++ b/backdrop/build.gradle @@ -23,6 +23,10 @@ android { } } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + } dependencies { @@ -30,4 +34,5 @@ dependencies { implementation deps.android.drawableToolbox implementation deps.kotlin.kotlin_jre implementation deps.android.appcompat + implementation deps.android.androidx_core } diff --git a/backdrop/src/main/java/com/roacult/backdrop/BackdropLayout.kt b/backdrop/src/main/java/com/roacult/backdrop/BackdropLayout.kt index af399e8..a5266c1 100644 --- a/backdrop/src/main/java/com/roacult/backdrop/BackdropLayout.kt +++ b/backdrop/src/main/java/com/roacult/backdrop/BackdropLayout.kt @@ -11,6 +11,7 @@ import android.util.Log import android.view.View import android.widget.FrameLayout import androidx.appcompat.widget.Toolbar +import androidx.core.view.isVisible import top.defaults.drawabletoolbox.DrawableBuilder class BackdropLayout @JvmOverloads constructor(context: Context, attribute : AttributeSet? = null, defStyleAttr: Int = 0) @@ -140,7 +141,7 @@ class BackdropLayout @JvmOverloads constructor(context: Context, attribute : Att if(disableWhenOpened) { getDisablingView().translationY = transitionHeight getDisablingView().alpha = calculateAlphaVlue(transitionHeight) - getDisablingView().visible(true) + getDisablingView().isVisible = true } } } @@ -153,7 +154,7 @@ class BackdropLayout @JvmOverloads constructor(context: Context, attribute : Att if(disableWhenOpened) { getDisablingView().translationY = 0F getDisablingView().alpha = 0F - getDisablingView().visible(false) + getDisablingView().isVisible = false } } } @@ -230,7 +231,7 @@ class BackdropLayout @JvmOverloads constructor(context: Context, attribute : Att val translation = it.animatedValue as Float getFrontLayout().translationY = translation if(disableWhenOpened) { - getDisablingView().visible(translation != 0F) + getDisablingView().isVisible = translation != 0F getDisablingView().translationY = translation getDisablingView().alpha = calculateAlphaVlue(translation) } diff --git a/backdrop/src/main/java/com/roacult/backdrop/Utils.kt b/backdrop/src/main/java/com/roacult/backdrop/Utils.kt deleted file mode 100644 index 4700f4a..0000000 --- a/backdrop/src/main/java/com/roacult/backdrop/Utils.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.roacult.backdrop - -import android.view.View - -fun View.visible(show: Boolean) { - visibility = if (show) View.VISIBLE else View.GONE -} \ No newline at end of file diff --git a/versions.gradle b/versions.gradle index a130e1e..8eebc62 100644 --- a/versions.gradle +++ b/versions.gradle @@ -16,6 +16,7 @@ ext.deps = [:] //pairs below def versions = [:] +versions.androidx = "1.3.1" versions.espresso = "3.1.0" versions.mockito = "2.13.0" versions.junit = "5.1.1" @@ -72,6 +73,7 @@ android.fragment = "androidx.fragment:fragment:$versions.appcompat" android.recyclerview = "androidx.recyclerview:recyclerview:$versions.appcompat" android.design = "com.google.android.material:material:$versions.design" android.constraint_layout = "androidx.constraintlayout:constraintlayout:$versions.constraint_layout" +android.androidx_core = "androidx.core:core-ktx:$versions.androidx" android.lifecycle_extensions = "androidx.lifecycle:lifecycle-extensions:$versions.lifecycle" android.ktx_fragment = "androidx.fragment:fragment-ktx:$versions.ktx_fragment" android.picasso = "com.squareup.picasso:picasso:$versions.picasso_version" @@ -180,7 +182,7 @@ deps.rxJava = rxjava def build_versions = [:] build_versions.min_sdk = 16 -build_versions.target_sdk = 28 +build_versions.target_sdk = 29 ext.build_versions = build_versions deps.android_gradle_plugin = "com.android.tools.build:gradle:$versions.android_gradle_plugin"