Prechádzať zdrojové kódy

dialog_mirror_color_actor_opacity

faterhenry 6 rokov pred
rodič
commit
56b57ade2c

+ 53 - 0
src/main/java/com/bomostory/sceneeditmodule/DialogueColorData.kt

@@ -0,0 +1,53 @@
+package com.bomostory.sceneeditmodule
+
+import com.example.tfat.myapplication.R
+import java.util.HashMap
+
+object DialogueColorData {
+    val dialogMap =  HashMap<Pair<Int,Int>,Int>().apply {
+        put(Pair(0,0),R.drawable.ic_speechbubble_w1)
+        put(Pair(0,1),R.drawable.ic_speechbubble_y1)
+        put(Pair(0,2),R.drawable.ic_speechbubble_b1)
+        put(Pair(0,3),R.drawable.ic_speechbubble_g1)
+        put(Pair(0,4),R.drawable.ic_speechbubble_r1)
+        put(Pair(1,0),R.drawable.ic_speechbubble_w2)
+        put(Pair(1,1),R.drawable.ic_speechbubble_y2)
+        put(Pair(1,2),R.drawable.ic_speechbubble_b2)
+        put(Pair(1,3),R.drawable.ic_speechbubble_g2)
+        put(Pair(1,4),R.drawable.ic_speechbubble_r2)
+        put(Pair(2,0),R.drawable.ic_speechbubble_w3)
+        put(Pair(2,1),R.drawable.ic_speechbubble_y3)
+        put(Pair(2,2),R.drawable.ic_speechbubble_b3)
+        put(Pair(2,3),R.drawable.ic_speechbubble_g3)
+        put(Pair(2,4),R.drawable.ic_speechbubble_r3)
+        put(Pair(3,0),R.drawable.ic_speechbubble_w4)
+        put(Pair(3,1),R.drawable.ic_speechbubble_y4)
+        put(Pair(3,2),R.drawable.ic_speechbubble_b4)
+        put(Pair(3,3),R.drawable.ic_speechbubble_g4)
+        put(Pair(3,4),R.drawable.ic_speechbubble_r4)
+        put(Pair(4,0),R.drawable.ic_speechbubble_w5)
+        put(Pair(4,1),R.drawable.ic_speechbubble_y5)
+        put(Pair(4,2),R.drawable.ic_speechbubble_b5)
+        put(Pair(4,3),R.drawable.ic_speechbubble_g5)
+        put(Pair(4,4),R.drawable.ic_speechbubble_r5)
+        put(Pair(5,0),R.drawable.ic_speechbubble_w6)
+        put(Pair(5,1),R.drawable.ic_speechbubble_y6)
+        put(Pair(5,2),R.drawable.ic_speechbubble_b6)
+        put(Pair(5,3),R.drawable.ic_speechbubble_g6)
+        put(Pair(5,4),R.drawable.ic_speechbubble_r6)
+        put(Pair(6,0),R.drawable.ic_speechbubble_w7)
+        put(Pair(6,1),R.drawable.ic_speechbubble_y7)
+        put(Pair(6,2),R.drawable.ic_speechbubble_b7)
+        put(Pair(6,3),R.drawable.ic_speechbubble_g7)
+        put(Pair(6,4),R.drawable.ic_speechbubble_r7)
+    }
+
+    fun getDialogColorType(resource: Int) : Pair<Int,Int>{
+        for (i in 0 until 7){
+            for(j in 0 until 5){
+                if (resource == dialogMap[Pair(i,j)]) return Pair(i,j)
+            }
+        }
+        return  Pair(0,0)
+    }
+}

+ 16 - 3
src/main/java/com/bomostory/sceneeditmodule/DialogueDrawer.kt

@@ -7,6 +7,9 @@ import android.graphics.drawable.VectorDrawable
 import android.support.v4.content.ContextCompat
 import com.bomostory.sceneeditmodule.basicdata.Actor
 import com.example.tfat.myapplication.R
