[feedback]优化弹窗实现细节
This commit is contained in:
@@ -907,60 +907,8 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
|
||||
}
|
||||
|
||||
override fun showFloatWindow(tag: String, floatView: View, attrs: LayoutParams?): () -> Unit {
|
||||
var floatWindow: WarningFloat.Builder?
|
||||
WarningFloat.with(context ?: Utils.getApp())
|
||||
.setTag(tag)
|
||||
.setLayout(floatView)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.START, offsetY = 72)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
floatWindow = null
|
||||
}
|
||||
})
|
||||
.also {
|
||||
floatWindow = it
|
||||
if (((attrs?.softInputMode?: 0) and LayoutParams.SOFT_INPUT_MASK_ADJUST) != 0) {
|
||||
it.softInputMode(attrs!!.softInputMode)
|
||||
}
|
||||
}
|
||||
.show()
|
||||
return {
|
||||
floatWindow?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
floatWindow = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerLogger.d("$M_HMI$TAG", "onDestroy")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user