本文整理汇总了Java中master.flame.danmaku.danmaku.model.IDanmakus类的典型用法代码示例。如果您正苦于以下问题:Java IDanmakus类的具体用法?Java IDanmakus怎么用?Java IDanmakus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDanmakus类属于master.flame.danmaku.danmaku.model包,在下文中一共展示了IDanmakus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeTimeoutDanmakus
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
private final void removeTimeoutDanmakus(IDanmakus danmakus, long limitTime) {
IDanmakuIterator it = danmakus.iterator();
long startTime = SystemClock.uptimeMillis();
while (it.hasNext()) {
try {
if (it.next().isTimeOut()) {
it.remove();
if (SystemClock.uptimeMillis() - startTime > limitTime) {
return;
}
}
return;
} catch (Exception e) {
return;
}
}
}
示例2: onTouchEvent
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case 1:
IDanmakus clickDanmakus = touchHitDanmaku(event.getX(), event.getY());
BaseDanmaku newestDanmaku = null;
if (!(clickDanmakus == null || clickDanmakus.isEmpty())) {
performClick(clickDanmakus);
newestDanmaku = fetchLatestOne(clickDanmakus);
}
if (newestDanmaku != null) {
performClickWithlatest(newestDanmaku);
break;
}
break;
}
return false;
}
示例3: touchHitDanmaku
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus touchHitDanmaku(float x, float y) {
IDanmakus hitDanmakus = new Danmakus();
this.mDanmakuBounds.setEmpty();
IDanmakus danmakus = this.danmakuView.getCurrentVisibleDanmakus();
if (danmakus != null && !danmakus.isEmpty()) {
IDanmakuIterator iterator = danmakus.iterator();
while (iterator.hasNext()) {
BaseDanmaku danmaku = iterator.next();
if (danmaku != null) {
this.mDanmakuBounds.set(danmaku.getLeft(), danmaku.getTop() - 30.0f, danmaku.getRight(), danmaku.getBottom() + 30.0f);
if (this.mDanmakuBounds.contains(x, y)) {
danmaku.clickX = x;
danmaku.clickY = y;
danmaku.setRectF(this.mDanmakuBounds);
hitDanmakus.addItem(danmaku);
break;
}
}
}
}
return hitDanmakus;
}
示例4: getVisibleDanmakusOnTime
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
@Override
public IDanmakus getVisibleDanmakusOnTime(long time) {
long beginMills = time - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = time + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus subDanmakus = danmakuList.subnew(beginMills, endMills);
IDanmakus visibleDanmakus = new Danmakus();
if (null != subDanmakus && !subDanmakus.isEmpty()) {
IDanmakuIterator iterator = subDanmakus.iterator();
while (iterator.hasNext()) {
BaseDanmaku danmaku = iterator.next();
if (danmaku.isShown() && !danmaku.isOutside()) {
visibleDanmakus.addItem(danmaku);
}
}
}
return visibleDanmakus;
}
示例5: removeTimeoutDanmakus
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
private final void removeTimeoutDanmakus(final IDanmakus danmakus, long limitTime) {
IDanmakuIterator it = danmakus.iterator();
long startTime = SystemClock.uptimeMillis();
while (it.hasNext()) {
try {
BaseDanmaku item = it.next();
if (item.isTimeOut()) {
it.remove();
} else {
break;
}
} catch (Exception e) {
break;
}
if (SystemClock.uptimeMillis() - startTime > limitTime) {
break;
}
}
}
示例6: touchHitDanmaku
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
private IDanmakus touchHitDanmaku(float x, float y) {
IDanmakus hitDanmakus = new Danmakus();
mDanmakuBounds.setEmpty();
IDanmakus danmakus = danmakuView.getCurrentVisibleDanmakus();
if (null != danmakus && !danmakus.isEmpty()) {
IDanmakuIterator iterator = danmakus.iterator();
while (iterator.hasNext()) {
BaseDanmaku danmaku = iterator.next();
if (null != danmaku) {
mDanmakuBounds.set(danmaku.getLeft(), danmaku.getTop(), danmaku.getRight(), danmaku.getBottom());
if (mDanmakuBounds.contains(x, y)) {
hitDanmakus.addItem(danmaku);
}
}
}
}
return hitDanmakus;
}
示例7: onTouchEvent
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
IDanmakus clickDanmakus = touchHitDanmaku(event.getX(), event.getY());
BaseDanmaku newestDanmaku = null;
if (null != clickDanmakus && !clickDanmakus.isEmpty()) {
performClick(clickDanmakus);
newestDanmaku = fetchLatestOne(clickDanmakus);
}
if (null != newestDanmaku) {
performClickWithlatest(newestDanmaku);
}
break;
default:
break;
}
return false;
}
示例8: getVisibleDanmakusOnTime
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
@Override
public IDanmakus getVisibleDanmakusOnTime(long time) {
long beginMills = time - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = time + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus subDanmakus = danmakuList.sub(beginMills, endMills);
IDanmakus visibleDanmakus = new Danmakus();
if (null != subDanmakus && !subDanmakus.isEmpty()) {
IDanmakuIterator iterator = subDanmakus.iterator();
while (iterator.hasNext()) {
BaseDanmaku danmaku = iterator.next();
if (danmaku.isShown() && !danmaku.isOutside()) {
visibleDanmakus.addItem(danmaku);
}
}
}
return visibleDanmakus;
}
示例9: removeTimeoutDanmakus
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
private final void removeTimeoutDanmakus(final IDanmakus danmakus, long limitTime) {
IDanmakuIterator it = danmakus.iterator();
long startTime = System.currentTimeMillis();
while (it.hasNext()) {
try {
BaseDanmaku item = it.next();
if (item.isTimeOut()) {
it.remove();
} else {
break;
}
} catch (Exception e) {
break;
}
if (System.currentTimeMillis() - startTime > limitTime) {
break;
}
}
}
示例10: parse
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
@Override
protected IDanmakus parse() {
if (mDataSource != null && mDataSource instanceof JsonStrSource) {
JsonStrSource jsonSource = (JsonStrSource) mDataSource;
return _doParse(jsonSource.data());
}
return new Danmakus();
}
示例11: getVisibleDanmakusOnTime
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus getVisibleDanmakusOnTime(long time) {
IDanmakus subDanmakus = this.danmakuList.subnew((time - this.mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) - 100, time + this.mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
IDanmakus visibleDanmakus = new Danmakus();
if (!(subDanmakus == null || subDanmakus.isEmpty())) {
IDanmakuIterator iterator = subDanmakus.iterator();
while (iterator.hasNext()) {
BaseDanmaku danmaku = iterator.next();
if (danmaku.isShown() && !danmaku.isOutside()) {
visibleDanmakus.addItem(danmaku);
}
}
}
return visibleDanmakus;
}
示例12: getDanmakus
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus getDanmakus() {
if (this.mDanmakus != null) {
return this.mDanmakus;
}
this.mContext.mDanmakuFactory.resetDurationsData();
this.mDanmakus = parse();
releaseDataSource();
this.mContext.mDanmakuFactory.updateMaxDanmakuDuration();
return this.mDanmakus;
}
示例13: subnew
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus subnew(long startTime, long endTime) {
Collection<BaseDanmaku> subset = subset(startTime, endTime);
if (subset == null || subset.isEmpty()) {
return null;
}
return new Danmakus(new ArrayList(subset));
}
示例14: sub
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus sub(long startTime, long endTime) {
if (this.items == null || this.items.size() == 0) {
return null;
}
if (this.subItems == null) {
if (this.mSortType == 4) {
this.subItems = new Danmakus(4);
this.subItems.setItems(this.items);
} else {
this.subItems = new Danmakus(this.mDuplicateMergingEnabled);
}
}
if (this.mSortType == 4) {
return this.subItems;
}
if (this.startItem == null) {
this.startItem = createItem(JarConstant.PLUGIN_WINDOW_PLAYER_STATIC_METHOD_NAME_START);
}
if (this.endItem == null) {
this.endItem = createItem("end");
}
if (this.subItems != null && startTime - this.startItem.time >= 0 && endTime <= this.endItem.time) {
return this.subItems;
}
this.startItem.time = startTime;
this.endItem.time = endTime;
this.subItems.setItems(((SortedSet) this.items).subSet(this.startItem, this.endItem));
return this.subItems;
}
示例15: getCurrentVisibleDanmakus
import master.flame.danmaku.danmaku.model.IDanmakus; //导入依赖的package包/类
public IDanmakus getCurrentVisibleDanmakus() {
if (drawTask != null) {
return drawTask.getVisibleDanmakusOnTime(getCurrentTime());
}
return null;
}