pull/32/head
parent
66ea00b41e
commit
17a9e0d417
@ -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> |
@ -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…
Reference in new issue