+import android.graphics.Bitmap
+
+
 
 object DialogueDrawer {
     fun drawDialogue(context:Context, data: Actor): Bitmap? {
@@ -27,9 +30,19 @@ object DialogueDrawer {
             var bitmap = BitmapFactory.decodeResource(context.resources, mResId)
             canvas?.drawBitmap(bitmap,0f,0f, null)
         } else if (drawable is VectorDrawable) {
-            canvas?.drawBitmap( getBitmap(data,drawable),null, RectF(valuePaddingInPixels, valuePaddingInPixels,
-                    data.sideLength.toFloat() - valuePaddingInPixels,
-                    data.sideHeight.toFloat() - valuePaddingInPixels), null)
+            var bitmap = getBitmap(data,drawable)
+            if(data.isMirror) {
+                val matrix = Matrix()
+                matrix.postScale(-1f, 1f)
+                val new2 = Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true)
+                canvas?.drawBitmap(new2, null, RectF(valuePaddingInPixels, valuePaddingInPixels,
+                        data.sideLength.toFloat() - valuePaddingInPixels,
+                        data.sideHeight.toFloat() - valuePaddingInPixels), null)
+            } else {
+                canvas?.drawBitmap(bitmap, null, RectF(valuePaddingInPixels, valuePaddingInPixels,
+                        data.sideLength.toFloat() - valuePaddingInPixels,
+                        data.sideHeight.toFloat() - valuePaddingInPixels), null)
+            }
         } else {
             throw IllegalArgumentException("unsupported drawable type")
         }

+ 151 - 4
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -37,8 +37,13 @@ import com.example.tfat.myapplication.navigationbar.RecordFinishView
 import io.reactivex.android.schedulers.AndroidSchedulers
 import io.reactivex.schedulers.Schedulers
 import kotlinx.android.synthetic.main.layer_management_fragment.*
+import kotlinx.android.synthetic.main.popupview_opacity_dialog.view.*
 import kotlinx.android.synthetic.main.view_control_dialogue_dialog.view.*
 import java.util.concurrent.CopyOnWriteArrayList
+import android.widget.SeekBar
+import com.bomostory.sceneeditmodule.DialogueColorData
+import kotlinx.android.synthetic.main.popupview_color_dialog.view.*
+
 
 class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener, EditActorView.OnActorChangeListener,
         OnTouchBoMoSceneListener.OnSceneMoveListener, DialogInterface.OnDismissListener, FileUtils.OnSaveActorImage,
@@ -60,8 +65,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     companion object {
         const val PHOTO_FROM_GALLERY = 1
         const val LAYER_MANAGEMENT = "layer_management"
-        const val ACTOR_HEIGHT = 200
-        const val ACTOR_WIDTH = 200
+        const val ACTOR_HEIGHT = 400
+        const val ACTOR_WIDTH = 400
         const val DIALOGUE_HEIGHT = 320
         const val DIALOGUE_WIDTH = 400
         const val ACTOR_INIT_POSITION_X = 200
@@ -574,6 +579,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 dialog.parentLayerIndex = currentLayerIndex
                 dialog.isMovable = true
                 dialog.isDialogue = true
+                dialog.dialogType = DialogueColorData.getDialogColorType(resource).first
+                dialog.dialogColor = DialogueColorData.getDialogColorType(resource).second
                 it[currentSceneIndex].layers[currentLayerIndex].actors.add(dialog)
                 sceneEditView.scene = it[currentSceneIndex]
             }
@@ -627,7 +634,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         sceneEditView.setLayerVisible(currentLayerIndex)
         var popupWindow = PopupWindow(this)
         popupWindow.contentView = when(actor.isDialogue) { true -> createDialogPopupView(actor, popupWindow)
-                                                            false -> createActorPopupView(actor, popupWindow)}
+                                                           false -> createActorPopupView(actor, popupWindow)}
         popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
         popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
         popupWindow.isOutsideTouchable = true
@@ -656,6 +663,46 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 }
             }
         }
