Skip to content

Commit 5ba3579

Browse files
committed
refactor:更新浮窗展示逻辑
1 parent f65aca9 commit 5ba3579

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

floatingx/src/main/java/com/petterp/floatingx/view/FxBasicContainerView.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ abstract class FxBasicContainerView @JvmOverloads constructor(
4848

4949
open fun initView() {
5050
helpers.forEach { it.initConfig(this) }
51+
// 先隐藏view,等待初始化完成后再显示,避免位置的影响
52+
visibility = View.INVISIBLE
5153
}
5254

5355
override fun moveToEdge() {
@@ -92,6 +94,7 @@ abstract class FxBasicContainerView @JvmOverloads constructor(
9294
if (!isInitLayout) return
9395
isInitLayout = false
9496
helpers.forEach { it.onInit() }
97+
visibility = View.VISIBLE
9598
}
9699

97100
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {

0 commit comments

Comments
 (0)