Is there any way to show progressbar from my App above YouTube when user taps my App button inside Share option

走远了吗. 提交于 2021-02-19 08:17:07

问题


I need to show a progress bar above youTube app when user taps on my app icon inside share option. Suppose my intention is to download the video while showing the progressbar. But the button should not take the user completely to my App.

The current youTube page should become a bit darker (inactive) and above that my progress bar should appear.

I have attached images so that you can understand what am i upto. Thank you.


回答1:


You can achieve this by Creating a System Overlay but be careful that this is (Always on Top over all Apps in Android) you can follow this gist to implement it and in your service onCreate inflate your custom layout

  //kotlin
  val inflater = getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
  val myView = inflater!!.inflate(R.layout.my_layout, null)


来源:https://stackoverflow.com/questions/58163135/is-there-any-way-to-show-progressbar-from-my-app-above-youtube-when-user-taps-my

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