faterhenry пре 6 година
родитељ
комит
76d50564d2

+ 17 - 53
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -11,6 +11,7 @@ import android.support.v7.app.AppCompatActivity
 import android.support.v7.widget.LinearLayoutManager
 import android.support.v7.widget.RecyclerView
 import android.util.DisplayMetrics
+import android.util.Log
 import android.view.*
 import android.widget.PopupWindow
 import android.widget.SeekBar
@@ -84,6 +85,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     private val audioRecorder = AudioRecorder()
     companion object {
         const val PHOTO_FROM_GALLERY = 1
+        const val ACTOR_FROM_BRUSH = 2
         const val LAYER_MANAGEMENT = "layer_management"
         const val ACTOR_HEIGHT = 400
         const val ACTOR_WIDTH = 400
@@ -92,7 +94,6 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         const val ACTOR_INIT_POSITION_X = 200
         const val ACTOR_INIT_POSITION_Y = 200
         const val BACKGROUND_MOVE_RATE = 32
-        const val BRUSH_SIZE = 16
         const val TIME_STEP_FOR_FPS = 33L
         val listeners = CopyOnWriteArrayList<Runnable>()
     }
@@ -302,7 +303,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
             initActorRecyclerView()
         })
         navigationBarView.setonClickBrushBtn(View.OnClickListener {
-            startActivity(Intent(this,DrawActivity::class.java))
+            initBrushView()
         })
         navigationBarView.setonClickDialogueBtn(View.OnClickListener {
             initDialogueView()
@@ -350,61 +351,15 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         return popupView
     }
     private fun initBrushView(){
-        if (navigationBar.getChildAt(0) is BrushView) {
-            navigationBar.removeAllViews()
-            startRecord.visibility = View.VISIBLE
-            return
-        }
         if (currentLayerIndex == 6){
             switchLayer(0)
             initBrushView()
-        }
-        startRecord.visibility = View.INVISIBLE
-        viewContainer.removeAllViews()
-        navigationBar.removeAllViews()
-        var brushView = BrushView(this)
-        brushView.setColorListener(this)
-        navigationBar.addView(brushView)
-        brushView.gravity = Gravity.CENTER_HORIZONTAL
-        brushView.layoutParams.width = monitorSize.widthPixels
-        var initBrush = Brush().apply {
-            brushSize = BRUSH_SIZE
-            brushColor = DialogueColorData.colorMap[1]
-            brushType = 0
-        }
-        brushView.setBrush(initBrush, object : SeekBar.OnSeekBarChangeListener{
-            override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-                brushView.tv_brush_view_size.text = "Size: " + p1.toString() + "px"
-                var brush = paint_view.brush
-                brush.brushSize = p1
-                paint_view.brush = brush
-            }
-            override fun onStartTrackingTouch(p0: SeekBar?) {
-            }
-            override fun onStopTrackingTouch(p0: SeekBar?) {
-            }
-        })
-        brushView.setOnDoneClick(View.OnClickListener {
-            navigationBar.removeAllViews()
-            paint_view.visibility = View.INVISIBLE
-            startRecord.visibility = View.VISIBLE
-            //initNavigationBarView(currentSceneIndex)
-            navigationBar.removeAllViews()
-            initNavigationFunction()
-            FileUtils.saveBitmapForActor(this, project, paint_view.bitmap, System.currentTimeMillis().toString())
-            project.story?.let {
-                it.scenes?.let{
-                    sceneEditView.scene = it[currentSceneIndex]
-                }
+        } else {
+            var intent = Intent(this, DrawActivity::class.java).apply {
+                putExtra("project", Gson().toJson(project))
             }
-        })
-        paint_view.init()
-        paint_view.layoutParams.width = monitorSize.widthPixels
-        paint_view.layoutParams.height = monitorSize.widthPixels.div(2)
-        paint_view.bringToFront()
-        paint_view.visibility = View.VISIBLE
-        paint_view.setOnTouchListener(paint_view)
-        paint_view.brush = initBrush
+            startActivityForResult(intent, ACTOR_FROM_BRUSH)
+        }
     }
 
     private fun initActorRecyclerView() {
@@ -1363,6 +1318,15 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                     Activity.RESULT_CANCELED -> {
                     }
                 }
+            ACTOR_FROM_BRUSH -> {
+                when (resultCode) {
+                    Activity.RESULT_OK -> if (data != null) {
+                        addActor(ACTOR_INIT_POSITION_X, ACTOR_INIT_POSITION_Y, data.getStringExtra("brush_bitmap"))
+                    }
+                    Activity.RESULT_CANCELED -> {
+                    }
+                }
+            }
         }
     }
 

+ 79 - 102
src/main/java/com/bomostory/sceneeditmodule/navigationbar/brush/BrushView.kt

