问题
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