How do I implement a slide-out drawer on the Android's call screen?

被刻印的时光 ゝ 提交于 2019-12-04 14:00:04

问题


The Android app Thrutu puts a drawer on top of the in call screen which has several functions and only takes up a fraction of the screen. The call control buttons below still are fully functional. Even a transparent activity would not allow this behaviour. Any idea on how to implement this?


回答1:


The trick to making the underlying buttons work is to implement the UI using a Service rather than an Activity, make the Window you add (using WindowManager.addView) one of the higher-priority types (e.g. TYPE_PHONE), then use FLAG_NOT_TOUCH_MODAL.

I think you need android.permission.SYSTEM_ALERT_WINDOW.

Take a look at How to display a fullscreen TYPE_SYSTEM_ALERT window? and in particular Creating a system overlay where the home buttons still work?



来源:https://stackoverflow.com/questions/7265282/how-do-i-implement-a-slide-out-drawer-on-the-androids-call-screen

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