@@ -28,108 +28,11 @@ class BrushView : LinearLayout {
 
     private fun initView() {
         LayoutInflater.from(context).inflate(R.layout.scene_brush_view, this, true)
-        iv_brush_view_color1.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[1]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color1.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color2.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[2]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color2.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color3.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[3]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color3.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color4.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[4]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color4.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color5.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[5]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color5.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color6.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[6]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color6.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color7.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[7]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color7.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color8.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[8]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color8.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color9.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[9]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color9.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_color10.setOnClickListener {
-            initColorState()
-            brush?.brushColor = DialogueColorData.colorMap[10]
-            listener?.onSelectBrush(brush)
-            iv_brush_view_color10.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
-        }
-        iv_brush_view_brush1.setOnClickListener {
-            initBrushState()
-            iv_brush_view_brush1.alpha = 1f
-            brush?.brushType = 0
-            listener?.onSelectBrush(brush)
-        }
-        iv_brush_view_brush2.setOnClickListener {
-            initBrushState()
-            iv_brush_view_brush2.alpha = 1f
-        }
-        iv_brush_view_brush3.setOnClickListener {
-            initBrushState()
-            iv_brush_view_brush3.alpha = 1f
-        }
-        iv_brush_view_brush4.setOnClickListener {
-            initBrushState()
-            iv_brush_view_brush4.alpha = 1f
-        }
-        iv_brush_view_brush5.setOnClickListener {
-            initBrushState()
-            iv_brush_view_brush5.alpha = 1f
-            brush?.brushType = 4
-            listener?.onSelectBrush(brush)
-        }
-    }
-
-    fun setBrush(brush: Brush, onSeekBarChangeListener: SeekBar.OnSeekBarChangeListener){
-        this.brush = brush
-        tv_brush_view_size.text = "Size: " + brush.brushSize.toString() + "px"
-        seek_bar_brush_view_size.progress = brush.brushSize
-        seek_bar_brush_view_size.setOnSeekBarChangeListener(onSeekBarChangeListener)
-    }
-
-    fun setOnDoneClick(onClickListener: OnClickListener){
-        btn_brush_view_done.setOnClickListener(onClickListener)
-    }
-
-    fun setColorListener(onSelectColor: OnSelectBrush){
-        listener = onSelectColor
-    }
-
-    private fun initColorState(){
+        setColor1()
+        setBrush1()
+    }
+
+    fun initColorState(){
         iv_brush_view_color1.background = null
         iv_brush_view_color2.background = null
         iv_brush_view_color3.background = null
@@ -142,6 +45,55 @@ class BrushView : LinearLayout {
         iv_brush_view_color10.background = null
     }
 
+    fun setColor1(){
+        initColorState()
+        iv_brush_view_color1.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor2(){
+        initColorState()
+        iv_brush_view_color2.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor3(){
+        initColorState()
+        iv_brush_view_color3.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor4(){
+        initColorState()
+        iv_brush_view_color4.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor5(){
+        initColorState()
+        iv_brush_view_color5.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor6(){
+        initColorState()
+        iv_brush_view_color6.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor7(){
+        initColorState()
+        iv_brush_view_color7.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor8(){
+        initColorState()
+        iv_brush_view_color8.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
+    fun setColor9(){
+        initColorState()
+        iv_brush_view_color9.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+    fun setColor10(){
+        initColorState()
+        iv_brush_view_color10.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+    }
+
     private fun initBrushState(){
         iv_brush_view_brush1.alpha = 0.7f
         iv_brush_view_brush2.alpha = 0.7f
@@ -150,6 +102,31 @@ class BrushView : LinearLayout {
         iv_brush_view_brush5.alpha = 0.7f
     }
 
+    fun setBrush1(){
+        initBrushState()
+        iv_brush_view_brush1.alpha = 1.0f
+    }
+
+    fun setBrush2(){
+        initBrushState()
+        iv_brush_view_brush2.alpha = 1.0f
+    }
+
+    fun setBrush3(){
+        initBrushState()
+        iv_brush_view_brush3.alpha = 1.0f
+    }
+
+    fun setBrush4(){
+        initBrushState()
+        iv_brush_view_brush4.alpha = 1.0f
+    }
+
+    fun setBrush5(){
+        initBrushState()
+        iv_brush_view_brush5.alpha = 1.0f
+    }
+
     interface OnSelectBrush{
         fun onSelectBrush(brush: Brush?)
     }

+ 168 - 64
src/main/java/com/bomostory/sceneeditmodule/screen/draw/DrawActivity.kt

@@ -1,21 +1,33 @@
 package com.bomostory.sceneeditmodule.screen.draw
 
+import android.app.Activity
 import android.arch.lifecycle.Observer
 import android.arch.lifecycle.ViewModelProviders
+import android.content.Intent
 import android.graphics.Color
-import android.graphics.drawable.ColorDrawable
 import android.support.v7.app.AppCompatActivity
 import android.os.Bundle
+import android.view.Gravity
+import android.view.LayoutInflater
 import android.view.View
+import android.view.ViewGroup
+import android.widget.PopupWindow
 import android.widget.SeekBar
+import com.bomostory.sceneeditmodule.basicdata.Project
+import com.bomostory.sceneeditmodule.utils.FileUtils
 import com.example.tfat.myapplication.R
+import com.google.gson.Gson
 import com.kdanmobile.kdanbrushlib.model.KdanBrush
 import com.kdanmobile.kdanbrushlib.widget.DrawView
 import kotlinx.android.synthetic.main.activity_draw.*
+import kotlinx.android.synthetic.main.popupview_set_color.view.*
+import kotlinx.android.synthetic.main.scene_brush_view.view.*
 
-class DrawActivity : AppCompatActivity() {
+class DrawActivity : AppCompatActivity() , FileUtils.OnSaveActorImage{
     private lateinit var viewModel: DrawViewModel
     private lateinit var drawView: DrawView
+    private lateinit var popupView: View
+    private var popupWindow = PopupWindow()
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -27,18 +39,27 @@ class DrawActivity : AppCompatActivity() {
         drawViewLayout.addView(drawView)
 
         //TODO change button to your widget
-        pencil.setOnClickListener(this::onClickPencil)
-        crayon.setOnClickListener(this::onClickCrayon)
-        pen.setOnClickListener(this::onClickPen)
-        chineseBrush.setOnClickListener(this::onClickChineseBrush)
-        eraser.setOnClickListener(this::onClickEraser)
+        brush_view.iv_brush_view_brush1.setOnClickListener(this::onClickPencil)
+        brush_view.iv_brush_view_brush2.setOnClickListener(this::onClickCrayon)
+        brush_view.iv_brush_view_brush3.setOnClickListener(this::onClickPen)
+        brush_view.iv_brush_view_brush4.setOnClickListener(this::onClickChineseBrush)
+        brush_view.iv_brush_view_brush5.setOnClickListener(this::onClickEraser)
 
         //TODO change button to your widget
-        color1.setOnClickListener(this::onColor1Selected)
-        color2.setOnClickListener(this::onColor2Selected)
-        color3.setOnClickListener(this::onColor3Selected)
-
-        brushSizeSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+        brush_view.iv_brush_view_color1.setOnClickListener(this::onColor1Selected)
+        brush_view.iv_brush_view_color2.setOnClickListener(this::onColor2Selected)
+        brush_view.iv_brush_view_color3.setOnClickListener(this::onColor3Selected)
+        brush_view.iv_brush_view_color4.setOnClickListener(this::onColor4Selected)
+        brush_view.iv_brush_view_color5.setOnClickListener(this::onColor5Selected)
+        brush_view.iv_brush_view_color6.setOnClickListener(this::onColor6Selected)
+        brush_view.iv_brush_view_color7.setOnClickListener(this::onColor7Selected)
+        brush_view.iv_brush_view_color8.setOnClickListener(this::onColor8Selected)
+        brush_view.iv_brush_view_color9.setOnClickListener(this::onColor9Selected)
+        brush_view.iv_brush_view_color10.setOnClickListener(this::onColor10Selected)
+        brush_view.btn_brush_view_tune.setOnClickListener(this::onTuneSelected)
+        brush_view.btn_brush_view_done.setOnClickListener(this::onDoneClick)
+
+        brush_view.seek_bar_brush_view_size.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 if (fromUser) onBrushSizeChanged(progress)
             }
@@ -46,82 +67,114 @@ class DrawActivity : AppCompatActivity() {
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}
             override fun onStopTrackingTouch(seekBar: SeekBar?) {}
         })
-        colorRValue.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
-            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
-                if (fromUser) onColorRValueChanged(progress)
-            }
-
-            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
-            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
-        })
-        colorGValue.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
-            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
-                if (fromUser) onColorGValueChanged(progress)
-            }
-
-            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
-            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
-
-        })
-        colorBValue.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
-            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
-                if (fromUser) onColorBValueChanged(progress)
-            }
-
-            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
-            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
-
-        })
-        colorAValue.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
-            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
-                if (fromUser) onColorAValueChanged(progress)
-            }
-
-            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
-            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
-
-        })
-
         viewModel.initBrush(drawView)
         viewModel.initColor(resources)
         viewModel.currentBrushLiveData.observe(this, Observer(this::onBrushChanged))
         viewModel.currentColorIndexLiveData.observe(this, Observer(this::onColorIndexChanged))
