Starting from Android Build.VERSION_CODES#S, for security reasons, touch events that pass through windows containing this flag (ie. ![]() The intention of this flag is to leave the touch to be handled by some window below this window (in Z order). Window flag: this window can never receive touch events. FLAG_ NOT_ TOUCH_ MODAL The problem here is that if the Window type is TYPE_APPLICATION_OVERLAY can take effect on android R, but the gesture can not be transmitted to the floating Window on android S. Click and slide events should pass through the floating Window - z this requirement is very clear, so if you want to gesture through the floating Window, you need to set the flags of the Window to viewparam when setting Params flags = WindowManager. Record a pit: the requirement is to create a floating Window with a translucent picture to cover the whole mobile phone screen. For details, please refer to Official documents Note: the window type cannot be set randomly. Through the above steps, you can create a floating window. Add the previously created View and Params into the Window.View view = om(this).inflate(R.layout.view2, null) Create a View as the layout and UI of the Window.Then you can set the Params of the window, such as viewparams type = WindowManager. ![]() WindowManager.LayoutParams viewParam = new WindowManager.LayoutParams()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |