diff --git a/app/src/main/java/com/gh/gamecenter/servers/gametest2/GameServerTestV2Fragment.kt b/app/src/main/java/com/gh/gamecenter/servers/gametest2/GameServerTestV2Fragment.kt index e3ae1519b7..086dab593a 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/gametest2/GameServerTestV2Fragment.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/gametest2/GameServerTestV2Fragment.kt @@ -36,7 +36,6 @@ class GameServerTestV2Fragment : LazyFragment() { private var mPageLocation: PageLocation? = null private var mTempBigImageMode = true private var mIsSettingAnimating = false - private var mDismissSettingCallback: (() -> Unit)? = null override fun getRealLayoutId(): Int = R.layout.fragment_game_server_test_v2 @@ -69,11 +68,10 @@ class GameServerTestV2Fragment : LazyFragment() { changeFragment() if (SPUtils.getBoolean(Constants.SP_SHOW_GAME_SERVER_TEST_V2_SETTING_GUIDE, true)) { - mDismissSettingCallback = { - showGuidePopupWindow() - } mBaseHandler.post { - showSettingView() + showSettingView { + showGuidePopupWindow() + } } SPUtils.setBoolean(Constants.SP_SHOW_GAME_SERVER_TEST_V2_SETTING_GUIDE, false) } @@ -138,7 +136,7 @@ class GameServerTestV2Fragment : LazyFragment() { } @SuppressLint("ClickableViewAccessibility") - private fun showSettingView() { + private fun showSettingView(onShowAction: (() -> Unit)? = null) { if (mIsSettingAnimating) return mBinding?.dismissView?.visibility = View.VISIBLE @@ -260,6 +258,8 @@ class GameServerTestV2Fragment : LazyFragment() { mIsSettingAnimating = false mBinding?.filterBackground?.visibility = View.GONE mBinding?.filterContainer?.setBackgroundColor(R.color.ui_surface.toColor(requireContext())) + + onShowAction?.invoke() } }.start() } @@ -287,8 +287,6 @@ class GameServerTestV2Fragment : LazyFragment() { mBinding?.dismissView?.visibility = View.GONE mBinding?.filterBackground?.visibility = View.VISIBLE mBinding?.filterContainer?.setBackgroundColor(R.color.ui_background.toColor(requireContext())) - mDismissSettingCallback?.invoke() - mDismissSettingCallback = null mBinding?.settingContainer?.removeAllViews() mSettingBinding = null }