-        viewModel.color1LiveData.observe(this, Observer(this::onColor1Changed))
-        viewModel.color2LiveData.observe(this, Observer(this::onColor2Changed))
-        viewModel.color3LiveData.observe(this, Observer(this::onColor3Changed))
+//        viewModel.color1LiveData.observe(this, Observer(this::onColor1Changed))
+//        viewModel.color2LiveData.observe(this, Observer(this::onColor2Changed))
+//        viewModel.color3LiveData.observe(this, Observer(this::onColor3Changed))
         viewModel.selectPencil()
+        popupView = LayoutInflater.from(this).inflate(R.layout.popupview_set_color, null)
     }
 
     private fun onClickPencil(view: View) {
         viewModel.selectPencil()
+        brush_view.setBrush1()
     }
 
     private fun onClickCrayon(view: View) {
         viewModel.selectCrayon()
+        brush_view.setBrush2()
     }
 
     private fun onClickPen(view: View) {
         viewModel.selectPen()
+        brush_view.setBrush3()
     }
 
     private fun onClickChineseBrush(view: View) {
         viewModel.selectChineseBrush()
+        brush_view.setBrush4()
     }
 
     private fun onClickEraser(view: View) {
         viewModel.selectEraser()
+        brush_view.setBrush5()
     }
 
     private fun onColor1Selected(view: View?) {
         viewModel.selectColor(0)
+        brush_view.setColor1()
+        popupWindow.dismiss()
     }
 
     private fun onColor2Selected(view: View?) {
         viewModel.selectColor(1)
+        brush_view.setColor2()
+        popupWindow.dismiss()
     }
 
     private fun onColor3Selected(view: View?) {
         viewModel.selectColor(2)
+        brush_view.setColor3()
+        popupWindow.dismiss()
+    }
+
+    private fun onColor4Selected(view: View?) {
+        viewModel.selectColor(3)
+        brush_view.setColor4()
+        popupWindow.dismiss()
+    }
+
+    private fun onColor5Selected(view: View?) {
+        viewModel.selectColor(4)
+        brush_view.setColor5()
+        popupWindow.dismiss()
+    }
+
+    private fun onColor6Selected(view: View?) {
+        viewModel.selectColor(5)
+        brush_view.setColor6()
+    }
+
+    private fun onColor7Selected(view: View?) {
+        viewModel.selectColor(6)
+        brush_view.setColor7()
+        popupWindow.dismiss()
+    }
+
+    private fun onColor8Selected(view: View?) {
+        viewModel.selectColor(7)
+        brush_view.setColor8()
+        popupWindow.dismiss()
+    }
+
+    private fun onColor9Selected(view: View?) {
+        viewModel.selectColor(8)
+        brush_view.setColor9()
+    }
+
+    private fun onColor10Selected(view: View?) {
+        viewModel.selectColor(9)
+        brush_view.setColor10()
+        popupWindow.dismiss()
+    }
+
+    private fun onTuneSelected(view: View?){
+        popupWindow.dismiss()
+        viewModel.selectColor(10)
+        brush_view.initColorState()
+        popupWindow.contentView = createPopupView()
+        popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
+        popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
+        popupWindow.isOutsideTouchable = false
+        var valueXInPixels = resources.getDimension(R.dimen.popup_view_set_color_height)
+        popupWindow.showAsDropDown(brush_view, 0, -valueXInPixels.toInt(), Gravity.RIGHT)
+    }
+
+    private fun onDoneClick(view: View?) {
+        FileUtils.saveBitmapForActor(this, Gson().fromJson<Project>(intent.getStringExtra("project"), Project::class.java), drawView.drawerBitmap, System.currentTimeMillis().toString())
     }
 
     private fun onBrushSizeChanged(brushSize: Int) {
@@ -132,12 +185,12 @@ class DrawActivity : AppCompatActivity() {
         kdanBrush?.apply {
             drawView.brush = this
 
-            brushSize.text = "${this.radius.value}"
-            brushSizeSeekBar.max = this.radius.max
-            colorRValue.progress = Color.red(this.color)
-            colorGValue.progress = Color.green(this.color)
-            colorBValue.progress = Color.blue(this.color)
-            colorAValue.progress = Color.alpha(this.color)
+            brush_view.tv_brush_view_size.text = "${"Size :"}${this.radius.value}"
+            brush_view.seek_bar_brush_view_size.max = this.radius.max
+            popupView.sb_set_color_r.progress = Color.red(this.color)
+            popupView.sb_set_color_g.progress = Color.green(this.color)
+            popupView.sb_set_color_b.progress = Color.blue(this.color)
+            popupView.sb_set_color_a.progress = Color.alpha(this.color)
         }
     }
 
@@ -161,15 +214,66 @@ class DrawActivity : AppCompatActivity() {
         viewModel.setColorAValue(colorAValue)
     }
 
-    private fun onColor1Changed(colorDrawable: ColorDrawable?) {
-        color1.background = colorDrawable
-    }
+//    private fun onColor1Changed(colorDrawable: ColorDrawable?) {
+//        color1.background = colorDrawable
+//    }
+//
+//    private fun onColor2Changed(colorDrawable: ColorDrawable?) {
+//        color2.background = colorDrawable
+//    }
+//
+//    private fun onColor3Changed(colorDrawable: ColorDrawable?) {
+//        color3.background = colorDrawable
+//    }
+
+    private fun createPopupView(): View{
+
+        popupView.sb_set_color_r.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                if (fromUser) onColorRValueChanged(progress)
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
+            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
+        })
 
-    private fun onColor2Changed(colorDrawable: ColorDrawable?) {
-        color2.background = colorDrawable
+        popupView.sb_set_color_g.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                if (fromUser) onColorGValueChanged(progress)
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
+            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
+
+        })
+
+        popupView.sb_set_color_b.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                if (fromUser) onColorBValueChanged(progress)
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
+            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
+
+        })
+
+        popupView.sb_set_color_a.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+            override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                if (fromUser) onColorAValueChanged(progress)
+            }
+
+            override fun onStartTrackingTouch(seekBar: SeekBar?) {}
+            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
+
+        })
+        return popupView
     }
 
-    private fun onColor3Changed(colorDrawable: ColorDrawable?) {
-        color3.background = colorDrawable
+    override fun onSaveActorImage(filePath: String) {
+        var intent = Intent().apply {
+            putExtra("brush_bitmap", filePath)
+        }
+        this.setResult(Activity.RESULT_OK, intent)
+        this.finish()
     }
 }

+ 69 - 60
src/main/java/com/bomostory/sceneeditmodule/screen/draw/DrawViewModel.kt

@@ -32,6 +32,14 @@ class DrawViewModel : ViewModel() {
     private var mColor1LiveData = MutableLiveData<ColorDrawable>()
     private var mColor2LiveData = MutableLiveData<ColorDrawable>()
     private var mColor3LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor4LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor5LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor6LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor7LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor8LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor9LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor10LiveData = MutableLiveData<ColorDrawable>()
+    private var mColor11LiveData = MutableLiveData<ColorDrawable>()
 
     private lateinit var pencilBrush: PencilBrush
     private lateinit var crayonBrush: CrayonBrush
@@ -54,6 +62,14 @@ class DrawViewModel : ViewModel() {
         mColor1LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor1, null))
         mColor2LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor2, null))
         mColor3LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor3, null))
+        mColor4LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor4, null))
+        mColor5LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor5, null))
+        mColor6LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor6, null))
+        mColor7LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor7, null))
+        mColor8LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor8, null))
+        mColor9LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor9, null))
+        mColor10LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor10, null))
+        mColor11LiveData.value = ColorDrawable(ResourcesCompat.getColor(resource, R.color.defaultColor9, null))
         mCurrentColorIndexLiveData.value = 0
     }
 
@@ -97,24 +113,13 @@ class DrawViewModel : ViewModel() {
         var colorDrawable: ColorDrawable? = null
 
         when (mCurrentColorIndexLiveData.value) {
-            0 -> {
-                mColor1LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), rValue, Color.green(it.color), Color.blue(it.color)))
-                }
-                mColor1LiveData.value = colorDrawable
-            }
-            1 -> {
-                mColor2LiveData.value?.let {
+            10 -> {
+                mColor11LiveData.value?.let {
                     colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), rValue, Color.green(it.color), Color.blue(it.color)))
                 }
-                mColor2LiveData.value = colorDrawable
-            }
-            2 -> {
-                mColor3LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), rValue, Color.green(it.color), Color.blue(it.color)))
-                }
-                mColor3LiveData.value = colorDrawable
+                mColor11LiveData.value = colorDrawable
             }
+
         }
         
         setBrushColor(currentColorIndexLiveData.value)
@@ -124,23 +129,11 @@ class DrawViewModel : ViewModel() {
         var colorDrawable: ColorDrawable? = null
 
         when (mCurrentColorIndexLiveData.value) {
-            0 -> {
-                mColor1LiveData.value?.let {
+            10 -> {
+                mColor11LiveData.value?.let {
                     colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), gValue, Color.blue(it.color)))
                 }
-                mColor1LiveData.value = colorDrawable
-            }
-            1 -> {
-                mColor2LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), gValue, Color.blue(it.color)))
-                }
-                mColor2LiveData.value = colorDrawable
-            }
-            2 -> {
-                mColor3LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), gValue, Color.blue(it.color)))
-                }
-                mColor3LiveData.value = colorDrawable
+                mColor11LiveData.value = colorDrawable
             }
         }
 
