pull/49/head
kunfei 5 years ago
parent 30c5a79237
commit 9f8a55a902
  1. 16
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  2. 25
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  3. 16
      app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt
  4. 24
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt
  5. 28
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt

@ -43,14 +43,6 @@ class BgTextConfigDialog : DialogFragment() {
private val resultSelectBg = 123 private val resultSelectBg = 123
private lateinit var adapter: BgAdapter private lateinit var adapter: BgAdapter
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_bg_text, container)
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics() val dm = DisplayMetrics()
@ -69,6 +61,14 @@ class BgTextConfigDialog : DialogFragment() {
} }
} }
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_bg_text, container)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
initData() initData()

@ -19,21 +19,8 @@ import io.legado.app.ui.book.read.Help
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
class MoreConfigDialog : DialogFragment() { class MoreConfigDialog : DialogFragment() {
private val readPreferTag = "readPreferenceFragment" private val readPreferTag = "readPreferenceFragment"
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = LinearLayout(context)
view.setBackgroundResource(R.color.background)
view.id = R.id.tag1
container?.addView(view)
return view
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics() val dm = DisplayMetrics()
@ -52,6 +39,18 @@ class MoreConfigDialog : DialogFragment() {
} }
} }
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = LinearLayout(context)
view.setBackgroundResource(R.color.background)
view.id = R.id.tag1
container?.addView(view)
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
var preferenceFragment = childFragmentManager.findFragmentByTag(readPreferTag) var preferenceFragment = childFragmentManager.findFragmentByTag(readPreferTag)

@ -18,14 +18,6 @@ import org.jetbrains.anko.sdk27.listeners.onClick
class PaddingConfigDialog : DialogFragment() { class PaddingConfigDialog : DialogFragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_padding, container)
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics() val dm = DisplayMetrics()
@ -43,6 +35,14 @@ class PaddingConfigDialog : DialogFragment() {
} }
} }
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_padding, container)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
initData() initData()

@ -23,18 +23,6 @@ import io.legado.app.utils.postEvent
class ReadAloudConfigDialog : DialogFragment() { class ReadAloudConfigDialog : DialogFragment() {
private val readAloudPreferTag = "readAloudPreferTag" private val readAloudPreferTag = "readAloudPreferTag"
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = LinearLayout(context)
view.setBackgroundResource(R.color.background)
view.id = R.id.tag1
container?.addView(view)
return view
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics() val dm = DisplayMetrics()
@ -48,6 +36,18 @@ class ReadAloudConfigDialog : DialogFragment() {
} }
} }
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = LinearLayout(context)
view.setBackgroundResource(R.color.background)
view.id = R.id.tag1
container?.addView(view)
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
var preferenceFragment = childFragmentManager.findFragmentByTag(readAloudPreferTag) var preferenceFragment = childFragmentManager.findFragmentByTag(readAloudPreferTag)

@ -28,20 +28,6 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick
class ReadStyleDialog : DialogFragment() { class ReadStyleDialog : DialogFragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_book_style, container)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initOnClick()
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
val dm = DisplayMetrics() val dm = DisplayMetrics()
@ -60,6 +46,20 @@ class ReadStyleDialog : DialogFragment() {
} }
} }
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.dialog_read_book_style, container)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initOnClick()
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
ReadBookConfig.save() ReadBookConfig.save()

Loading…
Cancel
Save