Browse Source

Add CoverEditorDialog.onViewCreated to make setting attribute at correct time

Wayne 6 years ago
parent
commit
2408e72e19

+ 6 - 0
src/main/java/com/bomostory/sceneeditmodule/cover/CoverEditorDialog.kt

@@ -19,6 +19,7 @@ class CoverEditorDialog : DialogFragment() {
 
     private val dialogTag = this::class.java.simpleName
 
+    lateinit var onViewCreated: Runnable
     var onSave: View.OnClickListener? = null
     var onCancel: View.OnClickListener? = null
     var storyName: String
@@ -94,6 +95,11 @@ class CoverEditorDialog : DialogFragment() {
         }
     }
 
+    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+        super.onViewCreated(view, savedInstanceState)
+        onViewCreated.run()
+    }
+
     fun show(manager: FragmentManager?) {
         manager?.apply {
             val ft = beginTransaction()