pull/32/head
gedoor 6 years ago
parent 32d5db1559
commit 6e804e7b11
  1. 10
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  2. 11
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceFragment.kt
  3. 11
      app/src/main/java/io/legado/app/ui/main/findbook/FindBookFragment.kt
  4. 11
      app/src/main/java/io/legado/app/ui/main/myconfig/MyConfigFragment.kt
  5. 0
      app/src/main/res/menu/book_source.xml
  6. 15
      app/src/main/res/menu/bookshelf.xml
  7. 15
      app/src/main/res/menu/find_book.xml
  8. 15
      app/src/main/res/menu/my_config.xml

@ -2,16 +2,24 @@ package io.legado.app.ui.main.bookshelf
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.R
import kotlinx.android.synthetic.main.view_titlebar.*
class BookshelfFragment : Fragment(R.layout.fragment_bookshelf) {
class BookshelfFragment : Fragment(R.layout.fragment_bookshelf), Toolbar.OnMenuItemClickListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "BookshelfFragment")
toolbar.inflateMenu(R.menu.bookshelf)
toolbar.setOnMenuItemClickListener(this)
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
return false
}

@ -2,15 +2,24 @@ package io.legado.app.ui.main.booksource
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.R
import kotlinx.android.synthetic.main.view_titlebar.*
class BookSourceFragment : Fragment(R.layout.fragment_book_source) {
class BookSourceFragment : Fragment(R.layout.fragment_book_source), Toolbar.OnMenuItemClickListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "BookSourceFragment")
toolbar.inflateMenu(R.menu.book_source)
toolbar.setOnMenuItemClickListener(this)
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
return false
}
}

@ -2,15 +2,24 @@ package io.legado.app.ui.main.findbook
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.R
import kotlinx.android.synthetic.main.view_titlebar.*
class FindBookFragment : Fragment(R.layout.fragment_find_book) {
class FindBookFragment : Fragment(R.layout.fragment_find_book), Toolbar.OnMenuItemClickListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "FindBookFragment")
toolbar.inflateMenu(R.menu.find_book)
toolbar.setOnMenuItemClickListener(this)
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
return false
}
}

@ -2,15 +2,24 @@ package io.legado.app.ui.main.myconfig
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.R
import kotlinx.android.synthetic.main.view_titlebar.*
class MyConfigFragment : Fragment(R.layout.fragment_my_config) {
class MyConfigFragment : Fragment(R.layout.fragment_my_config), Toolbar.OnMenuItemClickListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "MyConfigFragment")
toolbar.inflateMenu(R.menu.my_config)
toolbar.setOnMenuItemClickListener(this)
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
return false
}
}

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_test"
android:title="测试"
android:icon="@drawable/ic_search"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_test"
android:title="测试"
android:icon="@drawable/ic_search"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never"/>
<item android:id="@+id/action_test"
android:title="测试"
android:icon="@drawable/ic_search"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>
Loading…
Cancel
Save