pull/32/head
kunfei 5 years ago
parent 66ea00b41e
commit 17a9e0d417
  1. 109
      app/src/main/java/io/legado/app/ui/read/ReadActivity.kt
  2. 193
      app/src/main/java/io/legado/app/ui/read/ReadBottomMenu.kt
  3. 4
      app/src/main/res/anim/anim_none.xml
  4. 7
      app/src/main/res/anim/anim_readbook_bottom_in.xml
  5. 7
      app/src/main/res/anim/anim_readbook_bottom_out.xml
  6. 7
      app/src/main/res/anim/anim_readbook_top_in.xml
  7. 7
      app/src/main/res/anim/anim_readbook_top_out.xml
  8. 8
      app/src/main/res/anim/moprogress_bottom_in.xml
  9. 9
      app/src/main/res/anim/moprogress_bottom_out.xml
  10. 17
      app/src/main/res/anim/moprogress_in.xml
  11. 17
      app/src/main/res/anim/moprogress_in_bottom_right.xml
  12. 17
      app/src/main/res/anim/moprogress_in_top_right.xml
  13. 17
      app/src/main/res/anim/moprogress_out.xml
  14. 17
      app/src/main/res/anim/moprogress_out_bottom_right.xml
  15. 17
      app/src/main/res/anim/moprogress_out_top_right.xml
  16. 22
      app/src/main/res/layout/activity_read.xml
  17. 358
      app/src/main/res/layout/view_read_bottom_menu.xml
  18. 93
      app/src/main/res/menu/read_book.xml

@ -1,21 +1,76 @@
package io.legado.app.ui.read
import android.os.Bundle
import android.view.KeyEvent
import android.view.Menu
import android.view.MenuItem
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import androidx.core.view.isVisible
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.utils.getViewModel
import io.legado.app.utils.invisible
import io.legado.app.utils.visible
import kotlinx.android.synthetic.main.activity_read.*
import kotlinx.android.synthetic.main.view_title_bar.*
import org.jetbrains.anko.sdk27.listeners.onClick
class ReadActivity : VMBaseActivity<ReadViewModel>(R.layout.activity_read) {
override val viewModel: ReadViewModel
get() = getViewModel(ReadViewModel::class.java)
private var menuBarShow: Boolean = false
private lateinit var menuTopIn: Animation
private lateinit var menuTopOut: Animation
private lateinit var menuBottomIn: Animation
private lateinit var menuBottomOut: Animation
override fun onActivityCreated(savedInstanceState: Bundle?) {
setSupportActionBar(toolbar)
initAnimation()
initView()
viewModel.initData(intent)
}
private fun initAnimation() {
menuTopIn = AnimationUtils.loadAnimation(this, R.anim.anim_readbook_top_in)
menuBottomIn = AnimationUtils.loadAnimation(this, R.anim.anim_readbook_bottom_in)
menuBottomIn.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
}
override fun onAnimationEnd(animation: Animation) {
vw_menu_bg.onClick { runMenuOut() }
}
override fun onAnimationRepeat(animation: Animation) {
}
})
//隐藏菜单
menuTopOut = AnimationUtils.loadAnimation(this, R.anim.anim_readbook_top_out)
menuBottomOut = AnimationUtils.loadAnimation(this, R.anim.anim_readbook_bottom_out)
menuBottomOut.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
vw_menu_bg.setOnClickListener(null)
}
override fun onAnimationEnd(animation: Animation) {
fl_menu.invisible()
title_bar.invisible()
bottom_menu.invisible()
menuBarShow = false
}
override fun onAnimationRepeat(animation: Animation) {
}
})
}
private fun initView() {
tv_chapter_name.onClick {
@ -24,4 +79,58 @@ class ReadActivity : VMBaseActivity<ReadViewModel>(R.layout.activity_read) {
}
}
override fun onCompatCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.read_book, menu)
return super.onCompatCreateOptionsMenu(menu)
}
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
}
return super.onCompatOptionsItemSelected(item)
}
override fun dispatchKeyEvent(event: KeyEvent?): Boolean {
val keyCode = event?.keyCode
val action = event?.action
val isDown = action == 0
if (keyCode == KeyEvent.KEYCODE_MENU) {
if (isDown && !menuBarShow) {
runMenuIn()
return true
}
if (!isDown && !menuBarShow) {
menuBarShow = true
return true
}
}
return super.dispatchKeyEvent(event)
}
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
when (keyCode) {
}
return super.onKeyDown(keyCode, event)
}
private fun runMenuIn() {
fl_menu.visible()
title_bar.visible()
bottom_menu.visible()
title_bar.startAnimation(menuTopIn)
bottom_menu.startAnimation(menuBottomIn)
}
private fun runMenuOut() {
if (fl_menu.isVisible) {
if (bottom_menu.isVisible) {
title_bar.startAnimation(menuTopOut)
bottom_menu.startAnimation(menuBottomOut)
}
}
}
}

