/WeLiveBarrage

You can call it DANMAKU!!!

Primary LanguageJavaMIT LicenseMIT

WeLiveBarrage

You can call it DANMAKU!!!

Installation

Step 1. Add the JitPack repository to your build file

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.splm:WeLiveBarrage:1.0.2'
}

Usage

0.Introduction

<attr name="max_row" format="integer" /> <!-- Max row -->
<attr name="text_size" format="integer" /><!-- size of this barrage  -->
<attr name="max_per_row" format="integer" /><!-- display the max count per row -->
<attr name="color_random" format="boolean" /> <!-- use tangram color -->
<attr name="internal_time" format="integer" /> <!-- interval time -->

1.Insert to XML

<me.splm.app.welivebarrage.WeLiveBarrageView
        android:id="@+id/barrage"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp"
        app:color_random="true"
        app:internal_time="1000"
        app:layout_constraintBottom_toTopOf="@+id/hide_btn"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:max_per_row="2"
        app:max_row="4"
        app:text_size="20" />

2.Use in Java file

WeLiveBarrageView mBarrageView = findViewById(R.id.barrage);
List<SimpleDanmakuItem> list=new ArrayList<>();
for(int i =0;i<2;i++){
    list.add(new SimpleDanmakuItem("测试弹幕 " + i, android.R.color.holo_orange_dark));
}
mBarrageView.addItems(list);
mBarrageView.display();

END

License

Copyright (c) 2019 splm

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.