Pop screen is now very popular, especially in the video playback, there is no easy to use Android on the screen control, so he wrote a.
Project Address: Https://github.com/linsea/OpenDanmaku
or domestic open source China on the image: Http://git.oschina.net/dictfb/OpenDanmaku
How to use
Please check the demo of the project for the complete use method.
1. Add dependencies to the Build.gradle file.
dependencies { compile ' com.linsea:opendanmaku:[email protected] '}
2. Add a custom pop-up view to the layout file.
<com.opendanmaku.danmakuview android:id= "@+id/danmakuview" android:layout_width= "Fill_parent " android:layout_height= "Fill_parent" app:start_y_offset= "0.2" app:end_y_offset= "0.8" app:max_row= "4 " app:max_running_per_row=" 2 " app:pick_interval=" " app:show_debug=" false "/>
3. Create a projectile object in activity and add it to the playlist.
Mdanmakuview = (Danmakuview) Findviewbyid (R.id.danmakuview);//Add Danmaku Items:mDanmakuView.addItem (list, true); Mdanmakuview.additem (New Danmakuitem (This, "Hello World", Mdanmakuview.getwidth ());//show Danmaku and play Animation: Mdanmakuview.show ();//hide and Pause playing:mDanmakuView.hide ();//release all playing and waiting items: Mdanmakuview.clear ();
Custom properties for Danmakuview
* Start_y_offset
The first channel is offset from the top edge of the barrage view, and the value is the percentage amount, which is based on the height of the barrage view, in short, the percentage of the top edge of the pop-up view.
* End_y_offset
Similar to the previous property, the last channel is the offset from the top edge of the barrage view, the note value is the percentage amount, with the height of the barrage view as the benchmark, the main role is to make it easy to leave a certain blank at the bottom of the barrage view.
* Max_row
Set the maximum number of channels to play.
* Max_running_per_row
The maximum number of barrage runs at the same time on each channel.
* Pick_interval
Take out a barrage every few milliseconds to play.
* Show_debug
Whether to display fairway line and playback frame rate, debugging is very useful, mainly for debugging.
A pop-up control on Android open Danmaku