Update ViewExtensions.kt
This commit is contained in:
parent
c495c66a38
commit
7c0b3ee82c
1 changed files with 7 additions and 0 deletions
|
@ -20,6 +20,7 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
|
import androidx.core.animation.doOnEnd
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
|
@ -54,6 +55,12 @@ fun View.translateXAnimate(value: Float) {
|
||||||
.apply {
|
.apply {
|
||||||
duration = 300
|
duration = 300
|
||||||
start()
|
start()
|
||||||
|
doOnEnd {
|
||||||
|
|
||||||
|
if (value != 0f) {
|
||||||
|
this@translateXAnimate.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue