Skip to content

Commit

Permalink
DanmakuGlobalConfig: rename setOverlapping to preventOverlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiao committed Sep 11, 2015
1 parent f675c1f commit 5429291
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,14 +570,19 @@ public DanmakuGlobalConfig setMaximumLines(Map<Integer, Integer> pairs) {
return this;
}

@Deprecated
public DanmakuGlobalConfig setOverlapping(Map<Integer, Boolean> pairs) {
return preventOverlapping(pairs);
}

/**
* 设置弹幕是否重叠
* @param pairs map<K,V> 设置null恢复默认设置,默认为重叠
* 设置防弹幕重叠
* @param pairs map<K,V> 设置null恢复默认设置,默认为允许重叠
* K = (BaseDanmaku.TYPE_SCROLL_RL|BaseDanmaku.TYPE_SCROLL_LR|BaseDanmaku.TYPE_FIX_TOP|BaseDanmaku.TYPE_FIX_BOTTOM)
* V = true|false 是否重叠
* @return
*/
public DanmakuGlobalConfig setOverlapping(Map<Integer, Boolean> pairs) {
public DanmakuGlobalConfig preventOverlapping(Map<Integer, Boolean> pairs) {
if (pairs == null) {
DanmakuFilters.getDefault()
.unregisterFilter(DanmakuFilters.TAG_OVERLAPPING_FILTER, false);
Expand Down
2 changes: 1 addition & 1 deletion Sample/src/main/java/com/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void findViews() {
DanmakuGlobalConfig.DEFAULT.setDanmakuStyle(DanmakuGlobalConfig.DANMAKU_STYLE_STROKEN, 3).setDuplicateMergingEnabled(false).setMaximumVisibleSizeInScreen(0)
.setCacheStuffer(new BackgroundCacheStuffer())
.setMaximumLines(maxLinesPair)
.setOverlapping(overlappingEnablePair);
.preventOverlapping(overlappingEnablePair);
if (mDanmakuView != null) {
mParser = createParser(this.getResources().openRawResource(R.raw.comments));
mDanmakuView.setCallback(new Callback() {
Expand Down

0 comments on commit 5429291

Please sign in to comment.