Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

横向模式下面、沉浸模式,吸附模式无法吸附到上方 #238

Open
devonEdison opened this issue Sep 15, 2023 · 0 comments
Open

Comments

@devonEdison
Copy link

object EasyFloatUtils {

    fun showGamingMenu(activity: Activity) {
        EasyFloat.with(activity)
            .setTag("GamingMenu")
            .setSidePattern(SidePattern.RESULT_SIDE)
            .setImmersionStatusBar(true)
            .setGravity(Gravity.TOP)
            // 传入View,传入布局文件皆可,如:MyCustomView(this)、R.layout.float_custom
            .setLayout(R.layout.float_window_game_coin_exchange) {
                it.findViewById<LinearLayoutCompat>(R.id.root_view).setOnClickListener { root ->
                    root.findViewById<LinearLayoutCompat>(R.id.layout_exchange_menu).apply {
                        visibility = if (visibility == View.GONE) View.VISIBLE else View.GONE
                        EasyFloat.updateFloat("GamingMenu")
                    }
                }
                it.findViewById<AppCompatButton>(R.id.button_exchange_game_coin).setOnClickListener { root ->
                }
                it.findViewById<AppCompatButton>(R.id.button_exchange_lala_bean).setOnClickListener { root ->
                }
                it.findViewById<AppCompatButton>(R.id.button_contact_service).setOnClickListener { root ->
                }
                it.findViewById<AppCompatButton>(R.id.button_close_game_window).setOnClickListener { root ->
                    activity.finish()
                }
            }
            .registerCallback {
                show { }
                hide { }
                dismiss {}
                touchEvent { view, event -> }
                drag { view, motionEvent -> }
                dragEnd {}
            }
            .show()
    }
}
    @Suppress("UNCHECKED_CAST")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(vb.root)

        //是否开启默认状态栏和导航栏
        if (isImmersionBarEnabled()) {
            immersionBar {
                statusBarDarkFont(true)
                if (isFullScreenEnabled()) {
                    //全屏
                } else {
                    statusBarColor(R.color.white)
                    fitsSystemWindows(true)
                }
            }
        }

为何呢?

demo 里面的模式要吸附到上方,也要很靠近上方才行,感觉有bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant