|
|
@ -17,11 +17,13 @@ import io.legado.app.base.BaseFragment |
|
|
|
import io.legado.app.data.entities.Book |
|
|
|
import io.legado.app.data.entities.Book |
|
|
|
import io.legado.app.data.entities.BookGroup |
|
|
|
import io.legado.app.data.entities.BookGroup |
|
|
|
import io.legado.app.lib.theme.ThemeStore |
|
|
|
import io.legado.app.lib.theme.ThemeStore |
|
|
|
|
|
|
|
import io.legado.app.ui.bookshelf.BookshelfActivity |
|
|
|
import io.legado.app.utils.disableAutoFill |
|
|
|
import io.legado.app.utils.disableAutoFill |
|
|
|
import kotlinx.android.synthetic.main.fragment_bookshelf.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_bookshelf.* |
|
|
|
import kotlinx.android.synthetic.main.view_title_bar.* |
|
|
|
import kotlinx.android.synthetic.main.view_title_bar.* |
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
|
|
|
import org.jetbrains.anko.startActivity |
|
|
|
import org.jetbrains.anko.textColor |
|
|
|
import org.jetbrains.anko.textColor |
|
|
|
|
|
|
|
|
|
|
|
class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) { |
|
|
|
class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) { |
|
|
@ -48,8 +50,8 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) { |
|
|
|
bookGroupAdapter = BookGroupAdapter() |
|
|
|
bookGroupAdapter = BookGroupAdapter() |
|
|
|
rv_book_group.adapter = bookGroupAdapter |
|
|
|
rv_book_group.adapter = bookGroupAdapter |
|
|
|
bookGroupAdapter.callBack = object : BookGroupAdapter.CallBack { |
|
|
|
bookGroupAdapter.callBack = object : BookGroupAdapter.CallBack { |
|
|
|
override fun open(groupId: Int) { |
|
|
|
override fun open(bookGroup: BookGroup) { |
|
|
|
when (groupId) { |
|
|
|
when (bookGroup.groupId) { |
|
|
|
-10 -> context?.let { |
|
|
|
-10 -> context?.let { |
|
|
|
MaterialDialog(it).show { |
|
|
|
MaterialDialog(it).show { |
|
|
|
window?.decorView?.disableAutoFill() |
|
|
|
window?.decorView?.disableAutoFill() |
|
|
@ -69,6 +71,7 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) { |
|
|
|
positiveButton(R.string.ok) |
|
|
|
positiveButton(R.string.ok) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else -> context?.startActivity<BookshelfActivity>(Pair("data", bookGroup)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|