当前位置: 首页>>代码示例>>Java>>正文


Java DrawHandler类代码示例

本文整理汇总了Java中master.flame.danmaku.controller.DrawHandler的典型用法代码示例。如果您正苦于以下问题:Java DrawHandler类的具体用法?Java DrawHandler怎么用?Java DrawHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DrawHandler类属于master.flame.danmaku.controller包,在下文中一共展示了DrawHandler类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setCallback

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
public void setCallback(DrawHandler.Callback callback) {
    this.mCallback = callback;
    if (this.handler != null) {
        this.handler.setCallback(callback);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:7,代码来源:DanmakuSurfaceView.java

示例2: stopDraw

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void stopDraw() {
    DrawHandler handler = this.handler;
    this.handler = null;
    unlockCanvasAndPost();
    if (handler != null) {
        handler.quit();
    }
    if (this.mHandlerThread != null) {
        HandlerThread handlerThread = this.mHandlerThread;
        this.mHandlerThread = null;
        try {
            handlerThread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        handlerThread.quit();
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:DanmakuView.java

示例3: stopDraw

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void stopDraw() {
    DrawHandler handler = this.handler;
    this.handler = null;
    unlockCanvasAndPost();
    if (handler != null) {
        handler.quit();
    }
    if (mHandlerThread != null) {
        HandlerThread handlerThread = this.mHandlerThread;
        mHandlerThread = null;
        try {
            handlerThread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        handlerThread.quit();
    }
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:19,代码来源:DanmakuView.java

示例4: initDanmaku

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
protected void initDanmaku(DanmakuSurfaceView danmakuSurfaceView, BaseDanmakuParser parser) {
  if (danmakuSurfaceView != null) {
    //parser = createParser(null);
    danmakuSurfaceView.setCallback(new DrawHandler.Callback() {
          @Override public void updateTimer(DanmakuTimer timer) {
          }

          @Override public void prepared() {
            danmakuSurfaceView.start();
          }
        });
    danmakuSurfaceView.prepare(parser);
    //danmakuSurfaceView.showFPS(true);
    danmakuSurfaceView.enableDanmakuDrawingCache(true);
    danmakuSurfaceView.setZOrderOnTop(true);
    danmakuSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
  }
}
 
开发者ID:pkliang,项目名称:gankmaku,代码行数:19,代码来源:BaseDanmakuFragment.java

示例5: initListener

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
@Override
protected void initListener() {
    mDanmakuView.setCallback(new DrawHandler.Callback() {
        @Override
        public void prepared() {
            mDanmakuView.start();
        }

        @Override
        public void updateTimer(DanmakuTimer timer) {

        }

        @Override
        public void danmakuShown(BaseDanmaku danmaku) {

        }

        @Override
        public void drawingFinished() {

        }
    });

    mRetryGetDanmuBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mRoomPresenter.getChatListInfo(roomId);
        }
    });
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:32,代码来源:LiveRoomActivity.java

示例6: start

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
@Override
public void start(long postion) {
    if (handler == null) {
        prepare();
    }else{
        handler.removeCallbacksAndMessages(null);
    }
    handler.obtainMessage(DrawHandler.START, postion).sendToTarget();
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:10,代码来源:DanmakuSurfaceView.java

示例7: start

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
@Override
public void start(long postion) {
    if (handler == null) {
        prepare();
    } else {
        handler.removeCallbacksAndMessages(null);
    }
    handler.obtainMessage(DrawHandler.START, postion).sendToTarget();
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:10,代码来源:DanmakuTextureView.java

示例8: initDanmuView

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void initDanmuView() {
    if (mDanmakuView != null) {
        mDanmakuView.setCallback(new DrawHandler.Callback() {
            @Override
            public void prepared() {
                mDanmakuView.start();
            }

            @Override
            public void updateTimer(DanmakuTimer timer) {

            }

            @Override
            public void danmakuShown(BaseDanmaku danmaku) {

            }

            @Override
            public void drawingFinished() {

            }
        });
    }

    mDanmakuView.prepare(new BaseDanmakuParser() {

        @Override
        protected Danmakus parse() {
            return new Danmakus();
        }
    }, mDanmakuContext);
    mDanmakuView.enableDanmakuDrawingCache(true);
}
 
开发者ID:mygu,项目名称:react-native-danmaku,代码行数:35,代码来源:DanmakuController.java

示例9: danmuku

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void danmuku(InputStream inputStream) {
        if (mDanmakuView != null) {
            mParser = DanmakuHelper.createParser(inputStream);
            mDanmakuView.setCallback(new DrawHandler.Callback() {
                @Override
                public void updateTimer(DanmakuTimer timer) {
                }

                @Override
                public void danmakuShown(BaseDanmaku danmaku) {

                }

                @Override
                public void drawingFinished() {

                }

                @Override
                public void prepared() {
                    mIsDanmakuReday = true;
                }
            });
            mDanmakuView.setOnDanmakuClickListener(new IDanmakuView.OnDanmakuClickListener() {
                @Override
                public void onDanmakuClick(BaseDanmaku latest) {
//                    Log.d("DFM", "onDanmakuClick text:" + latest.text);
                }

                @Override
                public void onDanmakuClick(IDanmakus danmakus) {
//                    Log.d("DFM", "onDanmakuClick danmakus size:" + danmakus.size());
                }
            });
            mDanmakuView.prepare(mParser, mDanmakuContext);
            mDanmakuView.enableDanmakuDrawingCache(true);
//            mDanmakuView.showFPS(true);
        }
    }
 
开发者ID:succlz123,项目名称:BlueBoard,代码行数:40,代码来源:VideoPlayActivity.java

示例10: loadData

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
/**
 * 获取视频数据以及解析弹幕
 */
@Override
public void loadData() {

  RetrofitHelper.getBiliGoAPI()
      .getHDVideoUrl(cid, 4, ConstantUtil.VIDEO_TYPE_MP4)
      .compose(bindToLifecycle())
      .map(videoInfo -> Uri.parse(videoInfo.getDurl().get(0).getUrl()))
      .observeOn(AndroidSchedulers.mainThread())
      .flatMap(new Func1<Uri, Observable<BaseDanmakuParser>>() {

        @Override
        public Observable<BaseDanmakuParser> call(Uri uri) {

          mPlayerView.setVideoURI(uri);
          mPlayerView.setOnPreparedListener(mp -> {

            mLoadingAnim.stop();
            startText = startText + "【完成】\n视频缓冲中...";
            mPrepareText.setText(startText);
            mVideoPrepareLayout.setVisibility(View.GONE);
          });

          String url = "http://comment.bilibili.com/" + cid + ".xml";
          return BiliDanmukuDownloadUtil.downloadXML(url);
        }
      })
      .subscribeOn(Schedulers.io())
      .observeOn(AndroidSchedulers.mainThread())
      .subscribe(baseDanmakuParser -> {

        mDanmakuView.prepare(baseDanmakuParser, danmakuContext);
        mDanmakuView.showFPS(false);
        mDanmakuView.enableDanmakuDrawingCache(false);
        mDanmakuView.setCallback(new DrawHandler.Callback() {

          @Override
          public void prepared() {

            mDanmakuView.start();
          }


          @Override
          public void updateTimer(DanmakuTimer danmakuTimer) {

          }


          @Override
          public void danmakuShown(BaseDanmaku danmaku) {

          }


          @Override
          public void drawingFinished() {

          }
        });

        mPlayerView.start();
      }, throwable -> {

        startText = startText + "【失败】\n视频缓冲中...";
        mPrepareText.setText(startText);
        startText = startText + "【失败】\n" + throwable.getMessage();
        mPrepareText.setText(startText);
      });
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:73,代码来源:VideoPlayerActivity.java

示例11: loadData

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
@Override
public void loadData() {
    RetrofitHelper.getBiliGoAPI()
            .getHDVideoUrl(mCid, 4, ConstantUtil.VIDEO_TYPE_MP4)
            .compose(bindToLifecycle())
            .map(videoInfo -> Uri.parse(videoInfo.getDurl().get(0).getUrl()))
            .observeOn(AndroidSchedulers.mainThread())
            .flatMap(new Func1<Uri, Observable<BaseDanmakuParser>>() {
                @Override
                public Observable<BaseDanmakuParser> call(Uri uri) {
                    mPlayerView.setVideoURI(uri);
                    mPlayerView.setOnClickListener(v -> {
                        mLoadingAnim.stop();
                        mStartText += "【完成】\n视频缓冲中...";
                        mPrepareText.setText(mStartText);
                        mVideoPrepareLayout.setVisibility(View.GONE);
                    });
                    String url = "http://comment.bilibili.com/" + mCid + ".xml";
                    return BiliDanmukuDownloadUtil.downloadXML(url);
                }
            })
            .subscribeOn(Schedulers.io())
            .subscribe(baseDanmakuParser -> {
                mDanmakuView.prepare(baseDanmakuParser, mDanmakuContext);
                mDanmakuView.showFPS(false);
                mDanmakuView.enableDanmakuDrawingCache(false);
                mDanmakuView.setCallback(new DrawHandler.Callback() {
                    @Override
                    public void prepared() {
                        mDanmakuView.start();
                    }

                    @Override
                    public void updateTimer(DanmakuTimer timer) {

                    }

                    @Override
                    public void danmakuShown(BaseDanmaku danmaku) {

                    }

                    @Override
                    public void drawingFinished() {

                    }
                });
                mPlayerView.start();
            }, throwable -> {
                mStartText += "【失败】\n视频缓冲中...";
                mPrepareText.setText(mStartText);
                mStartText += "【失败】\n" + throwable.getMessage();
                mPrepareText.setText(mStartText);
            });
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:56,代码来源:VideoPlayerActivity.java

示例12: prepare

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void prepare() {
    if (this.handler == null) {
        this.handler = new DrawHandler(getLooper(this.mDrawingThreadType), this, this.mDanmakuVisible);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:DanmakuSurfaceView.java

示例13: DanmakuManager

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
public DanmakuManager(IDanmakuView iDanmakuView) {
    mIDanmakuView = iDanmakuView;
    mActivity = (Activity) mIDanmakuView.getView().getContext();
    mActivity.getApplication().registerComponentCallbacks(this);
    mActivity.getApplication().registerActivityLifecycleCallbacks(this);
    mDanmakuTextSize = mActivity.getResources().getDimensionPixelSize(R.dimen.danmaku_text_size);
    float shadowRadius = mActivity.getResources().getDimensionPixelSize(R.dimen.danmaku_shadow_radius);
    mIDanmakuView.setCallback(new DrawHandler.Callback() {
        @Override
        public void prepared() {
            mIDanmakuView.start();
            handleConfiguration(mActivity.getResources().getConfiguration());
        }

        @Override
        public void updateTimer(DanmakuTimer timer) {

        }

        @Override
        public void danmakuShown(BaseDanmaku danmaku) {

        }

        @Override
        public void drawingFinished() {

        }
    });

    ArrayMap<Integer, Integer> maxLinesPair = new ArrayMap<>();
    maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 4);

    ArrayMap<Integer, Boolean> overlappingEnablePair = new ArrayMap<>();
    overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
    overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);
    mIDanmakuView.prepare(new BaseDanmakuParser() {
                              @Override
                              protected IDanmakus parse() {
                                  return new Danmakus();
                              }
                          },
            DanmakuContext.create()
                    .setDanmakuStyle(IDisplayer.DANMAKU_STYLE_SHADOW, shadowRadius)
                    .setScrollSpeedFactor(1.5f)
                    .setDuplicateMergingEnabled(false)
                    .setMaximumVisibleSizeInScreen(-1)
                    .setCacheStuffer(new BackgroundCacheStuffer(), null)
                    .setMaximumLines(maxLinesPair)
                    .preventOverlapping(overlappingEnablePair));
}
 
开发者ID:StraaS,项目名称:StraaS-android-sdk-sample,代码行数:52,代码来源:DanmakuManager.java

示例14: initDanmuConfig

import master.flame.danmaku.controller.DrawHandler; //导入依赖的package包/类
private void initDanmuConfig() {
    // 设置最大显示行数
    HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
    maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 4); // 滚动弹幕最大显示4行
    // 设置是否禁止重叠
    HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<>();
    overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
    overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);

    mDanmakuContext = DanmakuContext.create();
    mDanmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_NONE)
            .setDuplicateMergingEnabled(false)
            .setScrollSpeedFactor(1.2f)//越大速度越慢
            .setScaleTextSize(1.2f)
            .setMaximumLines(maxLinesPair)
            .preventOverlapping(overlappingEnablePair);

    setCallback(new DrawHandler.Callback() {
        @Override
        public void prepared() {
            start();
        }

        @Override
        public void updateTimer(DanmakuTimer timer) {

        }

        @Override
        public void danmakuShown(BaseDanmaku danmaku) {

        }

        @Override
        public void drawingFinished() {

        }
    });

    prepare(new BaseDanmakuParser() {
        @Override
        protected IDanmakus parse() {
            return new Danmakus();
        }
    }, mDanmakuContext);

    enableDanmakuDrawingCache(true);
}
 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:49,代码来源:DanmakuView.java


注:本文中的master.flame.danmaku.controller.DrawHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。