|
@@ -322,12 +322,12 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var listener = KeyboardUtils.OnSoftInputChangedListener {
|
|
|
- if (it == 0) {
|
|
|
- setChatRvPop(false, it)
|
|
|
- } else {
|
|
|
- setChatRvPop(true, it)
|
|
|
- }
|
|
|
+ private var isPopUp = false
|
|
|
+ private var keyboardHeight = 0
|
|
|
+ private var listener = KeyboardUtils.OnSoftInputChangedListener {
|
|
|
+ isPopUp = it != 0
|
|
|
+ keyboardHeight = it
|
|
|
+ setChatRvPop()
|
|
|
}
|
|
|
|
|
|
private fun setHeaderViewPosition() {
|
|
@@ -638,37 +638,32 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
}
|
|
|
|
|
|
|
|
|
- private var keyboardUpRvLayoutParams: ViewGroup.LayoutParams? = null
|
|
|
- private var keyboardCloseRvLayoutParams: ViewGroup.LayoutParams? = null
|
|
|
- private fun setChatRvPop(isPopUp: Boolean, height: Int) {
|
|
|
- if (isPopUp) {
|
|
|
- if (keyboardUpRvLayoutParams == null) {
|
|
|
- keyboardUpRvLayoutParams =
|
|
|
- ConstraintLayout.LayoutParams(0, DpPxUtil.dip2px(170f)).apply {
|
|
|
- bottomToBottom = R.id.cl
|
|
|
- startToStart = R.id.cl
|
|
|
- endToEnd = R.id.cl
|
|
|
- marginStart = DpPxUtil.dip2px(10f)
|
|
|
- marginEnd = DpPxUtil.dip2px(10f)
|
|
|
- bottomMargin = height + DpPxUtil.dip2px(55f)
|
|
|
- }
|
|
|
- }
|
|
|
+ private val keyboardUpRvLayoutParams by lazy {
|
|
|
+ ConstraintLayout.LayoutParams(0, DpPxUtil.dip2px(170f)).apply {
|
|
|
+ bottomToBottom = R.id.cl
|
|
|
+ startToStart = R.id.cl
|
|
|
+ endToEnd = R.id.cl
|
|
|
+ marginStart = DpPxUtil.dip2px(10f)
|
|
|
+ marginEnd = DpPxUtil.dip2px(10f)
|
|
|
+ bottomMargin = DpPxUtil.dip2px(290f) + DpPxUtil.dip2px(55f)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private val keyboardCloseRvLayoutParams by lazy {
|
|
|
+ ConstraintLayout.LayoutParams(0, DpPxUtil.dip2px(170f)).apply {
|
|
|
+ bottomToBottom = R.id.cl
|
|
|
+ startToStart = R.id.cl
|
|
|
+ endToEnd = R.id.cl
|
|
|
+ marginStart = DpPxUtil.dip2px(10f)
|
|
|
+ marginEnd = DpPxUtil.dip2px(10f)
|
|
|
+ bottomMargin = DpPxUtil.dip2px(70f)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private fun setChatRvPop() {
|
|
|
+ if (isPopUp || gameIsOpen) {
|
|
|
binding.rv.layoutParams = keyboardUpRvLayoutParams
|
|
|
} else {
|
|
|
- if (keyboardCloseRvLayoutParams == null) {
|
|
|
- keyboardCloseRvLayoutParams =
|
|
|
- ConstraintLayout.LayoutParams(0, DpPxUtil.dip2px(170f)).apply {
|
|
|
- bottomToBottom = R.id.cl
|
|
|
- startToStart = R.id.cl
|
|
|
- endToEnd = R.id.cl
|
|
|
- marginStart = DpPxUtil.dip2px(10f)
|
|
|
- marginEnd = DpPxUtil.dip2px(10f)
|
|
|
- bottomMargin = DpPxUtil.dip2px(70f)
|
|
|
- }
|
|
|
- }
|
|
|
binding.rv.layoutParams = keyboardCloseRvLayoutParams
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -698,8 +693,10 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
msgListDialog?.show(childFragmentManager, "MessageListDialog")
|
|
|
}
|
|
|
|
|
|
+ private var gameIsOpen = false
|
|
|
fun openGameDialog() {
|
|
|
SwagoRoomManager.iRoomInfo?.let {
|
|
|
+ gameIsOpen = true
|
|
|
val download = checkGameVersion(
|
|
|
it.getGameType().toString(),
|
|
|
it.getGameDownLoadUrl(),
|
|
@@ -711,7 +708,15 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
} else {
|
|
|
gameDialog = GamePlayDialog.newInstance(it.getGameUrl(),it.getIsFullGame())
|
|
|
}
|
|
|
+ gameDialog?.dialogDisFun = {
|
|
|
+ gameIsOpen = false
|
|
|
+ setChatRvPop()
|
|
|
+ }
|
|
|
+ gameDialog?.openMessageFun = {
|
|
|
+ openSendMessageDialog()
|
|
|
+ }
|
|
|
gameDialog?.show(childFragmentManager, "GamePlayDialog")
|
|
|
+ setChatRvPop()
|
|
|
}
|
|
|
}
|
|
|
|