pull/51/head
kunfei 5 years ago
parent 315d887d6b
commit 568c7e8577
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 6
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  3. 6
      app/src/main/res/layout/activity_book_read.xml
  4. 6
      app/src/main/res/layout/activity_main.xml

@ -38,6 +38,7 @@ import io.legado.app.ui.widget.page.PageView
import io.legado.app.ui.widget.page.delegate.PageDelegate
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.activity_book_read.*
import kotlinx.android.synthetic.main.view_book_page.*
import kotlinx.android.synthetic.main.view_read_menu.*
import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.Dispatchers.IO
@ -97,6 +98,7 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
* 初始化View
*/
private fun initView() {
ChapterProvider.textView = content_text_view
tv_chapter_name.onClick {
ReadBook.webBook?.let {
startActivityForResult<BookSourceEditActivity>(
@ -421,6 +423,7 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
}
observeEvent<Boolean>(Bus.UP_CONFIG) {
upSystemUiVisibility()
content_view.upStyle()
page_view.upBg()
page_view.upStyle()
if (it) {

@ -24,10 +24,8 @@ import io.legado.app.ui.main.bookshelf.BookshelfFragment
import io.legado.app.ui.main.explore.ExploreFragment
import io.legado.app.ui.main.my.MyFragment
import io.legado.app.ui.main.rss.RssFragment
import io.legado.app.ui.widget.page.ChapterProvider
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.view_book_page.*
class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
BottomNavigationView.OnNavigationItemSelectedListener,
@ -40,7 +38,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
private val fragmentList = arrayListOf<Fragment>()
override fun onActivityCreated(savedInstanceState: Bundle?) {
ChapterProvider.textView = content_text_view
ATH.applyEdgeEffectColor(view_pager_main)
ATH.applyBottomNavigationColor(bottom_navigation_view)
view_pager_main.offscreenPageLimit = 3
@ -136,9 +133,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
observeEvent<String>(Bus.RECREATE) {
recreate()
}
observeEvent<Boolean>(Bus.UP_CONFIG) {
content_view.upStyle()
}
observeEvent<String>(PreferKey.showRss) {
bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = showRss()
upFragmentList()

@ -4,6 +4,12 @@
android:layout_height="match_parent"
android:orientation="vertical">
<io.legado.app.ui.widget.page.ContentView
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
<io.legado.app.ui.widget.page.PageView
android:id="@+id/page_view"
android:layout_width="match_parent"

@ -4,12 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<io.legado.app.ui.widget.page.ContentView
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation_view"
android:paddingLeft="5dp"

Loading…
Cancel
Save