From 9c47a79b4d5ca88fb3035e7f5722270d05715136 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 17 Nov 2020 19:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/config/AutoReadDialog.kt | 2 +- .../io/legado/app/ui/book/read/config/BgTextConfigDialog.kt | 2 +- .../legado/app/ui/book/read/config/ClickActionConfigDialog.kt | 2 +- .../java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt | 2 +- .../java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt | 2 +- .../java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt index 9ec107b92..e67dc8752 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt @@ -21,7 +21,6 @@ class AutoReadDialog : BaseDialogFragment() { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.setBackgroundDrawableResource(R.color.background) @@ -44,6 +43,7 @@ class AutoReadDialog : BaseDialogFragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ callBack = activity as? CallBack return inflater.inflate(R.layout.dialog_auto_read, container) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt index 99b8db65d..4e9a166a2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt @@ -50,7 +50,6 @@ class BgTextConfigDialog : BaseDialogFragment(), FilePickerDialog.CallBack { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.setBackgroundDrawableResource(R.color.background) @@ -68,6 +67,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FilePickerDialog.CallBack { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ return inflater.inflate(R.layout.dialog_read_bg_text, container) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ClickActionConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ClickActionConfigDialog.kt index 30608a1f8..ef0cc69cb 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ClickActionConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ClickActionConfigDialog.kt @@ -23,7 +23,6 @@ class ClickActionConfigDialog : BaseDialogFragment() { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.setBackgroundDrawableResource(R.color.transparent) it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) @@ -35,6 +34,7 @@ class ClickActionConfigDialog : BaseDialogFragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ return inflater.inflate(R.layout.dialog_click_action_config, container) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt index b920e1784..897895b09 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt @@ -25,7 +25,6 @@ class MoreConfigDialog : DialogFragment() { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.setBackgroundDrawableResource(R.color.background) @@ -43,6 +42,7 @@ class MoreConfigDialog : DialogFragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ val view = LinearLayout(context) view.setBackgroundColor(requireContext().bottomBackground) view.id = R.id.tag1 diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt index a7020fb98..11ecd6c6a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt @@ -26,7 +26,6 @@ class ReadAloudDialog : BaseDialogFragment() { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.setBackgroundDrawableResource(R.color.background) @@ -49,6 +48,7 @@ class ReadAloudDialog : BaseDialogFragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ callBack = activity as? CallBack return inflater.inflate(R.layout.dialog_read_aloud, container) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt index 7184c9384..b17f82cca 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt @@ -35,7 +35,6 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack { override fun onStart() { super.onStart() - (activity as ReadBookActivity).bottomDialog++ dialog?.window?.let { it.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) it.setBackgroundDrawableResource(R.color.background) @@ -53,6 +52,7 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack { container: ViewGroup?, savedInstanceState: Bundle? ): View? { + (activity as ReadBookActivity).bottomDialog++ return inflater.inflate(R.layout.dialog_read_book_style, container) }