From 9f8a55a90229c123644c3e36819c0662076ffa3f Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 30 Nov 2019 20:38:27 +0800 Subject: [PATCH] up --- .../ui/book/read/config/BgTextConfigDialog.kt | 16 +++++------ .../ui/book/read/config/MoreConfigDialog.kt | 25 ++++++++--------- .../book/read/config/PaddingConfigDialog.kt | 16 +++++------ .../book/read/config/ReadAloudConfigDialog.kt | 24 ++++++++-------- .../ui/book/read/config/ReadStyleDialog.kt | 28 +++++++++---------- 5 files changed, 54 insertions(+), 55 deletions(-) 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 194e89daf..82e7113a0 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 @@ -43,14 +43,6 @@ class BgTextConfigDialog : DialogFragment() { private val resultSelectBg = 123 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() { super.onStart() 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?) { super.onViewCreated(view, savedInstanceState) initData() 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 61d2801f3..c1954a4e1 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 @@ -19,21 +19,8 @@ import io.legado.app.ui.book.read.Help import io.legado.app.utils.postEvent class MoreConfigDialog : DialogFragment() { - 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() { super.onStart() 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?) { super.onViewCreated(view, savedInstanceState) var preferenceFragment = childFragmentManager.findFragmentByTag(readPreferTag) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt index 43aeaad2d..fe04055e9 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt @@ -18,14 +18,6 @@ import org.jetbrains.anko.sdk27.listeners.onClick 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() { super.onStart() 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?) { super.onViewCreated(view, savedInstanceState) initData() diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt index 2b2d27eb4..0d066dd54 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt @@ -23,18 +23,6 @@ import io.legado.app.utils.postEvent class ReadAloudConfigDialog : DialogFragment() { 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() { super.onStart() 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?) { super.onViewCreated(view, savedInstanceState) var preferenceFragment = childFragmentManager.findFragmentByTag(readAloudPreferTag) 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 f88a7a0e7..822ca033c 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 @@ -28,20 +28,6 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick 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() { super.onStart() 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() { super.onDestroy() ReadBookConfig.save()