+        popupView.opacity.setOnClickListener {
+            popupWindow.dismiss()
+            var popupWindow = PopupWindow(this)
+            var popupView = LayoutInflater.from(this).inflate(R.layout.popupview_opacity_dialog, null)
+            popupWindow.contentView = popupView
+            popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
+            popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
+            popupWindow.isOutsideTouchable = false
+            popupWindow.showAtLocation(sceneEditView, Gravity.START,actor.positionX,0)
+            popupView.sb_opacity_dialog_opacity.progress = (actor.opacity * 100).toInt()
+            popupView.tv_opacity_dialog_opacity.text = "Opacity : " + (actor.opacity * 100).toInt().toString() + "%"
+            popupView.sb_opacity_dialog_opacity.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
+                override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
+                    popupView.tv_opacity_dialog_opacity.text = "Opacity : " + p1.toString() + "%"
+                    project.story?.let {
+                        it.scenes?.let {
+                            it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].opacity = p1.toFloat().div(100)
+                            sceneEditView.scene = it[currentSceneIndex]
+                        }
+                    }
+                }
+                override fun onStartTrackingTouch(p0: SeekBar?) {
+                }
+                override fun onStopTrackingTouch(p0: SeekBar?) {
+                }
+            })
+            popupView.tv_opacity_dialog_ok.setOnClickListener {
+                popupWindow.dismiss()
+            }
+        }
+        popupView.Mirror.setOnClickListener {
+            project.story?.let {
+                it.scenes?.let {
+                    it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].isMirror =
+                            !it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].isMirror
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
         popupView.bring_to_front.setOnClickListener{
             project.story?.let {
                 it.scenes?.let {
@@ -719,6 +766,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                         textColor = actor.textColor
                         textAlign =  actor.textAlign
                         isDialogue = actor.isDialogue
+                        opacity = actor.opacity
                     }
                     it[currentSceneIndex].layers[currentLayerIndex].actors.add(actorData)
                     setActorPositionZ(it[currentSceneIndex].layers[currentLayerIndex].actors)
@@ -727,6 +775,106 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 }
             }
         }
