pull/457/head
gedoor 4 years ago
parent a97f480d24
commit 05d2afaaed
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt
  2. 5
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  3. 5
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  4. 1
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt
  5. 5
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  6. 5
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  7. 5
      app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt

@ -1,7 +1,6 @@
package io.legado.app.ui.book.read.config package io.legado.app.ui.book.read.config
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.* import android.view.*
import android.widget.SeekBar import android.widget.SeekBar
import io.legado.app.R import io.legado.app.R
@ -20,10 +19,6 @@ class AutoReadDialog : BaseDialogFragment() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window?.let { dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background) it.setBackgroundDrawableResource(R.color.background)

@ -7,7 +7,6 @@ import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.* import android.view.*
import androidx.documentfile.provider.DocumentFile import androidx.documentfile.provider.DocumentFile
import com.jaredrummler.android.colorpicker.ColorPickerDialog import com.jaredrummler.android.colorpicker.ColorPickerDialog
@ -54,10 +53,6 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window?.let { dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background) it.setBackgroundDrawableResource(R.color.background)

@ -3,7 +3,6 @@ package io.legado.app.ui.book.read.config
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.* import android.view.*
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
@ -25,10 +24,6 @@ class MoreConfigDialog : DialogFragment() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window?.let { dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background) it.setBackgroundDrawableResource(R.color.background)

@ -32,7 +32,6 @@ class ReadAloudConfigDialog : DialogFragment() {
it.windowManager?.defaultDisplay?.getMetrics(dm) it.windowManager?.defaultDisplay?.getMetrics(dm)
} }
dialog?.window?.let { dialog?.window?.let {
it.setBackgroundDrawableResource(R.color.transparent) it.setBackgroundDrawableResource(R.color.transparent)
it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT)
} }

@ -1,7 +1,6 @@
package io.legado.app.ui.book.read.config package io.legado.app.ui.book.read.config
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.* import android.view.*
import android.widget.SeekBar import android.widget.SeekBar
import io.legado.app.R import io.legado.app.R
@ -25,10 +24,6 @@ class ReadAloudDialog : BaseDialogFragment() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window?.let { dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background) it.setBackgroundDrawableResource(R.color.background)

@ -3,7 +3,6 @@ package io.legado.app.ui.book.read.config
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.DialogInterface import android.content.DialogInterface
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.* import android.view.*
import androidx.core.view.get import androidx.core.view.get
import io.legado.app.R import io.legado.app.R
@ -36,10 +35,6 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window?.let { dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background) it.setBackgroundDrawableResource(R.color.background)

@ -1,7 +1,6 @@
package io.legado.app.ui.book.read.config package io.legado.app.ui.book.read.config
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -19,10 +18,6 @@ class TipConfigDialog : BaseDialogFragment() {
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics()
activity?.let {
it.windowManager?.defaultDisplay?.getMetrics(dm)
}
dialog?.window dialog?.window
?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) ?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
} }

Loading…
Cancel
Save