Explorar el Código

Support category

Wayne hace 6 años
padre
commit
3068746efa

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

@@ -50,6 +50,13 @@ class CoverEditorDialog : DialogFragment() {
         set(value) {
             backCoverEditorView_coverEditorDialog.selectedColor = value
         }
+    var category: Category
+        get() {
+            return frontCoverEditorView_coverEditorDialog.category
+        }
+        set(value) {
+            frontCoverEditorView_coverEditorDialog.category = value
+        }
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
         return inflater.inflate(R.layout.dialog_cover_editor, container, false).apply {

+ 9 - 1
src/main/java/com/bomostory/sceneeditmodule/cover/FrontCoverEditorView.kt

@@ -36,7 +36,15 @@ class FrontCoverEditorView @JvmOverloads constructor(
         set(value) {
             et_frontCoverEditor_author.setText(value)
         }
-    var category: Category = Category.Daily
+    var category: Category
+        get() {
+            val position = spinner_frontCoverEditor_category.selectedItemPosition
+            return Category.values()[position]
+        }
+        set(value) {
+            val position = value.ordinal
+            spinner_frontCoverEditor_category.setSelection(position)
+        }
 
     init {
         View.inflate(context, R.layout.view_front_cover_editor, this)