本文整理汇总了Java中com.justwayward.reader.bean.support.DownloadMessage类的典型用法代码示例。如果您正苦于以下问题:Java DownloadMessage类的具体用法?Java DownloadMessage怎么用?Java DownloadMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DownloadMessage类属于com.justwayward.reader.bean.support包,在下文中一共展示了DownloadMessage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: downloadMessage
import com.justwayward.reader.bean.support.DownloadMessage; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MAIN)
public void downloadMessage(final DownloadMessage msg) {
if (isVisible(mLlBookReadBottom)) { // 如果工具栏显示,则进度条也显示
if (bookId.equals(msg.bookId)) {
visible(mTvDownloadProgress);
mTvDownloadProgress.setText(msg.message);
if (msg.isComplete) {
mTvDownloadProgress.postDelayed(new Runnable() {
@Override
public void run() {
gone(mTvDownloadProgress);
}
}, 2500);
}
}
}
}
示例2: addToDownloadQueue
import com.justwayward.reader.bean.support.DownloadMessage; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MAIN)
public synchronized void addToDownloadQueue(DownloadQueue queue) {
if (!TextUtils.isEmpty(queue.bookId)) {
boolean exists = false;
// 判断当前书籍缓存任务是否存在
for (int i = 0; i < downloadQueues.size(); i++) {
if (downloadQueues.get(i).bookId.equals(queue.bookId)) {
LogUtils.e("addToDownloadQueue:exists");
exists = true;
break;
}
}
if (exists) {
post(new DownloadMessage(queue.bookId, "当前缓存任务已存在", false));
return;
}
// 添加到下载队列
downloadQueues.add(queue);
LogUtils.e("addToDownloadQueue:" + queue.bookId);
post(new DownloadMessage(queue.bookId, "成功加入缓存队列", false));
}
// 从队列顺序取出第一条下载
if (downloadQueues.size() > 0 && !isBusy) {
isBusy = true;
downloadBook(downloadQueues.get(0));
}
}
示例3: downloadMessage
import com.justwayward.reader.bean.support.DownloadMessage; //导入依赖的package包/类
@Subscribe(threadMode = ThreadMode.MAIN)
public void downloadMessage(final DownloadMessage msg) {
mRecyclerView.setTipViewText(msg.message);
if (msg.isComplete) {
mRecyclerView.hideTipView(2200);
}
}
示例4: post
import com.justwayward.reader.bean.support.DownloadMessage; //导入依赖的package包/类
private void post(DownloadMessage message) {
EventBus.getDefault().post(message);
}