android弹幕控件,OpenDanmaku android 上一个轻量级的更简单的开源弹幕控件 @codeKK Android开源站...

一个 Android 的弹幕控件.

Open Danmaku is a Android widget which shows danmaku animation(https://github.com/linsea/OpenDanmaku).

5590166a6a3c8677377e206350ff9206.png

Usage

For a working implementation of this project see the sample app.

add library dependency to your build.gradle file.dependencies {

compile 'com.linsea:opendanmaku:1.0.0@aar'

}

Include the DanmakuView in your layout.

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="1000"

app:show_debug="false" />

In your Activity:

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();

Customization

start_Y_offset first channel offset to the view top edge.

end_Y_offset last channel offset to the view top edge.

max_row max running channels on Y axis.

max_running_per_row max concurrent running items in one channel.

pick_interval interval millisecond picking up an item in the backing queue to play.

show_debug show debug info like FPS and lines between channels.

You might also like

UniversalVideoView VideoView like Widget with more features.

License

Copyright 2015 the OpenDanmaku Author

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值