|
|
@ -27,6 +27,7 @@ import kotlinx.coroutines.Dispatchers.Main |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
import org.jetbrains.anko.sdk27.listeners.onClick |
|
|
|
|
|
|
|
import kotlin.math.min |
|
|
|
|
|
|
|
|
|
|
|
class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_chapter_list), |
|
|
|
class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragment_chapter_list), |
|
|
|
ChapterListAdapter.Callback, |
|
|
|
ChapterListAdapter.Callback, |
|
|
@ -134,7 +135,7 @@ class ChapterListFragment : VMBaseFragment<ChapterListViewModel>(R.layout.fragme |
|
|
|
get() = viewModel.book?.isLocalBook() == true |
|
|
|
get() = viewModel.book?.isLocalBook() == true |
|
|
|
|
|
|
|
|
|
|
|
override fun durChapterIndex(): Int { |
|
|
|
override fun durChapterIndex(): Int { |
|
|
|
return durChapterIndex |
|
|
|
return min(durChapterIndex, adapter.itemCount) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun openChapter(bookChapter: BookChapter) { |
|
|
|
override fun openChapter(bookChapter: BookChapter) { |
|
|
|