How to create a floating touchable activity that still allows to touch native controls outside of its borders?

后端 未结 2 715
生来不讨喜
生来不讨喜 2020-12-30 14:32

What I am trying to achieve is best explained by the scheme I made with mspaint:

I have tried to set FLAG_NOT_TOUCH_MODAL which by the descript

2条回答
  •  情深已故
    2020-12-30 15:07

    You can use activity with special theme in your AndroidManifest file:

    
    

    And also don't forget to set mach_parent attribute in Activity like:

    override fun onStart() {
            super.onStart()
            window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
        }
    

提交回复
热议问题