|
|
@ -29,7 +29,6 @@ import io.legado.app.utils.getViewModelOfActivity |
|
|
|
import io.legado.app.utils.observeEvent |
|
|
|
import io.legado.app.utils.observeEvent |
|
|
|
import io.legado.app.utils.startActivity |
|
|
|
import io.legado.app.utils.startActivity |
|
|
|
import kotlinx.android.synthetic.main.fragment_books.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_books.* |
|
|
|
import org.jetbrains.anko.startActivity |
|
|
|
|
|
|
|
import kotlin.math.max |
|
|
|
import kotlin.math.max |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -61,7 +60,6 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), |
|
|
|
position = it.getInt("position", 0) |
|
|
|
position = it.getInt("position", 0) |
|
|
|
groupId = it.getLong("groupId", -1) |
|
|
|
groupId = it.getLong("groupId", -1) |
|
|
|
} |
|
|
|
} |
|
|
|
tv_empty_msg.setText(R.string.bookshelf_empty) |
|
|
|
|
|
|
|
initRecyclerView() |
|
|
|
initRecyclerView() |
|
|
|
upRecyclerData() |
|
|
|
upRecyclerData() |
|
|
|
} |
|
|
|
} |
|
|
@ -139,8 +137,8 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), |
|
|
|
override fun open(book: Book) { |
|
|
|
override fun open(book: Book) { |
|
|
|
when (book.type) { |
|
|
|
when (book.type) { |
|
|
|
BookType.audio -> |
|
|
|
BookType.audio -> |
|
|
|
context?.startActivity<AudioPlayActivity>(Pair("bookUrl", book.bookUrl)) |
|
|
|
startActivity<AudioPlayActivity>(Pair("bookUrl", book.bookUrl)) |
|
|
|
else -> context?.startActivity<ReadBookActivity>( |
|
|
|
else -> startActivity<ReadBookActivity>( |
|
|
|
Pair("bookUrl", book.bookUrl), |
|
|
|
Pair("bookUrl", book.bookUrl), |
|
|
|
Pair("key", IntentDataHelp.putData(book)) |
|
|
|
Pair("key", IntentDataHelp.putData(book)) |
|
|
|
) |
|
|
|
) |
|
|
|