我陷入了键盘问题 我将在下面附加链接,以便您可以观看几秒钟的动画。
用词: 当键盘打开时,以及如果我滑下滑动面板时。面板动画滞后,并且在没有任何拖动动画的情况下将折叠的均值从上到下定向 我被这个问题困扰了几天。 滑动面板拖动时,我隐藏了键盘
我正在使用umano sliding panel library
这是代码:
sliding_layout.addPanelSlideListener(object : SlidingUpPanelLayout.PanelSlideListener {
override fun onPanelSlide(panel: View?, slideOffset: Float) {
if (slideOffset < 1.0) { //offset becomes less then 1 when starting to collapsed
Utils.hideKeyboard(this@DestinationAddressActivity,panel!!)
}
}
override fun onPanelStateChanged(panel: View?, previousState: SlidingUpPanelLayout.PanelState?, newState: SlidingUpPanelLayout.PanelState?) {
if (newState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
Utils.hideKeyboard(this@DestinationAddressActivity, etSourceAddr)
stopStateHide()
calculateLayoutHeight()
etSourceAddr.isCursorVisible = false
etDestAddr.isCursorVisible = false
val cameraPosition = CameraPosition.Builder()
.target(selectedLatLng)
.zoom(mMap?.cameraPosition?.zoom!!).build()
viewMap(cameraPosition, selectedLatLng)
} else {
stopStateShow()
recyclerViewSaved.visibility = View.VISIBLE
}
}
})
//sliding Panel dependency
implementation 'com.sothree.slidinguppanel:library:3.4.0'