pull/32/head
GKF 6 years ago
parent 4ce8709e71
commit cf6d11bd36
  1. 5
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 7
      app/src/main/java/io/legado/app/ui/main/MyFragment.kt
  3. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  4. 2
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceFragment.kt
  5. 2
      app/src/main/java/io/legado/app/ui/main/findbook/FindBookFragment.kt
  6. 7
      app/src/main/java/io/legado/app/ui/main/myconfig/MyConfigFragment.kt
  7. 29
      app/src/main/res/layout/activity_main.xml
  8. 21
      app/src/main/res/layout/content_main.xml
  9. 0
      app/src/main/res/layout/fragment_my_config.xml
  10. 23
      app/src/main/res/menu/activity_main_bnv.xml
  11. 38
      app/src/main/res/menu/activity_main_drawer.xml

@ -1,6 +1,5 @@
package io.legado.app.ui.main
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
@ -9,9 +8,7 @@ import io.legado.app.base.BaseActivity
import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.help.storage.Restore
import io.legado.app.ui.search.SearchActivity
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : BaseActivity<MainViewModel>() {
override val viewModel: MainViewModel
@ -21,8 +18,6 @@ class MainActivity : BaseActivity<MainViewModel>() {
get() = R.layout.activity_main
override fun onViewModelCreated(viewModel: MainViewModel, savedInstanceState: Bundle?) {
fab.setOnClickListener { startActivity(Intent(this, SearchActivity::class.java)) }
}

@ -1,7 +0,0 @@
package io.legado.app.ui.main
import androidx.fragment.app.Fragment
class MyFragment : Fragment() {
}

@ -1,4 +1,4 @@
package io.legado.app.ui.main
package io.legado.app.ui.main.bookshelf
import androidx.fragment.app.Fragment

@ -1,4 +1,4 @@
package io.legado.app.ui.main
package io.legado.app.ui.main.booksource
import androidx.fragment.app.Fragment

@ -1,4 +1,4 @@
package io.legado.app.ui.main
package io.legado.app.ui.main.findbook
import androidx.fragment.app.Fragment

@ -0,0 +1,7 @@
package io.legado.app.ui.main.myconfig
import androidx.fragment.app.Fragment
class MyConfigFragment : Fragment() {
}

@ -7,20 +7,25 @@
android:layout_height="match_parent"
tools:context=".ui.main.MainActivity">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="wrap_content"/>
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/content_main"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/activity_main_bnv"
tools:layout_editor_absoluteX="-16dp"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email"/>
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation_view"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main"
tools:context=".ui.main.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<item
android:id="@+id/nav_backup"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_backup"/>
<item
android:id="@+id/nav_restore"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_restore"/>
<item
android:id="@+id/nav_import_old"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_import_old"/>
<item
android:id="@+id/nav_import_github"
android:icon="@drawable/ic_menu_manage"
android:title="@string/menu_import_github"/>
</menu>

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_backup"
android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_backup"/>
<item
android:id="@+id/nav_restore"
android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_restore"/>
<item
android:id="@+id/nav_import_old"
android:icon="@drawable/ic_menu_slideshow"
android:title="@string/menu_import_old"/>
<item
android:id="@+id/nav_import_github"
android:icon="@drawable/ic_menu_manage"
android:title="@string/menu_import_github"/>
</group>
<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_replace_rule"
android:icon="@drawable/ic_menu_share"
android:title="@string/menu_replace_rule"/>
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_menu_send"
android:title="@string/menu_send"/>
</menu>
</item>
</menu>
Loading…
Cancel
Save