BubbleBarrage(仿QQ冒泡弹幕实现)
2019-04-02 本文已影响0人
Single0709
github:BubbleBarrage
使用方式:
bubbleBarrage = new BubbleBarrage()
.init(this, bubbleBarrageContainer, R.layout.layout_bubble_barrage_item)
.setIntervalTime(1000)
.setVisibleCount(3)
.setItemMargin(20)
.setOnBarrageLoadListener(new BubbleBarrage.OnBarrageLoadListener() {
@Override
public void loadBarrage(View view, List<String> data, int index) {
view.findViewById(R.id.iv_head).setBackground(ContextCompat.getDrawable(MainActivity.this, R.drawable.test_header));
((TextView) view.findViewById(R.id.tv_content)).setText(data.get(index));
}
}).start(bubbles, 1000);