本文整理匯總了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);
}