Adding focusable view to window manager without losing responsiveness on background

亡梦爱人 提交于 2020-01-24 04:34:37

问题


I have following problem:

I want to create a toolbar, with general setting for device (TV) by adding view to window manager. My toolbar is visible in the bottom of screen and it is an overlay on currently selected application. It has following parameters/flags:

  • WindowManager.LayoutParams.TYPE_SYSTEM_ALERT -WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH -WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE -WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL -PixelFormat.TRANSLUCENT

When I click on the toolbar it is working fine. When I click on the background, toolbar is still at foreground, and background application is working fine.

The problem starts, when I am populating ListView from my toolbar. With those parameters, onClick and onSelectItem listeners are not working on that ListView. When I remove FLAG_NOT_FOCUSABLE, listeners start to work, but I cannot use background application any more. I have to close my toolbar in order to get focus on the background.

Do you have any idea, how to make both ListView and background application responsiveness?

Thanks in advance, for every answer/


回答1:


This is known issue with PixelFormat.TRANSLUCENT, try PixelFormat.TRANSPARENT



来源:https://stackoverflow.com/questions/12859379/adding-focusable-view-to-window-manager-without-losing-responsiveness-on-backgro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!