@@ -151,23 +144,11 @@ class DrawViewModel : ViewModel() {
         var colorDrawable: ColorDrawable? = null
 
         when (mCurrentColorIndexLiveData.value) {
-            0 -> {
-                mColor1LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), Color.green(it.color), bValue))
-                }
-                mColor1LiveData.value = colorDrawable
-            }
-            1 -> {
-                mColor2LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), Color.green(it.color), bValue))
-                }
-                mColor2LiveData.value = colorDrawable
-            }
-            2 -> {
-                mColor3LiveData.value?.let {
+            10 -> {
+                mColor11LiveData.value?.let {
                     colorDrawable = ColorDrawable(Color.argb(Color.alpha(it.color), Color.red(it.color), Color.green(it.color), bValue))
                 }
-                mColor3LiveData.value = colorDrawable
+                mColor11LiveData.value = colorDrawable
             }
         }
 
@@ -178,23 +159,11 @@ class DrawViewModel : ViewModel() {
         var colorDrawable: ColorDrawable? = null
 
         when (mCurrentColorIndexLiveData.value) {
-            0 -> {
-                mColor1LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(aValue, Color.red(it.color), Color.green(it.color), Color.blue(it.color)))
-                }
-                mColor1LiveData.value = colorDrawable
-            }
-            1 -> {
-                mColor2LiveData.value?.let {
-                    colorDrawable = ColorDrawable(Color.argb(aValue, Color.red(it.color), Color.green(it.color), Color.blue(it.color)))
-                }
-                mColor2LiveData.value = colorDrawable
-            }
-            2 -> {
-                mColor3LiveData.value?.let {
+            10 -> {
+                mColor11LiveData.value?.let {
                     colorDrawable = ColorDrawable(Color.argb(aValue, Color.red(it.color), Color.green(it.color), Color.blue(it.color)))
                 }
-                mColor3LiveData.value = colorDrawable
+                mColor11LiveData.value = colorDrawable
             }
         }
 
@@ -227,6 +196,46 @@ class DrawViewModel : ViewModel() {
                     color = it.color
                 }
             }
+            3 -> {
+                mColor4LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            4 -> {
+                mColor5LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            5 -> {
+                mColor6LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            6 -> {
+                mColor7LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            7 -> {
+                mColor8LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            8 -> {
+                mColor9LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            9 -> {
+                mColor10LiveData.value?.let {
+                    color = it.color
+                }
+            }
+            10 -> {
+                mColor11LiveData.value?.let {
+                    color = it.color
+                }
+            }
         }
 
         color?.let {

+ 162 - 140
src/main/res/layout/activity_draw.xml

@@ -16,147 +16,169 @@
             android:layout_height="match_parent" />
     </RelativeLayout>
 
-    <Button
-        android:id="@+id/pencil"
+    <com.bomostory.sceneeditmodule.navigationbar.brush.BrushView
+        android:id="@+id/brush_view"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="@string/pencil"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent" />
-
-    <Button
-        android:id="@+id/crayon"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/crayon"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/pencil" />
-
-    <Button
-        android:id="@+id/pen"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/pen"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/crayon" />
-
-    <Button
-        android:id="@+id/chineseBrush"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/chinese_brush"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/pen" />
-
-    <Button
-        android:id="@+id/eraser"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/eraser"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/chineseBrush" />
-
-    <TextView
-        android:id="@+id/brushSize"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/eraser" />
-
-    <SeekBar
-        android:id="@+id/brushSizeSeekBar"
-        android:layout_width="240dp"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toTopOf="@+id/brushSize"
-        app:layout_constraintLeft_toRightOf="@+id/eraser" />
-
-    <Button
-        android:id="@+id/color1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/brushSizeSeekBar" />
-
-    <Button
-        android:id="@+id/color2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/color1" />
-
-    <Button
-        android:id="@+id/color3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toRightOf="@+id/color2" />
-
-    <SeekBar
-        android:id="@+id/colorRValue"
-        android:layout_width="128dp"
-        android:layout_height="wrap_content"
-        android:max="255"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/r"
-        app:layout_constraintBottom_toBottomOf="@id/colorRValue"
-        app:layout_constraintRight_toLeftOf="@+id/colorRValue"
-        app:layout_constraintTop_toTopOf="@id/colorRValue" />
-
-    <SeekBar
-        android:id="@+id/colorGValue"
-        android:layout_width="128dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="25dp"
-        android:max="255"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/colorRValue" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/g"
-        app:layout_constraintBottom_toBottomOf="@id/colorGValue"
-        app:layout_constraintRight_toLeftOf="@id/colorGValue"
-        app:layout_constraintTop_toTopOf="@+id/colorGValue" />
-
-    <SeekBar
-        android:id="@+id/colorBValue"
-        android:layout_width="128dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="25dp"
-        android:max="255"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/colorGValue" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/b"
-        app:layout_constraintBottom_toBottomOf="@id/colorBValue"
-        app:layout_constraintRight_toLeftOf="@id/colorBValue"
-        app:layout_constraintTop_toTopOf="@id/colorBValue" />
-
-    <SeekBar
-        android:id="@+id/colorAValue"
-        android:layout_width="128dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="25dp"
-        android:max="255"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/colorBValue" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/a"
-        app:layout_constraintBottom_toBottomOf="@id/colorAValue"
-        app:layout_constraintRight_toLeftOf="@id/colorAValue"
-        app:layout_constraintTop_toTopOf="@id/colorAValue" />
+        app:layout_constraintBottom_toBottomOf="parent">
+    </com.bomostory.sceneeditmodule.navigationbar.brush.BrushView>
+    <!--<ImageView-->
+        <!--android:id="@+id/pencil"-->
+        <!--android:layout_width="36dp"-->
+        <!--android:layout_height="48dp"-->
+        <!--android:layout_marginLeft="24dp"-->
+        <!--android:scaleType="fitXY"-->
+        <!--android:src="@drawable/ic_brush_1"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toLeftOf="parent" />-->
+
+    <!--<ImageView-->
+        <!--android:id="@+id/crayon"-->
+        <!--android:layout_width="36dp"-->
+        <!--android:layout_height="72dp"-->
+        <!--android:layout_marginLeft="16dp"-->
+        <!--android:scaleType="fitXY"-->
+        <!--android:src="@drawable/ic_brush_2"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/pencil" />-->
+
+    <!--<ImageView-->
+        <!--android:id="@+id/pen"-->
+        <!--android:layout_width="36dp"-->
+        <!--android:layout_height="48dp"-->
+        <!--android:layout_marginLeft="16dp"-->
+        <!--android:scaleType="fitXY"-->
+        <!--android:src="@drawable/ic_brush_3"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/crayon" />-->
+
+    <!--<ImageView-->
+        <!--android:id="@+id/chineseBrush"-->
+        <!--android:layout_width="36dp"-->
+        <!--android:layout_height="48dp"-->
+        <!--android:layout_marginLeft="16dp"-->
+        <!--android:scaleType="fitXY"-->
+        <!--android:src="@drawable/ic_brush_4"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/pen" />-->
+
+    <!--<ImageView-->
+        <!--android:id="@+id/eraser"-->
+        <!--android:layout_width="36dp"-->
+        <!--android:layout_height="48dp"-->
+        <!--android:layout_marginLeft="16dp"-->
+        <!--android:scaleType="fitXY"-->
+        <!--android:src="@drawable/ic_brush_eraser"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/chineseBrush" />-->
+
+    <!--<TextView-->
+        <!--android:id="@+id/brushSize"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/eraser" />-->
+
+    <!--<SeekBar-->
+        <!--android:id="@+id/brushSizeSeekBar"-->
+        <!--android:layout_width="240dp"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toTopOf="@+id/brushSize"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/eraser" />-->
+
+    <!--<Button-->
+        <!--android:id="@+id/color1"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/brushSizeSeekBar" />-->
+
+    <!--<Button-->
+        <!--android:id="@+id/color2"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/color1" />-->
+
+    <!--<Button-->
+        <!--android:id="@+id/color3"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/color2" />-->
+    <!--<Button-->
+        <!--android:id="@+id/done"-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintLeft_toRightOf="@+id/color3" />-->
+
+    <!--<SeekBar-->
+        <!--android:id="@+id/colorRValue"-->
+        <!--android:layout_width="128dp"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:max="255"-->
+        <!--app:layout_constraintBottom_toBottomOf="parent"-->
+        <!--app:layout_constraintRight_toRightOf="parent"-->
+        <!--app:layout_constraintTop_toTopOf="parent" />-->
+
+    <!--<TextView-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:text="@string/r"-->
+        <!--app:layout_constraintBottom_toBottomOf="@id/colorRValue"-->
+        <!--app:layout_constraintRight_toLeftOf="@+id/colorRValue"-->
+        <!--app:layout_constraintTop_toTopOf="@id/colorRValue" />-->
+
+    <!--<SeekBar-->
+        <!--android:id="@+id/colorGValue"-->
+        <!--android:layout_width="128dp"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:layout_marginTop="25dp"-->
+        <!--android:max="255"-->
+        <!--app:layout_constraintRight_toRightOf="parent"-->
+        <!--app:layout_constraintTop_toBottomOf="@+id/colorRValue" />-->
+
+    <!--<TextView-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:text="@string/g"-->
+        <!--app:layout_constraintBottom_toBottomOf="@id/colorGValue"-->
+        <!--app:layout_constraintRight_toLeftOf="@id/colorGValue"-->
+        <!--app:layout_constraintTop_toTopOf="@+id/colorGValue" />-->
+
+    <!--<SeekBar-->
+        <!--android:id="@+id/colorBValue"-->
+        <!--android:layout_width="128dp"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:layout_marginTop="25dp"-->
+        <!--android:max="255"-->
+        <!--app:layout_constraintRight_toRightOf="parent"-->
+        <!--app:layout_constraintTop_toBottomOf="@+id/colorGValue" />-->
+
+    <!--<TextView-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:text="@string/b"-->
+        <!--app:layout_constraintBottom_toBottomOf="@id/colorBValue"-->
+        <!--app:layout_constraintRight_toLeftOf="@id/colorBValue"-->
+        <!--app:layout_constraintTop_toTopOf="@id/colorBValue" />-->
+
+    <!--<SeekBar-->
+        <!--android:id="@+id/colorAValue"-->
+        <!--android:layout_width="128dp"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:layout_marginTop="25dp"-->
+        <!--android:max="255"-->
+        <!--app:layout_constraintRight_toRightOf="parent"-->
+        <!--app:layout_constraintTop_toBottomOf="@+id/colorBValue" />-->
+
+    <!--<TextView-->
+        <!--android:layout_width="wrap_content"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:text="@string/a"-->
+        <!--app:layout_constraintBottom_toBottomOf="@id/colorAValue"-->
+        <!--app:layout_constraintRight_toLeftOf="@id/colorAValue"-->
+        <!--app:layout_constraintTop_toTopOf="@id/colorAValue" />-->
 
 </android.support.constraint.ConstraintLayout>

+ 8 - 4
src/main/res/layout/popupview_set_color.xml

@@ -28,7 +28,8 @@
         <android.support.v7.widget.AppCompatSeekBar
             android:id="@+id/sb_set_color_r"
             android:layout_width="128dp"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            android:max="255"/>
         <TextView
             android:id="@+id/tv_set_color_r"
             android:layout_width="wrap_content"
@@ -52,7 +53,8 @@
         <android.support.v7.widget.AppCompatSeekBar
             android:id="@+id/sb_set_color_g"
             android:layout_width="128dp"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            android:max="255"/>
         <TextView
             android:id="@+id/tv_set_color_g"
             android:layout_width="wrap_content"
@@ -76,7 +78,8 @@
         <android.support.v7.widget.AppCompatSeekBar
             android:id="@+id/sb_set_color_b"
             android:layout_width="128dp"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            android:max="255"/>
         <TextView
             android:id="@+id/tv_set_color_b"
             android:layout_width="wrap_content"
@@ -100,7 +103,8 @@
         <android.support.v7.widget.AppCompatSeekBar
             android:id="@+id/sb_set_color_a"
             android:layout_width="128dp"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            android:max="255"/>
         <TextView
             android:id="@+id/tv_set_color_a"
             android:layout_width="wrap_content"

+ 0 - 3
src/main/res/layout/scene_brush_view.xml

@@ -25,7 +25,6 @@
         android:scaleType="fitXY"
         android:src="@drawable/ic_brush_2"
         android:alpha="0.7"
-        android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_brush1"
         app:layout_constraintRight_toLeftOf="@+id/iv_brush_view_brush3" />
@@ -38,7 +37,6 @@
         android:scaleType="fitXY"
         android:src="@drawable/ic_brush_3"
         android:alpha="0.7"
-        android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_brush2"
         app:layout_constraintRight_toLeftOf="@+id/iv_brush_view_brush4" />
@@ -51,7 +49,6 @@
         android:scaleType="fitXY"
         android:src="@drawable/ic_brush_4"
         android:alpha="0.7"
-        android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_brush3"
         app:layout_constraintRight_toLeftOf="@+id/iv_brush_view_brush5" />

+ 7 - 0
src/main/res/values/colors.xml

@@ -9,6 +9,13 @@
     <color name="defaultColor1">#d0021b</color>
     <color name="defaultColor2">#f5a623</color>
     <color name="defaultColor3">#f8e71c</color>
+    <color name="defaultColor4">#ffecb3</color>
+    <color name="defaultColor5">#417505</color>
+    <color name="defaultColor6">#bd10e0</color>
+    <color name="defaultColor7">#9013fe</color>
+    <color name="defaultColor8">#4a90e2</color>
+    <color name="defaultColor9">#000000</color>
+    <color name="defaultColor10">#ffffff</color>
 
     <color name="black_overlay">#66000000</color>
 </resources>