pull/1660/head
kunfei 3 years ago
parent 651d501ff4
commit 161f928463
  1. 2
      app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeChapterSourceDialog.kt
  4. 5
      app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt
  5. 10
      app/src/main/java/io/legado/app/ui/book/read/PhotoDialog.kt
  6. 14
      app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt
  7. 14
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  8. 6
      app/src/main/java/io/legado/app/ui/book/read/config/ClickActionConfigDialog.kt
  9. 14
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  10. 8
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt
  11. 14
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  12. 14
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  13. 5
      app/src/main/java/io/legado/app/ui/book/toc/BookmarkDialog.kt
  14. 5
      app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt
  15. 5
      app/src/main/java/io/legado/app/ui/config/DirectLinkUploadConfig.kt
  16. 5
      app/src/main/java/io/legado/app/ui/login/SourceLoginDialog.kt
  17. 5
      app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt

@ -42,7 +42,7 @@ class ChangeCoverDialog() : BaseDialogFragment(R.layout.dialog_change_cover),
override fun onStart() {
super.onStart()
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 0.96f)
setLayout(0.98f, ViewGroup.LayoutParams.MATCH_PARENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -57,7 +57,7 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_
override fun onStart() {
super.onStart()
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 0.96f)
setLayout(0.98f, ViewGroup.LayoutParams.MATCH_PARENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -81,7 +81,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
override fun onStart() {
super.onStart()
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 0.96f)
setLayout(0.98f, ViewGroup.LayoutParams.MATCH_PARENT)
dialog?.setOnKeyListener(this)
}

@ -36,10 +36,7 @@ class GroupEditDialog() : BaseDialogFragment(R.layout.dialog_book_group_edit) {
override fun onStart() {
super.onStart()
setLayout(
0.9f,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -2,7 +2,6 @@ package io.legado.app.ui.book.read
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import io.legado.app.R
import io.legado.app.base.BaseDialogFragment
import io.legado.app.databinding.DialogPhotoViewBinding
@ -11,7 +10,9 @@ import io.legado.app.ui.book.read.page.provider.ImageProvider
import io.legado.app.utils.setLayout
import io.legado.app.utils.viewbindingdelegate.viewBinding
/**
* 显示图片
*/
class PhotoDialog() : BaseDialogFragment(R.layout.dialog_photo_view) {
constructor(chapterIndex: Int, src: String) : this() {
@ -25,10 +26,7 @@ class PhotoDialog() : BaseDialogFragment(R.layout.dialog_photo_view) {
override fun onStart() {
super.onStart()
setLayout(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
setLayout(0.98f, 0.98f)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -30,15 +30,15 @@ class AutoReadDialog : BaseDialogFragment(R.layout.dialog_auto_read) {
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
dialog?.window?.run {
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(R.color.background)
decorView.setPadding(0, 0, 0, 0)
val attr = attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
attributes = attr
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
}

@ -71,15 +71,15 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) {
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
dialog?.window?.run {
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(R.color.background)
decorView.setPadding(0, 0, 0, 0)
val attr = attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
attributes = attr
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
}

@ -34,9 +34,9 @@ class ClickActionConfigDialog : BaseDialogFragment(R.layout.dialog_click_action_
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.setBackgroundDrawableResource(R.color.transparent)
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
dialog?.window?.run {
setBackgroundDrawableResource(R.color.transparent)
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
}
}

@ -28,15 +28,15 @@ class MoreConfigDialog : DialogFragment() {
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
dialog?.window?.run {
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(R.color.background)
decorView.setPadding(0, 0, 0, 0)
val attr = attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 360.dp)
attributes = attr
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, 360.dp)
}
}

@ -14,7 +14,6 @@ import io.legado.app.base.BasePreferenceFragment
import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.data.appDb
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.SelectItem
import io.legado.app.lib.theme.backgroundColor
import io.legado.app.lib.theme.primaryColor
@ -27,10 +26,9 @@ class ReadAloudConfigDialog : DialogFragment() {
override fun onStart() {
super.onStart()
val dm = requireActivity().windowSize
dialog?.window?.let {
it.setBackgroundDrawableResource(R.color.transparent)
it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT)
dialog?.window?.run {
setBackgroundDrawableResource(R.color.transparent)
setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
}
}

@ -32,15 +32,15 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
dialog?.window?.run {
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(R.color.background)
decorView.setPadding(0, 0, 0, 0)
val attr = attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
attributes = attr
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
}

@ -35,15 +35,15 @@ class ReadStyleDialog : BaseDialogFragment(R.layout.dialog_read_book_style),
override fun onStart() {
super.onStart()
dialog?.window?.let {
it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
it.setBackgroundDrawableResource(R.color.background)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
dialog?.window?.run {
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(R.color.background)
decorView.setPadding(0, 0, 0, 0)
val attr = attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
attributes = attr
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
}

@ -27,10 +27,7 @@ class BookmarkDialog() : BaseDialogFragment(R.layout.dialog_bookmark) {
override fun onStart() {
super.onStart()
setLayout(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -23,10 +23,7 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config
override fun onStart() {
super.onStart()
setLayout(
0.9f,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -19,10 +19,7 @@ class DirectLinkUploadConfig : BaseDialogFragment(R.layout.dialog_direct_link_up
override fun onStart() {
super.onStart()
setLayout(
0.9f,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(0.9f, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -33,10 +33,7 @@ class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login) {
override fun onStart() {
super.onStart()
setLayout(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

@ -130,10 +130,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference
override fun onStart() {
super.onStart()
setLayout(
0.8f,
ViewGroup.LayoutParams.WRAP_CONTENT
)
setLayout(0.8f, ViewGroup.LayoutParams.WRAP_CONTENT)
}
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {

Loading…
Cancel
Save