@ -0,0 +1,193 @@
package io.legado.app.ui.read
import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout
import android.widget.SeekBar
import io.legado.app.R
import io.legado.app.utils.gone
import io.legado.app.utils.visible
import kotlinx.android.synthetic.main.view_read_bottom_menu.view.*
import org.jetbrains.anko.sdk27.listeners.onClick
import org.jetbrains.anko.sdk27.listeners.onLongClick
class ReadBottomMenu : FrameLayout {
private var callback: Callback? = null
val readProgress: SeekBar
get() = hpb_read_progress
constructor(context: Context) : super(context) {
init(context)
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init(context)
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context)
}
private fun init(context: Context) {
inflate(context, R.layout.view_read_bottom_menu, this)
vw_bg.onClick { }
vwNavigationBar.onClick { }
}
fun setNavigationBarHeight(height: Int) {
vwNavigationBar.layoutParams.height = height
}
fun setListener(callback: Callback) {
this.callback = callback
bindEvent()
}
private fun bindEvent() {
ll_read_aloud_timer.onClick { callback?.dismiss() }
ll_floating_button.onClick { callback?.dismiss() }
//阅读进度
hpb_read_progress.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar, i: Int, b: Boolean) {
}
override fun onStartTrackingTouch(seekBar: SeekBar) {
}
override fun onStopTrackingTouch(seekBar: SeekBar) {
callback!!.skipToPage(seekBar.progress)
}
})
//朗读定时
fab_read_aloud_timer.onClick { }
//朗读
fab_read_aloud.onClick { callback?.onMediaButton() }
//长按停止朗读
fab_read_aloud.onClick {
true
}
//自动翻页
fabAutoPage.onClick { callback?.autoPage() }
fabAutoPage.onLongClick {
callback?.toast(R.string.auto_next_page)
true
}
//替换
fabReplaceRule.onClick { callback?.openReplaceRule() }
fabReplaceRule.onLongClick {
callback!!.toast(R.string.replace_rule_title)
true
}
//夜间模式
fabNightTheme.onClick { callback?.setNightTheme() }
fabNightTheme.onLongClick {
callback?.toast(R.string.night_theme)
true
}
//上一章
tv_pre.onClick { callback?.skipPreChapter() }
//下一章
tv_next.onClick { callback?.skipNextChapter() }
//目录
ll_catalog.onClick { callback?.openChapterList() }
//调节
ll_adjust.onClick { callback?.openAdjust() }
//界面
ll_font.onClick { callback?.openReadInterface() }
//设置
ll_setting.onClick { callback?.openMoreSetting() }
tv_read_aloud_timer.onClick { }
}
fun setFabReadAloudImage(id: Int) {
fab_read_aloud.setImageResource(id)
}
fun setReadAloudTimer(visibility: Boolean) {
if (visibility) {
ll_read_aloud_timer.visible()
} else {
ll_read_aloud_timer.gone()
}
}
fun setReadAloudTimer(text: String) {
tv_read_aloud_timer.text = text
}
fun setFabReadAloudText(text: String) {
fab_read_aloud.contentDescription = text
}
fun setTvPre(enable: Boolean) {
tv_pre.isEnabled = enable
}
fun setTvNext(enable: Boolean) {
tv_next.isEnabled = enable
}
fun setAutoPage(autoPage: Boolean) {
if (autoPage) {
fabAutoPage.setImageResource(R.drawable.ic_auto_page_stop)
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page_stop)
} else {
fabAutoPage.setImageResource(R.drawable.ic_auto_page)
fabAutoPage.contentDescription = context.getString(R.string.auto_next_page)
}
}
fun setFabNightTheme(isNightTheme: Boolean) {
if (isNightTheme) {
fabNightTheme.setImageResource(R.drawable.ic_daytime)
} else {
fabNightTheme.setImageResource(R.drawable.ic_brightness)
}
}
interface Callback {
fun skipToPage(page: Int)
fun onMediaButton()
fun autoPage()
fun setNightTheme()
fun skipPreChapter()
fun skipNextChapter()
fun openReplaceRule()
fun openChapterList()
fun openAdjust()
fun openReadInterface()
fun openMoreSetting()
fun toast(id: Int)
fun dismiss()
}
}

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<set>
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150">
<translate
android:fromYDelta="100%"
android:toYDelta="0" />
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200">
<translate
android:fromYDelta="0%"
android:toYDelta="100%" />
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200">
<translate
android:fromYDelta="-100%"
android:toYDelta="0" />
</set>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200">
<translate
android:fromYDelta="0"
android:toYDelta="-100%" />
</set>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300">
<translate
android:fromYDelta="100%"
android:toYDelta="0%" />
</set>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<translate
android:fromYDelta="0%"
android:toYDelta="100%" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="120%"
android:toXScale="100%"
android:fromYScale="120%"
android:toYScale="100%"
android:pivotX="50%"
android:pivotY="50%" />
<alpha
android:fromAlpha="0"
android:toAlpha="1" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="20%"
android:toXScale="100%"
android:fromYScale="20%"
android:toYScale="100%"
android:pivotX="100%"
android:pivotY="100%" />
<alpha
android:fromAlpha="0"
android:toAlpha="1" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="20%"
android:toXScale="100%"
android:fromYScale="20%"
android:toYScale="100%"
android:pivotX="100%"
android:pivotY="0%" />
<alpha
android:fromAlpha="0"
android:toAlpha="1" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="100%"
android:toXScale="80%"
android:fromYScale="100%"
android:toYScale="80%"
android:pivotX="50%"
android:pivotY="50%" />
<alpha
android:fromAlpha="1"
android:toAlpha="0" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="100%"
android:toXScale="20%"
android:fromYScale="100%"
android:toYScale="20%"
android:pivotX="100%"
android:pivotY="100%" />
<alpha
android:fromAlpha="1"
android:toAlpha="0" />
</set>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="300">
<scale
android:fromXScale="100%"
android:toXScale="20%"
android:fromYScale="100%"
android:toYScale="20%"
android:pivotX="100%"
android:pivotY="0%" />
<alpha
android:fromAlpha="1"
android:toAlpha="0" />
</set>

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -9,13 +8,23 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<FrameLayout
android:id="@+id/fl_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<View
android:id="@+id/vw_menu_bg"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:theme="?attr/actionBarStyle"
app:layout_constraintTop_toTopOf="parent">
android:theme="?attr/actionBarStyle">
<TextView
android:id="@+id/tv_chapter_name"
@ -37,5 +46,12 @@
</io.legado.app.ui.widget.TitleBar>
<io.legado.app.ui.read.ReadBottomMenu
android:id="@+id/bottom_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,358 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_read_aloud_timer"
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:visibility="gone">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_read_aloud_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/set_timer"
android:src="@drawable/ic_timer_black_24dp"
android:tint="@color/tv_text_default"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp" />
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:cardBackgroundColor="@color/background_card">
<TextView
android:id="@+id/tv_read_aloud_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:padding="10dp"
android:text="@string/read_aloud_timer" />
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_floating_button"
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:paddingStart="32dp"
android:paddingEnd="32dp">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_read_aloud"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/read_aloud"
android:src="@drawable/ic_read_aloud"
android:tint="@color/tv_text_default"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabAutoPage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/auto_next_page"
android:src="@drawable/ic_auto_page"
android:tint="@color/tv_text_default"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabReplaceRule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/replace_rule_title"
android:src="@drawable/ic_find_replace"
android:tint="@color/tv_text_default"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabNightTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/night_theme"
android:src="@drawable/ic_brightness"
android:tint="@color/tv_text_default"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp" />
</LinearLayout>
<View style="@style/Style.Shadow.Bottom" />
<!--底部设置栏-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="100dp">
<View
android:id="@+id/vw_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_menu" />
<LinearLayout
android:id="@+id/llNavigationBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--章节设置-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_pre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:enabled="false"
android:focusable="true"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/previous_chapter"
android:textColor="@color/tv_text_default"
android:textSize="14sp" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/hpb_read_progress"
android:layout_width="0dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:enabled="false"
android:focusable="true"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/next_chapter"
android:textColor="@color/tv_text_default"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:baselineAligned="false"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<!--目录按钮-->
<LinearLayout
android:id="@+id/ll_catalog"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:contentDescription="@string/chapter_list"
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="7dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:contentDescription="@string/chapter_list"
android:src="@drawable/ic_chapter_list"
app:tint="@color/tv_text_default"
tools:ignore="NestedWeights" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="@string/chapter_list"
android:textColor="@color/tv_text_default"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
<!--调节按钮-->
<LinearLayout
android:id="@+id/ll_adjust"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:contentDescription="@string/adjust"
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="7dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:contentDescription="@string/adjust"
android:src="@drawable/ic_tune"
app:tint="@color/tv_text_default"
tools:ignore="NestedWeights" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="@string/adjust"
android:textColor="@color/tv_text_default"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
<!--界面按钮-->
<LinearLayout
android:id="@+id/ll_font"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:contentDescription="@string/interface_setting"
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="7dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:contentDescription="@string/interface_setting"
android:src="@drawable/ic_interface_setting"
app:tint="@color/tv_text_default"
tools:ignore="NestedWeights" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="@string/interface_setting"
android:textColor="@color/tv_text_default"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
<!--设置按钮-->
<LinearLayout
android:id="@+id/ll_setting"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_ib_pre_round"
android:clickable="true"
android:contentDescription="@string/setting"
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="7dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:contentDescription="@string/setting"
android:src="@drawable/ic_settings"
app:tint="@color/tv_text_default"
tools:ignore="NestedWeights" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="@string/setting"
android:textColor="@color/tv_text_default"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>
<View
android:id="@+id/vwNavigationBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/background_menu" />
</LinearLayout>