+        popupView.Mirror_dialogue.setOnClickListener {
+            project.story?.let {
+                it.scenes?.let {
+                    it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].isMirror =
+                            !it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].isMirror
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        popupView.layout_dialogue_dialog_color.setOnClickListener {
+            popupWindow.dismiss()
+            var popupWindow = PopupWindow(this)
+            var popupView = LayoutInflater.from(this).inflate(R.layout.popupview_color_dialog, null)
+            when (actor.dialogColor){
+                0 -> popupView.iv_dialogue_set_color_white.setImageResource(R.drawable.ic_done)
+                1 -> popupView.iv_dialogue_set_color_yellow.setImageResource(R.drawable.ic_done)
+                2 -> popupView.iv_dialogue_set_color_blue.setImageResource(R.drawable.ic_done)
+                3 -> popupView.iv_dialogue_set_color_green.setImageResource(R.drawable.ic_done)
+                4 -> popupView.iv_dialogue_set_color_orange.setImageResource(R.drawable.ic_done)
+            }
+            popupView.iv_dialogue_set_color_white.setOnClickListener {
+                popupView.iv_dialogue_set_color_white.setImageResource(R.drawable.ic_done)
+                popupView.iv_dialogue_set_color_blue.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_yellow.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_green.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_orange.setImageDrawable(null)
+                project.story?.let {
+                    it.scenes?.let {
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].resourcePath = DialogueColorData.dialogMap[Pair(actor.dialogType,0)].toString()
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].dialogColor = 0
+                        sceneEditView.scene = it[currentSceneIndex]
+                    }
+                }
+            }
+            popupView.iv_dialogue_set_color_blue.setOnClickListener {
+                popupView.iv_dialogue_set_color_white.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_blue.setImageResource(R.drawable.ic_done)
+                popupView.iv_dialogue_set_color_yellow.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_green.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_orange.setImageDrawable(null)
+                project.story?.let {
+                    it.scenes?.let {
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].resourcePath = DialogueColorData.dialogMap[Pair(actor.dialogType,2)].toString()
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].dialogColor = 2
+                        sceneEditView.scene = it[currentSceneIndex]
+                    }
+                }
+            }
+            popupView.iv_dialogue_set_color_yellow.setOnClickListener {
+                popupView.iv_dialogue_set_color_white.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_blue.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_yellow.setImageResource(R.drawable.ic_done)
+                popupView.iv_dialogue_set_color_green.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_orange.setImageDrawable(null)
+                project.story?.let {
+                    it.scenes?.let {
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].resourcePath = DialogueColorData.dialogMap[Pair(actor.dialogType,1)].toString()
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].dialogColor = 1
+                        sceneEditView.scene = it[currentSceneIndex]
+                    }
+                }
+            }
+            popupView.iv_dialogue_set_color_green.setOnClickListener {
+                popupView.iv_dialogue_set_color_white.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_blue.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_yellow.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_green.setImageResource(R.drawable.ic_done)
+                popupView.iv_dialogue_set_color_orange.setImageDrawable(null)
+                project.story?.let {
+                    it.scenes?.let {
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].resourcePath = DialogueColorData.dialogMap[Pair(actor.dialogType,3)].toString()
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].dialogColor = 3
+                        sceneEditView.scene = it[currentSceneIndex]
+                    }
+                }
+            }
+            popupView.iv_dialogue_set_color_orange.setOnClickListener {
+                popupView.iv_dialogue_set_color_white.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_blue.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_yellow.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_green.setImageDrawable(null)
+                popupView.iv_dialogue_set_color_orange.setImageResource(R.drawable.ic_done)
+                project.story?.let {
+                    it.scenes?.let {
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].resourcePath = DialogueColorData.dialogMap[Pair(actor.dialogType,4)].toString()
+                        it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].dialogColor = 4
+                        sceneEditView.scene = it[currentSceneIndex]
+                    }
+                }
+            }
+            popupView.tv_color_dialog_ok.setOnClickListener {
+                popupWindow.dismiss()
+            }
+            popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
+            popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
+            popupWindow.contentView = popupView
+            popupWindow.isOutsideTouchable = false
+            popupWindow.showAtLocation(sceneEditView, Gravity.START,actor.positionX,0)
+        }
         popupView.bring_to_front_dialogue.setOnClickListener{
             project.story?.let {
                 it.scenes?.let {
@@ -864,7 +1012,6 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     }
 
     override fun onLayerManagementDialog(layerNum: Int, position: Int) {
-        //var actor = Actor()
         val selectLayer = layerNum - 1
         project.story?.let {
             it.scenes?.let {

+ 15 - 0
src/main/java/com/bomostory/sceneeditmodule/ViewUtils.kt

@@ -0,0 +1,15 @@
+package com.bomostory.sceneeditmodule
+
+import android.view.View
+import android.view.ViewGroup
+
+object ViewUtils {
+    fun makeDropDownMeasureSpec(measureSpec: Int): Int {
+        val mode = if (measureSpec == ViewGroup.LayoutParams.WRAP_CONTENT) {
+            View.MeasureSpec.UNSPECIFIED
+        } else {
+            View.MeasureSpec.EXACTLY
+        }
+        return View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(measureSpec), mode)
+    }
+}

+ 4 - 0
src/main/java/com/bomostory/sceneeditmodule/basicdata/Actor.kt

@@ -16,4 +16,8 @@ open class Actor {
     var textColor = "#000000"
     var textAlign = Paint.Align.LEFT
     var isDialogue = false
+    var isMirror = false
+    var opacity = 1.0f
+    var dialogColor = 0
+    var dialogType = 0
 }

+ 5 - 3
src/main/java/com/bomostory/sceneeditmodule/screen/view/ActorView.kt

@@ -14,10 +14,12 @@ class ActorView : ImageView {
         set(value) {
             field = value
             value?.let {
-                if(!it.isDialogue){
-                    setImageDrawable(Drawable.createFromPath(it.resourcePath))
+                if(!it.isDialogue) setImageDrawable(Drawable.createFromPath(it.resourcePath))
+                if (it.isMirror && !it.isDialogue) {
+                    this.scaleX = -1f
+                    this.scaleY = 1f
                 }
-
+                this.alpha = it.opacity
             }
         }
     constructor(context: Context) : super(context)

+ 8 - 9
src/main/java/com/bomostory/sceneeditmodule/screen/view/DialogueView.kt

@@ -58,15 +58,6 @@ class DialogueView : EditActorView{
         }
     }
 
-    private fun getBitmap(vectorDrawable: VectorDrawable): Bitmap {
-        val bitmap = Bitmap.createBitmap(dialogue.sideLength,
-                dialogue.sideHeight, Bitmap.Config.ARGB_8888)
-        val canvas = Canvas(bitmap)
-        vectorDrawable.setBounds(0, 0, canvas.width, canvas.height)
-        vectorDrawable.draw(canvas)
-        return bitmap
-    }
-
     private fun actorOnTouchListener() : View.OnTouchListener {
         var clickPeriod = 0L
         var positionStart = 0
@@ -148,6 +139,8 @@ class DialogueView : EditActorView{
                         parentLayerIndex = dialogue.parentLayerIndex
                         isMovable = dialogue.isMovable
                         isDialogue = dialogue.isDialogue
+                        isMirror = dialogue.isMirror
+                        opacity = actor.opacity
                     }
                     dialogue = dialogueData
                 }
@@ -199,6 +192,8 @@ class DialogueView : EditActorView{
                         parentLayerIndex = dialogue.parentLayerIndex
                         isMovable = dialogue.isMovable
                         isDialogue = dialogue.isDialogue
+                        isMirror = dialogue.isMirror
+                        opacity = actor.opacity
                     }
                     dialogue = dialogueData
                 }
@@ -250,6 +245,8 @@ class DialogueView : EditActorView{
                         parentLayerIndex = dialogue.parentLayerIndex
                         isMovable = dialogue.isMovable
                         isDialogue = dialogue.isDialogue
+                        isMirror = dialogue.isMirror
+                        opacity = actor.opacity
                     }
                     dialogue = dialogueData
                 }
@@ -297,6 +294,8 @@ class DialogueView : EditActorView{
                         parentLayerIndex = dialogue.parentLayerIndex
                         isMovable = dialogue.isMovable
                         isDialogue = dialogue.isDialogue
+                        isMirror = dialogue.isMirror
+                        opacity = actor.opacity
                     }
                     dialogue = dialogueData
                 }

+ 1 - 4
src/main/java/com/bomostory/sceneeditmodule/screen/view/EditActorView.kt

@@ -1,9 +1,7 @@
 package com.bomostory.sceneeditmodule.screen.view
 
 import android.content.Context
-import android.graphics.Canvas
-import android.graphics.Color
-import android.graphics.DashPathEffect
+import android.graphics.*
 import android.util.AttributeSet
 import android.view.LayoutInflater
 import android.view.MotionEvent
@@ -11,7 +9,6 @@ import android.view.View
 import android.widget.RelativeLayout
 import com.example.tfat.myapplication.R
 import kotlinx.android.synthetic.main.actor_view.view.*
-import android.graphics.Paint
 import com.bomostory.sceneeditmodule.basicdata.Actor
 
 

+ 5 - 0
src/main/res/drawable/bg_white_card_rounded_8.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/white" />
+    <corners android:radius="8dp" />
+</shape>

+ 20 - 0
src/main/res/drawable/btn_edit_dialog_color_blue.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle">
+
+            <solid
+                android:color="#73e4ff"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#000000" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_dialog_color_green.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle">
+
+            <solid
+                android:color="#b9ff73"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#000000" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_dialog_color_red.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle">
+
+            <solid
+                android:color="#ff9573"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#000000" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_dialog_color_white.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle">
+
+            <solid
+                android:color="#ffffff"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#000000" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_dialog_color_yellow.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape
+            xmlns:android="http://schemas.android.com/apk/res/android"
+            android:shape="rectangle">
+
+            <solid
+                android:color="#fff573"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#000000" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 42 - 0
src/main/res/drawable/ic_color_b.xml


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

@@ -37,16 +37,14 @@
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:src="@drawable/ic_opacity_b"
-            android:tint="@android:color/darker_gray"/>
+            android:src="@drawable/ic_opacity_b"/>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="24dp"
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:text="Opacity"
-            android:textColor="@android:color/darker_gray"/>
+            android:text="Opacity"/>
     </LinearLayout>
     <LinearLayout
         android:id="@+id/Mirror"
@@ -60,16 +58,14 @@
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:src="@drawable/ic_flip_b"
-            android:tint="@android:color/darker_gray"/>
+            android:src="@drawable/ic_flip_b"/>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="24dp"
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:text="Mirror"
-            android:textColor="@android:color/darker_gray"/>
+            android:text="Mirror"/>
     </LinearLayout>
     <LinearLayout
         android:id="@+id/bring_to_front"

+ 65 - 0
src/main/res/layout/popupview_color_dialog.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:background="@drawable/bg_white_card_rounded_8"
+    android:elevation="2dp">
+    <ImageView
+        android:id="@+id/iv_dialogue_set_color_white"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:background="@drawable/btn_edit_dialog_color_white"
+        android:layout_marginLeft="24dp"
+        android:layout_marginTop="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"/>
+    <ImageView
+        android:id="@+id/iv_dialogue_set_color_yellow"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:background="@drawable/btn_edit_dialog_color_yellow"
+        android:layout_marginLeft="24dp"
+        android:layout_marginTop="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toRightOf="@+id/iv_dialogue_set_color_white"/>
+    <ImageView
+        android:id="@+id/iv_dialogue_set_color_blue"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:background="@drawable/btn_edit_dialog_color_blue"
+        android:layout_marginLeft="24dp"
+        android:layout_marginTop="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toRightOf="@+id/iv_dialogue_set_color_yellow"/>
+    <ImageView
+        android:id="@+id/iv_dialogue_set_color_green"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:background="@drawable/btn_edit_dialog_color_green"
+        android:layout_marginLeft="24dp"
+        android:layout_marginTop="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toRightOf="@+id/iv_dialogue_set_color_blue"/>
+    <ImageView
+        android:id="@+id/iv_dialogue_set_color_orange"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:background="@drawable/btn_edit_dialog_color_red"
+        android:layout_marginLeft="24dp"
+        android:layout_marginTop="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toRightOf="@+id/iv_dialogue_set_color_green"/>
+    <TextView
+        android:id="@+id/tv_color_dialog_ok"
+        android:text="OK"
+        android:textSize="14sp"
+        android:textColor="#4e342e"
+        android:layout_width="64dp"
+        android:layout_height="36dp"
+        android:gravity="center_horizontal"
+        android:layout_marginTop="20dp"
+        android:layout_marginLeft="48dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toRightOf="@id/iv_dialogue_set_color_orange"/>
+</android.support.constraint.ConstraintLayout>

+ 35 - 0
src/main/res/layout/popupview_opacity_dialog.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="360dp"
+    android:layout_height="106dp"
+    android:background="@drawable/bg_white_card_rounded_8"
+    android:elevation="2dp">
+    <TextView
+        android:id="@+id/tv_opacity_dialog_opacity"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="24dp"
+        android:layout_marginLeft="24dp"
+        android:text="Opacity : 100%"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+    <android.support.v7.widget.AppCompatSeekBar
+        android:id="@+id/sb_opacity_dialog_opacity"
+        android:layout_width="268dp"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="10dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_opacity_dialog_opacity"/>
+    <TextView
+        android:id="@+id/tv_opacity_dialog_ok"
+        android:text="OK"
+        android:textSize="14sp"
+        android:textColor="#4e342e"
+        android:layout_marginBottom="10dp"
+        android:layout_width="64dp"
+        android:layout_height="36dp"
+        android:gravity="center_horizontal"
+        app:layout_constraintTop_toBottomOf="@+id/tv_opacity_dialog_opacity"
+        app:layout_constraintLeft_toRightOf="@id/sb_opacity_dialog_opacity"/>
+</android.support.constraint.ConstraintLayout>

+ 6 - 10
src/main/res/layout/view_control_dialogue_dialog.xml

@@ -47,7 +47,7 @@
             android:text="Duplicate"/>
     </LinearLayout>
     <LinearLayout
-        android:id="@+id/opacity_dialogue"
+        android:id="@+id/layout_dialogue_dialog_color"
         android:layout_width="160dp"
         android:layout_height="wrap_content"
         app:layout_constraintTop_toBottomOf="@+id/duplicate_dialogue"
@@ -58,22 +58,20 @@
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:src="@drawable/ic_opacity_b"
-            android:tint="@android:color/darker_gray"/>
+            android:src="@drawable/ic_color_b"/>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="24dp"
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:text="Opacity"
-            android:textColor="@android:color/darker_gray"/>
+            android:text="Color"/>
     </LinearLayout>
     <LinearLayout
         android:id="@+id/Mirror_dialogue"
         android:layout_width="160dp"
         android:layout_height="wrap_content"
-        app:layout_constraintTop_toBottomOf="@+id/opacity_dialogue"
+        app:layout_constraintTop_toBottomOf="@+id/layout_dialogue_dialog_color"
         android:orientation="horizontal">
         <ImageView
             android:layout_width="24dp"
@@ -81,16 +79,14 @@
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:src="@drawable/ic_flip_b"
-            android:tint="@android:color/darker_gray"/>
+            android:src="@drawable/ic_flip_b"/>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="24dp"
             android:layout_marginTop="20dp"
             android:layout_marginLeft="16dp"
             android:background="#ffffff"
-            android:text="Mirror"
-            android:textColor="@android:color/darker_gray"/>
+            android:text="Mirror"/>
     </LinearLayout>
     <LinearLayout
         android:id="@+id/bring_to_front_dialogue"