|
|
@ -538,14 +538,11 @@ public class BookcasePresenter implements BasePresenter { |
|
|
|
(dialogInterface, i) -> { |
|
|
|
(dialogInterface, i) -> { |
|
|
|
dialogInterface.dismiss(); |
|
|
|
dialogInterface.dismiss(); |
|
|
|
if (UserService.isLogin()) { |
|
|
|
if (UserService.isLogin()) { |
|
|
|
new Thread(new Runnable() { |
|
|
|
new Thread(() -> { |
|
|
|
@Override |
|
|
|
if (mBackupAndRestore.backup("localBackup") & UserService.webBackup()) { |
|
|
|
public void run() { |
|
|
|
DialogCreator.createTipDialog(mMainActivity, "备份(本地和网络)成功,本地备份文件路径:" + APPCONST.BACKUP_FILE_DIR); |
|
|
|
if (mBackupAndRestore.backup("localBackup") & UserService.webBackup()) { |
|
|
|
} else { |
|
|
|
DialogCreator.createTipDialog(mMainActivity, "备份(本地和网络)成功,本地备份文件路径:" + APPCONST.BACKUP_FILE_DIR); |
|
|
|
DialogCreator.createTipDialog(mMainActivity, "未登录或未给予储存权限,备份失败!"); |
|
|
|
} else { |
|
|
|
|
|
|
|
DialogCreator.createTipDialog(mMainActivity, "未登录或未给予储存权限,备份失败!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -615,13 +612,10 @@ public class BookcasePresenter implements BasePresenter { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
isDownloadFinish = false; |
|
|
|
isDownloadFinish = false; |
|
|
|
Thread downloadThread = new Thread(new Runnable() { |
|
|
|
Thread downloadThread = new Thread(() -> { |
|
|
|
@Override |
|
|
|
ArrayList<Chapter> chapters = (ArrayList<Chapter>) mChapterService.findBookAllChapterByBookId(book.getId()); |
|
|
|
public void run() { |
|
|
|
addDownload(book, chapters, |
|
|
|
ArrayList<Chapter> chapters = (ArrayList<Chapter>) mChapterService.findBookAllChapterByBookId(book.getId()); |
|
|
|
book.getHisttoryChapterNum(), chapters.size()); |
|
|
|
addDownload(book, chapters, |
|
|
|
|
|
|
|
book.getHisttoryChapterNum(), chapters.size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
es.submit(downloadThread); |
|
|
|
es.submit(downloadThread); |
|
|
|
do { |
|
|
|
do { |
|
|
|