@ -0,0 +1,93 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".view.activity.MainActivity">
<group android:id="@+id/menuOnLine">
<item
android:id="@+id/action_change_source"
android:icon="@drawable/ic_exchange"
android:title="@string/change_origin"
app:showAsAction="always" />
<item
android:id="@+id/action_refresh"
android:icon="@drawable/ic_refresh_black_24dp"
android:title="@string/refresh"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_download"
android:icon="@drawable/ic_download_line"
android:title="@string/download_offline"
app:showAsAction="ifRoom" />
<item
android:id="@+id/disable_book_source"
android:icon="@drawable/ic_cancel"
android:title="@string/disable_book_source"
app:showAsAction="never" />
</group>
<group android:id="@+id/menu_text">
<item
android:id="@+id/action_set_regex"
android:icon="@drawable/ic_exchange"
android:title="@string/txt_chapter_regex"
app:showAsAction="always" />
</group>
<group android:id="@+id/menuLocal">
<item
android:id="@+id/action_set_charset"
android:icon="@drawable/ic_translate"
android:title="@string/set_charset"
app:showAsAction="ifRoom" />
</group>
<group android:id="@+id/menuShow">
<item
android:id="@+id/add_bookmark"
android:icon="@drawable/ic_bookmark"
android:title="@string/bookmark_add"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_copy_text"
android:icon="@drawable/ic_copy"
android:title="@string/copy_text"
app:showAsAction="ifRoom" />
<item
android:id="@+id/enable_replace"
android:icon="@drawable/ic_find_replace"
android:title="@string/replace_rule_title"
android:checkable="true"
android:checked="true"
app:showAsAction="never" />
<item
android:id="@+id/update_chapter_list"
android:icon="@drawable/ic_update"
android:title="@string/update_chapter"
app:showAsAction="never" />
<item
android:id="@+id/action_book_info"
android:icon="@drawable/ic_toc"
android:title="@string/book_info"
app:showAsAction="never" />
</group>
<group android:id="@+id/menu_login">
<item
android:id="@+id/action_login"
android:icon="@drawable/ic_toc"
android:title="@string/login"
app:showAsAction="never" />
</group>
</menu>
Loading…
Cancel
Save