pull/32/head
GKF 6 years ago
parent 8b4dee9232
commit b580de08b3
  1. 8
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 14
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  3. 14
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceFragment.kt
  4. 14
      app/src/main/java/io/legado/app/ui/main/findbook/FindBookFragment.kt
  5. 14
      app/src/main/java/io/legado/app/ui/main/myconfig/MyConfigFragment.kt

@ -31,10 +31,10 @@ class MainActivity : BaseActivity<MainViewModel>(), BottomNavigationView.OnNavig
get() = R.layout.activity_main
override fun onViewModelCreated(viewModel: MainViewModel, savedInstanceState: Bundle?) {
mFragmentList.add(BookshelfFragment())
mFragmentList.add(FindBookFragment())
mFragmentList.add(BookSourceFragment())
mFragmentList.add(MyConfigFragment())
mFragmentList.add(BookshelfFragment(R.layout.fragment_bookshelf))
mFragmentList.add(FindBookFragment(R.layout.fragment_find_book))
mFragmentList.add(BookSourceFragment(R.layout.fragment_book_source))
mFragmentList.add(MyConfigFragment(R.layout.fragment_my_config))
view_pager_main.adapter =
TabFragmentPageAdapter(supportFragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT)
view_pager_main.addOnPageChangeListener(this)

@ -1,16 +1,14 @@
package io.legado.app.ui.main.bookshelf
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
class BookshelfFragment : Fragment() {
class BookshelfFragment(contentLayoutId: Int) : Fragment(contentLayoutId) {
// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// return inflater.inflate(R.layout.fragment_bookshelf, container)
// }
//
// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// super.onViewCreated(view, savedInstanceState)
// }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}

@ -1,15 +1,13 @@
package io.legado.app.ui.main.booksource
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
class BookSourceFragment : Fragment() {
class BookSourceFragment(contentLayoutId: Int) : Fragment(contentLayoutId) {
// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// return inflater.inflate(R.layout.fragment_book_source, container)
// }
//
// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// super.onViewCreated(view, savedInstanceState)
// }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}

@ -1,15 +1,13 @@
package io.legado.app.ui.main.findbook
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
class FindBookFragment : Fragment() {
class FindBookFragment(contentLayoutId: Int) : Fragment(contentLayoutId) {
// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// return inflater.inflate(R.layout.fragment_find_book, container)
// }
//
// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// super.onViewCreated(view, savedInstanceState)
// }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}

@ -1,15 +1,13 @@
package io.legado.app.ui.main.myconfig
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
class MyConfigFragment : Fragment() {
class MyConfigFragment(contentLayoutId: Int) : Fragment(contentLayoutId) {
// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// return inflater.inflate(R.layout.fragment_my_config, container)
// }
//
// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// super.onViewCreated(view, savedInstanceState)
// }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
Loading…
Cancel
Save