|
|
|
@ -58,6 +58,7 @@ class DownloadActivity : VMBaseActivity<DownloadViewModel>(R.layout.activity_dow |
|
|
|
|
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { |
|
|
|
|
when (item.itemId) { |
|
|
|
|
R.id.menu_download -> launch(IO) { |
|
|
|
|
if (adapter.downloadMap.isNullOrEmpty()) { |
|
|
|
|
App.db.bookDao().webBooks.forEach { book -> |
|
|
|
|
Download.start( |
|
|
|
|
this@DownloadActivity, |
|
|
|
@ -66,6 +67,9 @@ class DownloadActivity : VMBaseActivity<DownloadViewModel>(R.layout.activity_dow |
|
|
|
|
book.totalChapterNum |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
Download.stop(this@DownloadActivity) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return super.onCompatOptionsItemSelected(item) |
|
|
|
|