A pop-up control on Android open Danmaku

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.