feat: 优化代码

pull/127/head
kunfei 5 years ago
parent 441bd5f276
commit 8a553e1229
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  4. 1
      app/src/main/res/layout/dialog_read_aloud.xml
  5. 1
      app/src/main/res/layout/dialog_read_book_style.xml

@ -16,6 +16,7 @@ import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.postEvent
@ -47,7 +48,7 @@ class MoreConfigDialog : DialogFragment() {
savedInstanceState: Bundle?
): View? {
val view = LinearLayout(context)
view.setBackgroundResource(R.color.background)
view.setBackgroundColor(requireContext().bottomBackground)
view.id = R.id.tag1
container?.addView(view)
return view

@ -11,6 +11,7 @@ import androidx.fragment.app.DialogFragment
import io.legado.app.R
import io.legado.app.constant.EventBus
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.service.BaseReadAloudService
import io.legado.app.service.help.ReadAloud
import io.legado.app.service.help.ReadBook
@ -54,6 +55,7 @@ class ReadAloudDialog : DialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
ll_bottom_bg.setBackgroundColor(requireContext().bottomBackground)
initData()
initOnChange()
initOnClick()

@ -14,6 +14,7 @@ import io.legado.app.constant.PreferKey
import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.book.read.Help
import io.legado.app.ui.book.read.ReadBookActivity
@ -71,6 +72,7 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack {
}
private fun initView() {
root_view.setBackgroundColor(requireContext().bottomBackground)
dsb_text_size.valueFormat = {
(it + 5).toString()
}

@ -60,6 +60,7 @@
<View style="@style/Style.Shadow.Bottom" />
<LinearLayout
android:id="@+id/ll_bottom_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_menu"

@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/root_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"

Loading…
Cancel
Save