pull/32/head
kunfei 5 years ago
parent f6b50650f5
commit c2b88b50fd
  1. 2
      app/src/main/java/io/legado/app/ui/read/ReadActivity.kt
  2. 13
      app/src/main/java/io/legado/app/ui/read/ReadBottomMenu.kt
  3. 20
      app/src/main/res/layout/view_read_bottom_menu.xml

@ -129,7 +129,7 @@ class ReadActivity : VMBaseActivity<ReadViewModel>(R.layout.activity_read) {
} }
override fun toast(id: Int) { override fun toast(id: Int) {
toast(id) this@ReadActivity.toast(id)
} }
override fun dismiss() { override fun dismiss() {

@ -9,7 +9,6 @@ import io.legado.app.utils.gone
import io.legado.app.utils.visible import io.legado.app.utils.visible
import kotlinx.android.synthetic.main.view_read_bottom_menu.view.* import kotlinx.android.synthetic.main.view_read_bottom_menu.view.*
import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onClick
import org.jetbrains.anko.sdk27.listeners.onLongClick
class ReadBottomMenu : FrameLayout { class ReadBottomMenu : FrameLayout {
@ -76,24 +75,12 @@ class ReadBottomMenu : FrameLayout {
//自动翻页 //自动翻页
fabAutoPage.onClick { callback?.autoPage() } fabAutoPage.onClick { callback?.autoPage() }
fabAutoPage.onLongClick {
callback?.toast(R.string.auto_next_page)
true
}
//替换 //替换
fabReplaceRule.onClick { callback?.openReplaceRule() } fabReplaceRule.onClick { callback?.openReplaceRule() }
fabReplaceRule.onLongClick {
callback?.toast(R.string.replace_rule_title)
true
}
//夜间模式 //夜间模式
fabNightTheme.onClick { callback?.setNightTheme() } fabNightTheme.onClick { callback?.setNightTheme() }
fabNightTheme.onLongClick {
callback?.toast(R.string.night_theme)
true
}
//上一章 //上一章
tv_pre.onClick { callback?.skipPreChapter() } tv_pre.onClick { callback?.skipPreChapter() }

@ -23,10 +23,12 @@
android:contentDescription="@string/set_timer" android:contentDescription="@string/set_timer"
android:src="@drawable/ic_timer_black_24dp" android:src="@drawable/ic_timer_black_24dp"
android:tint="@color/tv_text_default" android:tint="@color/tv_text_default"
android:tooltipText="@string/set_timer"
app:backgroundTint="@color/background_menu" app:backgroundTint="@color/background_menu"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:pressedTranslationZ="2dp" /> app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -62,10 +64,12 @@
android:contentDescription="@string/read_aloud" android:contentDescription="@string/read_aloud"
android:src="@drawable/ic_read_aloud" android:src="@drawable/ic_read_aloud"
android:tint="@color/tv_text_default" android:tint="@color/tv_text_default"
android:tooltipText="@string/read_aloud"
app:backgroundTint="@color/background_menu" app:backgroundTint="@color/background_menu"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:pressedTranslationZ="2dp" /> app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
<Space <Space
android:layout_width="0dp" android:layout_width="0dp"
@ -80,10 +84,12 @@
android:contentDescription="@string/auto_next_page" android:contentDescription="@string/auto_next_page"
android:src="@drawable/ic_auto_page" android:src="@drawable/ic_auto_page"
android:tint="@color/tv_text_default" android:tint="@color/tv_text_default"
android:tooltipText="@string/auto_next_page"
app:backgroundTint="@color/background_menu" app:backgroundTint="@color/background_menu"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:pressedTranslationZ="2dp" /> app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
<Space <Space
android:layout_width="0dp" android:layout_width="0dp"
@ -98,10 +104,12 @@
android:contentDescription="@string/replace_rule_title" android:contentDescription="@string/replace_rule_title"
android:src="@drawable/ic_find_replace" android:src="@drawable/ic_find_replace"
android:tint="@color/tv_text_default" android:tint="@color/tv_text_default"
android:tooltipText="@string/replace_rule_title"
app:backgroundTint="@color/background_menu" app:backgroundTint="@color/background_menu"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:pressedTranslationZ="2dp" /> app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
<Space <Space
android:layout_width="0dp" android:layout_width="0dp"
@ -116,10 +124,12 @@
android:contentDescription="@string/night_theme" android:contentDescription="@string/night_theme"
android:src="@drawable/ic_brightness" android:src="@drawable/ic_brightness"
android:tint="@color/tv_text_default" android:tint="@color/tv_text_default"
android:tooltipText="@string/night_theme"
app:backgroundTint="@color/background_menu" app:backgroundTint="@color/background_menu"
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:pressedTranslationZ="2dp" /> app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
</LinearLayout> </LinearLayout>

Loading…
Cancel
Save