Forráskód Böngészése

feature_dialogView

faterhenry 6 éve
szülő
commit
853545806b
34 módosított fájl, 938 hozzáadás és 173 törlés
  1. 64 0
      src/main/java/com/bomostory/sceneeditmodule/DialogueDrawer.kt
  2. 103 0
      src/main/java/com/bomostory/sceneeditmodule/EditTextDialog.kt
  3. 2 2
      src/main/java/com/bomostory/sceneeditmodule/PdfMaker.kt
  4. 19 8
      src/main/java/com/bomostory/sceneeditmodule/SceneDrawer.kt
  5. 126 25
      src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt
  6. 35 33
      src/main/java/com/bomostory/sceneeditmodule/SuperMovieMaker.kt
  7. 9 3
      src/main/java/com/bomostory/sceneeditmodule/basicdata/Actor.kt
  8. 0 7
      src/main/java/com/bomostory/sceneeditmodule/basicdata/Dialogue.kt
  9. 2 4
      src/main/java/com/bomostory/sceneeditmodule/layermanagement/LayerAdapter.kt
  10. 4 4
      src/main/java/com/bomostory/sceneeditmodule/sceneview/SceneView1.kt
  11. 1 0
      src/main/java/com/bomostory/sceneeditmodule/screen/movie/MovieEditActivity.kt
  12. 16 9
      src/main/java/com/bomostory/sceneeditmodule/screen/view/ActorView.kt
  13. 68 65
      src/main/java/com/bomostory/sceneeditmodule/screen/view/DialogueView.kt
  14. 2 3
      src/main/java/com/bomostory/sceneeditmodule/screen/view/EditActorView.kt
  15. 3 5
      src/main/java/com/bomostory/sceneeditmodule/screen/view/LayerView.kt
  16. 4 1
      src/main/java/com/bomostory/sceneeditmodule/screen/view/MovieView.kt
  17. 4 4
      src/main/java/com/bomostory/sceneeditmodule/utils/FileUtils.kt
  18. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_black.xml
  19. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_blue.xml
  20. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_green.xml
  21. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_red.xml
  22. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_selected.xml
  23. 20 0
      src/main/res/drawable/btn_edit_text_dialog_circle_yellow.xml
  24. 10 0
      src/main/res/drawable/ic_aligncenter.xml
  25. 10 0
      src/main/res/drawable/ic_aligncenter_w.xml
  26. 10 0
      src/main/res/drawable/ic_alignleft.xml
  27. 10 0
      src/main/res/drawable/ic_alignleft_w.xml
  28. 10 0
      src/main/res/drawable/ic_alignright.xml
  29. 10 0
      src/main/res/drawable/ic_alignright_w.xml
  30. 10 0
      src/main/res/drawable/ic_bold.xml
  31. 10 0
      src/main/res/drawable/ic_tune.xml
  32. 115 0
      src/main/res/layout/dialogfragment_edit_text.xml
  33. 160 0
      src/main/res/layout/view_control_dialogue_dialog.xml
  34. 1 0
      src/main/res/values/dimens.xml

+ 64 - 0
src/main/java/com/bomostory/sceneeditmodule/DialogueDrawer.kt

@@ -0,0 +1,64 @@
+package com.bomostory.sceneeditmodule
+
+import android.content.Context
+import android.graphics.*
+import android.graphics.drawable.BitmapDrawable
+import android.graphics.drawable.VectorDrawable
+import android.support.v4.content.ContextCompat
+import com.bomostory.sceneeditmodule.basicdata.Actor
+import com.example.tfat.myapplication.R
+
+object DialogueDrawer {
+    fun drawDialogue(context:Context, data: Actor): Bitmap? {
+        val conf = Bitmap.Config.ARGB_8888
+        var dialogBitmap = Bitmap.createBitmap(data.sideLength, data.sideHeight, conf)
+        dialogBitmap = Bitmap.createScaledBitmap(dialogBitmap, data.sideLength, data.sideHeight, true)
+        val canvas = Canvas(dialogBitmap)
+        val textPaint = Paint()
+        textPaint.strokeWidth = 1f
+        textPaint.isAntiAlias = true
+        textPaint.color = Color.parseColor(data.textColor)
+        textPaint.textSize = 40f
+        textPaint.textAlign = data.textAlign
+        var mResId = data.resourcePath.toInt()
+        val drawable = ContextCompat.getDrawable(context, mResId)
+        var valuePaddingInPixels = context.resources.getDimension(R.dimen.edit_actor_padding)
+        if (drawable is BitmapDrawable) {
+            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)
+        } else {
+            throw IllegalArgumentException("unsupported drawable type")
+        }
+        val textPositionX: Float
+        val textPositionY: Float
+        when(data.textAlign){
+            Paint.Align.LEFT -> {
+                textPositionX = context.resources.getDimension(R.dimen.dialogue_padding)
+                textPositionY = data.sideHeight.div(2).toFloat()
+            }
+            Paint.Align.CENTER -> {
+                textPositionX = data.sideLength.div(2).toFloat()
+                textPositionY = data.sideHeight.div(2).toFloat()
+            }
+            Paint.Align.RIGHT -> {
+                textPositionX = data.sideLength - context.resources.getDimension(R.dimen.dialogue_padding)
+                textPositionY = data.sideHeight.div(2).toFloat()
+            }
+        }
+        canvas?.drawText(data.text, textPositionX,textPositionY, textPaint)
+    return dialogBitmap
+    }
+
+    private fun getBitmap(data: Actor, vectorDrawable: VectorDrawable): Bitmap {
+        val bitmap = Bitmap.createBitmap(data.sideLength,
+                data.sideHeight, Bitmap.Config.ARGB_8888)
+        val canvas = Canvas(bitmap)
+        vectorDrawable.setBounds(0, 0, canvas.width, canvas.height)
+        vectorDrawable.draw(canvas)
+        return bitmap
+    }
+}

+ 103 - 0
src/main/java/com/bomostory/sceneeditmodule/EditTextDialog.kt

@@ -0,0 +1,103 @@
+package com.bomostory.sceneeditmodule
+
+import android.content.DialogInterface
+import android.graphics.Paint
+import android.os.Bundle
+import android.support.v4.app.DialogFragment
+import android.support.v4.content.ContextCompat
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.view.Window
+import com.bomostory.sceneeditmodule.basicdata.Actor
+import com.example.tfat.myapplication.R
+import kotlinx.android.synthetic.main.dialogfragment_edit_text.view.*
+
+class EditTextDialog : DialogFragment() {
+    var onSetDialogFinish: OnSetDialogFinish? = null
+    lateinit var dialogueActor: Actor
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
+        return inflater.inflate(R.layout.dialogfragment_edit_text, container).apply {
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
+            btn_edit_dialog_done.setOnClickListener {
+                onSetDialogFinish?.onSetDialogText(dialogueActor, etv_text.text.toString())
+            }
+            iv_edit_text_red.setOnClickListener {
+                iv_edit_text_red.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+                iv_edit_text_yellow.background = null
+                iv_edit_text_blue.background = null
+                iv_edit_text_green.background = null
+                iv_edit_text_black.background = null
+                dialogueActor?.textColor = "#d0021b"
+            }
+            iv_edit_text_yellow.setOnClickListener {
+                iv_edit_text_red.background = null
+                iv_edit_text_yellow.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+                iv_edit_text_blue.background = null
+                iv_edit_text_green.background = null
+                iv_edit_text_black.background = null
+                dialogueActor?.textColor = "#f8e71c"
+            }
+            iv_edit_text_blue.setOnClickListener {
+                iv_edit_text_red.background = null
+                iv_edit_text_yellow.background = null
+                iv_edit_text_blue.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+                iv_edit_text_green.background = null
+                iv_edit_text_black.background = null
+                dialogueActor?.textColor = "#4a90e2"
+            }
+            iv_edit_text_green.setOnClickListener {
+                iv_edit_text_red.background = null
+                iv_edit_text_yellow.background = null
+                iv_edit_text_blue.background = null
+                iv_edit_text_green.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+                iv_edit_text_black.background = null
+                dialogueActor?.textColor = "#417505"
+            }
+            iv_edit_text_black.setOnClickListener {
+                iv_edit_text_red.background = null
+                iv_edit_text_yellow.background = null
+                iv_edit_text_blue.background = null
+                iv_edit_text_green.background = null
+                iv_edit_text_black.background = ContextCompat.getDrawable(context, R.drawable.btn_edit_text_dialog_circle_selected)
+                dialogueActor?.textColor = "#000000"
+            }
+            btn_edit_dialog_align_left.setOnClickListener {
+                btn_edit_dialog_align_left.setImageResource(R.drawable.ic_alignleft_w)
+                btn_edit_dialog_align_center.setImageResource(R.drawable.ic_aligncenter)
+                btn_edit_dialog_align_right.setImageResource(R.drawable.ic_alignright)
+                dialogueActor?.textAlign = Paint.Align.LEFT
+            }
+            btn_edit_dialog_align_center.setOnClickListener {
+                btn_edit_dialog_align_left.setImageResource(R.drawable.ic_alignleft)
+                btn_edit_dialog_align_center.setImageResource(R.drawable.ic_aligncenter_w)
+                btn_edit_dialog_align_right.setImageResource(R.drawable.ic_alignright)
+                dialogueActor?.textAlign = Paint.Align.CENTER
+            }
+            btn_edit_dialog_align_right.setOnClickListener {
+                btn_edit_dialog_align_left.setImageResource(R.drawable.ic_alignleft)
+                btn_edit_dialog_align_center.setImageResource(R.drawable.ic_aligncenter)
+                btn_edit_dialog_align_right.setImageResource(R.drawable.ic_alignright_w)
+                dialogueActor?.textAlign = Paint.Align.RIGHT
+            }
+        }
+    }
+
+    override fun onDismiss(dialog: DialogInterface?) {
+        super.onDismiss(dialog)
+        onSetDialogFinish?.onEditTextDialogDismiss()
+    }
+
+    fun setDialogue(dialogue: Actor){
+        this.dialogueActor = dialogue
+    }
+
+    fun setCallBack(onSetDialogFinish: OnSetDialogFinish){
+        this.onSetDialogFinish = onSetDialogFinish
+    }
+    interface OnSetDialogFinish{
+        fun onSetDialogText(dialogue: Actor, text: String)
+        fun onEditTextDialogDismiss()
+    }
+}

+ 2 - 2
src/main/java/com/bomostory/sceneeditmodule/PdfMaker.kt

@@ -24,7 +24,7 @@ object PdfMaker {
             emitter.onNext(progress++ / total)
             val standardPdfWriter = StandardPdfWriter(file, front, back)
             project.story?.scenes?.forEach {
-                val bitmap = SceneDrawer.drawScene(it, 0, width, height) ?: return@forEach
+                val bitmap = SceneDrawer.drawScene(context, it, 0, width, height) ?: return@forEach
                 standardPdfWriter.addImage(bitmap)
                 emitter.onNext(progress++ / total)
             }
@@ -51,7 +51,7 @@ object PdfMaker {
             /** pages **/
             val pdfBookWriter = PdfBookWriter(file, front, back)
             project.story?.scenes?.forEach {
-                val bitmap = SceneDrawer.drawScene(it, 0, width, height) ?: return@forEach
+                val bitmap = SceneDrawer.drawScene(context, it, 0, width, height) ?: return@forEach
                 pdfBookWriter.addImage(bitmap)
                 emitter.onNext(progress++ / total)
             }

+ 19 - 8
src/main/java/com/bomostory/sceneeditmodule/SceneDrawer.kt

@@ -1,14 +1,17 @@
 package com.bomostory.sceneeditmodule
 
+import android.content.Context
 import android.graphics.Bitmap
 import android.graphics.BitmapFactory
 import android.graphics.Canvas
 import android.graphics.Paint
+import android.graphics.drawable.VectorDrawable
 import com.bomostory.sceneeditmodule.basicdata.Scene
 import kotlin.math.pow
 
 object SceneDrawer {
-    fun drawScene(scene: Scene, trackX: Int, scaleWidth: Int, scaleHeight: Int): Bitmap? {
+    lateinit var actorBitmap: Bitmap
+    fun drawScene(context: Context, scene: Scene, trackX: Int, scaleWidth: Int, scaleHeight: Int): Bitmap? {
         var sceneBitmap: Bitmap? = null
 
         scene?.apply {
@@ -18,15 +21,23 @@ object SceneDrawer {
             val canvas = Canvas(sceneBitmap)
             for (layer in layers) {
                 for (actor in layer.actors) {
-                    var actorBitmap = BitmapFactory.decodeFile(actor.resourcePath)
-                    actorBitmap = Bitmap.createScaledBitmap(actorBitmap, actor.sideLength, actor.sideLength, true)
+                    if (!actor.isDialogue) {
+                        actorBitmap = BitmapFactory.decodeFile(actor.resourcePath)
+                        actorBitmap = Bitmap.createScaledBitmap(actorBitmap, actor.sideLength, actor.sideHeight, true)
 
-                    canvas.save()
-                    canvas.translate(trackX / 2f.pow(layers.indexOf(layer)), 0f)
-                    canvas.drawBitmap(actorBitmap, actor.positionX.toFloat(), actor.positionY.toFloat(), Paint())
-                    canvas.restore()
+                        canvas.save()
+                        canvas.translate(trackX / 2f.pow(layers.indexOf(layer)), 0f)
+                        canvas.drawBitmap(actorBitmap, actor.positionX.toFloat(), actor.positionY.toFloat(), Paint())
+                        canvas.restore()
+
+                        actorBitmap.recycle()
+                    } else {
+                        canvas.save()
+                        canvas.translate(trackX / 2f.pow(layers.indexOf(layer)), 0f)
+                        canvas?.drawBitmap(DialogueDrawer.drawDialogue(context, actor), actor.positionX.toFloat(), actor.positionY.toFloat(), null)
+                        canvas.restore()
+                    }
 
-                    actorBitmap.recycle()
                 }
             }
         }

+ 126 - 25
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -29,6 +29,7 @@ import kotlinx.android.synthetic.main.control_actor_dialog.view.*
 import com.bomostory.sceneeditmodule.utils.FileUtils
 import com.bomostory.sceneeditmodule.screen.view.LayerView
 import android.util.DisplayMetrics
+import com.bomostory.sceneeditmodule.EditTextDialog
 import com.bomostory.sceneeditmodule.screen.movie.MovieEditActivity
 import com.bomostory.sceneeditmodule.screen.view.OnTouchSceneListener
 import com.example.tfat.myapplication.navigationbar.EditSceneView
@@ -36,11 +37,12 @@ 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.view_control_dialogue_dialog.view.*
 import java.util.concurrent.CopyOnWriteArrayList
 
 class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener, EditActorView.OnActorChangeListener,
         OnTouchBoMoSceneListener.OnSceneMoveListener, DialogInterface.OnDismissListener, FileUtils.OnSaveActorImage,
-        OnTouchSceneListener.OnSceneTouchListener,LayerManagementDialog.OnLayerChange {
+        OnTouchSceneListener.OnSceneTouchListener,LayerManagementDialog.OnLayerChange, EditTextDialog.OnSetDialogFinish {
 
     private lateinit var project: Project
     private var currentSceneIndex = 0
@@ -53,6 +55,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     private lateinit var sceneAdapter: SceneAdapter
     private var isRecord = false
     private var layerManagementDialog = LayerManagementDialog()
+    private var editTextDialog = EditTextDialog()
     private val monitorSize = DisplayMetrics()
     companion object {
         const val PHOTO_FROM_GALLERY = 1
@@ -92,7 +95,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
             val pd = ProgressDialog(this).apply {
                 setCancelable(false)
             }
-            FileUtils.saveProject(project, 1920,1080)
+            FileUtils.saveProject(this, project, 1920,1080)
                     .subscribeOn(Schedulers.io())
                     .observeOn(AndroidSchedulers.mainThread())
                     .doOnSubscribe { pd.show() }
@@ -195,7 +198,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                         val pd = ProgressDialog(this).apply {
                                      setCancelable(false)
                                  }
-                    FileUtils.saveProject(project, 1920,1080)
+                    FileUtils.saveProject(this, project, 1920,1080)
                              .subscribeOn(Schedulers.io())
                              .observeOn(AndroidSchedulers.mainThread())
                              .doOnSubscribe { pd.show() }
@@ -435,11 +438,11 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                     when(it[currentSceneIndex].layers.indexOf(layer)) {
                         currentLayerIndex ->
                             for (actor in it[currentSceneIndex].layers[currentLayerIndex].actors) {
-                                actor.isMoveable = true
+                                actor.isMovable = true
                             }
                         else ->
                             for (actor in it[currentSceneIndex].layers[it[currentSceneIndex].layers.indexOf(layer)].actors) {
-                                actor.isMoveable = false
+                                actor.isMovable = false
                             }
                     }
                 }
@@ -463,7 +466,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
             it.scenes?.let {
                 for (layer in it[currentSceneIndex].layers) {
                     for (actor in layer.actors) {
-                        actor.isMoveable = false
+                        actor.isMovable = false
                         actor.isSelect = false
                     }
                 }
@@ -549,7 +552,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 actorData.sideHeight = ACTOR_HEIGHT
                 actorData.resourcePath = resourcePath
                 actorData.parentLayerIndex = currentLayerIndex
-                actorData.isMoveable = true
+                actorData.isMovable = true
                 it[currentSceneIndex].layers[currentLayerIndex].actors.add(actorData)
                 sceneEditView.scene = it[currentSceneIndex]
             }
@@ -561,15 +564,16 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     private fun addDialogue(positionX: Int, positionY: Int, resource: Int) {
         project.story?.let {
             it.scenes?.let{
-                val dialog = Dialogue()
-                dialog.resource = resource
+                val dialog = Actor()
+                dialog.resourcePath = resource.toString()
                 dialog.positionX = positionX
                 dialog.positionY = positionY
                 dialog.positionZ = it[currentSceneIndex].layers[currentLayerIndex].actors.size
                 dialog.sideLength = DIALOGUE_WIDTH
                 dialog.sideHeight = DIALOGUE_HEIGHT
                 dialog.parentLayerIndex = currentLayerIndex
-                dialog.isMoveable = true
+                dialog.isMovable = true
+                dialog.isDialogue = true
                 it[currentSceneIndex].layers[currentLayerIndex].actors.add(dialog)
                 sceneEditView.scene = it[currentSceneIndex]
             }
@@ -584,7 +588,6 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         project.story?.let {
             it.scenes?.let {
                 it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ] = actor
-                sceneEditView.scene = it[currentSceneIndex]
             }
         }
         sceneEditView.setLayerVisible(currentLayerIndex)
@@ -623,6 +626,15 @@ 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)}
+        popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
+        popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
+        popupWindow.isOutsideTouchable = true
+        popupWindow.showAtLocation(sceneEditView, Gravity.START,actor.positionX,actor.positionY)
+    }
+
+    private fun createActorPopupView(actor: Actor, popupWindow: PopupWindow): View{
         val popupView = LayoutInflater.from(this).inflate(R.layout.control_actor_dialog, null)
         popupView.duplicate.setOnClickListener{
             project.story?.let {
@@ -635,10 +647,10 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                         sideHeight = actor.sideHeight
                         resourcePath = actor.resourcePath
                         parentLayerIndex = currentLayerIndex
-                        isMoveable = true
+                        isMovable = true
                     }
                     it[currentSceneIndex].layers[currentLayerIndex].actors.add(actorData)
-                     setActorPositionZ(it[currentSceneIndex].layers[currentLayerIndex].actors)
+                    setActorPositionZ(it[currentSceneIndex].layers[currentLayerIndex].actors)
                     sceneEditView.scene = it[currentSceneIndex]
                     popupWindow.dismiss()
                 }
@@ -675,16 +687,81 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 }
             }
         }
-        popupWindow.contentView = popupView
-        popupWindow.width = ViewGroup.LayoutParams.WRAP_CONTENT
-        popupWindow.height = ViewGroup.LayoutParams.WRAP_CONTENT
-        popupWindow.isOutsideTouchable = true
-        popupWindow.showAtLocation(sceneEditView, Gravity.START,actor.positionX,actor.positionY)
+        return popupView
     }
 
-
+    private fun createDialogPopupView(actor: Actor, popupWindow: PopupWindow): View{
+        val popupView = LayoutInflater.from(this).inflate(R.layout.view_control_dialogue_dialog, null)
+        popupView.edit_content_dialogue.setOnClickListener{
+            project.story?.let {
+                it.scenes?.let {
+                    editTextDialog = EditTextDialog()
+                    editTextDialog.setCallBack(this)
+                    editTextDialog.setDialogue(actor)
+                    editTextDialog.show(supportFragmentManager,LAYER_MANAGEMENT)
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        popupView.duplicate_dialogue.setOnClickListener{
+            project.story?.let {
+                it.scenes?.let {
+                    val actorData = Actor().apply {
+                        positionX = actor.positionX + 100
+                        positionY = actor.positionY + 100
+                        positionZ = it[currentSceneIndex].layers[currentLayerIndex].actors.size
+                        sideLength = actor.sideLength
+                        sideHeight = actor.sideHeight
+                        resourcePath = actor.resourcePath
+                        parentLayerIndex = currentLayerIndex
+                        isMovable = true
+                        text = actor.text
+                        textColor = actor.textColor
+                        textAlign =  actor.textAlign
+                        isDialogue = actor.isDialogue
+                    }
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.add(actorData)
+                    setActorPositionZ(it[currentSceneIndex].layers[currentLayerIndex].actors)
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        popupView.bring_to_front_dialogue.setOnClickListener{
+            project.story?.let {
+                it.scenes?.let {
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.remove(actor)
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.add(actor)
+                    setActorPositionZ(it[currentLayerIndex].layers[currentLayerIndex].actors)
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        popupView.send_to_back_dialogue.setOnClickListener{
+            project.story?.let {
+                it.scenes?.let {
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.remove(actor)
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.add(0, actor)
+                    setActorPositionZ(it[currentLayerIndex].layers[currentLayerIndex].actors)
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        popupView.delete_dialogue.setOnClickListener{
+            project.story?.let {
+                it.scenes?.let {
+                    it[currentSceneIndex].layers[currentLayerIndex].actors.removeAt(actor.positionZ)
+                    sceneEditView.scene = it[currentSceneIndex]
+                    popupWindow.dismiss()
+                }
+            }
+        }
+        return popupView
+    }
     override fun onSceneMove(dX: Int) {
-        if ( (BACKGROUND_MOVE_RATE * 35) >= (swipeX + dX) && (swipeX + dX) > (-(BACKGROUND_MOVE_RATE * 35))) {
+        if ( (BACKGROUND_MOVE_RATE * monitorSize.widthPixels.div(BACKGROUND_MOVE_RATE * 2)) >= (swipeX + dX) && (swipeX + dX) > (-(BACKGROUND_MOVE_RATE * monitorSize.widthPixels.div(BACKGROUND_MOVE_RATE * 2)))) {
             sceneEditView.x = swipeX + dX
             if (isRecord) {
                 record?.tracks.let {
@@ -787,13 +864,12 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     }
 
     override fun onLayerManagementDialog(layerNum: Int, position: Int) {
-        var actor = Actor()
+        //var actor = Actor()
         val selectLayer = layerNum - 1
         project.story?.let {
             it.scenes?.let {
-                actor = it[currentSceneIndex].layers[selectLayer].actors[position]
-            }
-        }
+                var actor = it[currentSceneIndex].layers[selectLayer].actors[position]
+
         var popupWindow = PopupWindow(this)
         val popupView = LayoutInflater.from(this).inflate(R.layout.control_actor_dialog, null)
         popupView.duplicate.setOnClickListener{
@@ -807,7 +883,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                         sideHeight = actor.sideHeight
                         resourcePath = actor.resourcePath
                         parentLayerIndex = selectLayer
-                        isMoveable = true
+                        isMovable = true
                     }
                     it[currentSceneIndex].layers[selectLayer].actors.add(actorData)
                     setActorPositionZ(it[currentSceneIndex].layers[selectLayer].actors)
@@ -863,6 +939,31 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
             4 -> popupWindow.showAsDropDown(layerManagementDialog.rv_layer_management_layer1, valueXInPixels.toInt() * position, 0)
             5 -> popupWindow.showAsDropDown(layerManagementDialog.rv_layer_management_layer2, valueXInPixels.toInt() * position, 0)
         }
+            }
+        }
+    }
 
+    override fun onSetDialogText(dialogue: Actor, content: String) {
+        project.story?.let {
+            it.scenes?.let {
+                dialogue.text = content
+                it[currentSceneIndex].layers[currentLayerIndex].actors[dialogue.positionZ] = dialogue
+                setActorPositionZ(it[currentSceneIndex].layers[currentLayerIndex].actors)
+                sceneEditView.scene = it[currentSceneIndex]
+                editTextDialog.dismiss()
+            }
+        }
+    }
+
+    override fun onEditTextDialogDismiss() {
+        window.decorView.apply {
+            systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                    or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                    or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                    or View.SYSTEM_UI_FLAG_FULLSCREEN
+                    or View.SYSTEM_UI_FLAG_LOW_PROFILE
+                    or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
+        }
     }
 }

+ 35 - 33
src/main/java/com/bomostory/sceneeditmodule/SuperMovieMaker.kt

@@ -1,5 +1,6 @@
 package com.bomostory.sceneeditmodule
 
+import android.content.Context
 import android.graphics.Bitmap
 import android.util.Log
 import com.bomostory.sceneeditmodule.screen.movie.MovieEditActivity.Companion.FPS
@@ -22,6 +23,7 @@ import kotlin.collections.set
 class SuperMovieMaker {
 
     fun make(
+            context: Context,
             outputFile: File,
             project: Project,
             musics: List<Music>,
@@ -49,7 +51,7 @@ class SuperMovieMaker {
                 Completable.create {
                     project?.story?.apply {
                         val scene = scenes[frameData.sceneIndex]
-                        val bitmap = SceneDrawer.drawScene(scene, frameData.x, scaleWidth, scaleHeight)
+                        val bitmap = SceneDrawer.drawScene(context,scene, frameData.x, scaleWidth, scaleHeight)
                         movieBuilder.addImage(i, bitmap!!).blockingSubscribe()
                     }
                     it.onComplete()
@@ -116,38 +118,38 @@ class SuperMovieMaker {
         return frameDataList
     }
 
-    private fun generateMovieFilms(
-            scene: Scene,
-            scaleWidth: Int,
-            scaleHeight: Int): Observable<AbstractMap.SimpleEntry<Int, Bitmap>> {
-        var preBitmap: Bitmap?
-        return Observable.create<AbstractMap.SimpleEntry<Int, Bitmap>> {
-            scene?.apply {
-                record?.apply {
-                    var bitmap = SceneDrawer.drawScene(scene, 0, scaleWidth, scaleHeight)
-                    var bitmapIndex = 0
-                    var trackPosition = -1
-
-                    for (t in 0..period step ((1f / FPS) * 1000).toLong()) {
-                        for (track in tracks) {
-                            if (t >= track.time && tracks.indexOf(track) > trackPosition) {
-                                preBitmap = bitmap
-                                preBitmap?.recycle()
-
-                                bitmap = SceneDrawer.drawScene(scene, track.positionX, scaleWidth, scaleHeight)
-                                trackPosition = tracks.indexOf(track)
-                            }
-                        }
-
-                        bitmap?.apply {
-                            it.onNext(AbstractMap.SimpleEntry(bitmapIndex++, this))
-                        }
-                    }
-                    it.onComplete()
-                }
-            }
-        }
-    }
+//    private fun generateMovieFilms(
+//            scene: Scene,
+//            scaleWidth: Int,
+//            scaleHeight: Int): Observable<AbstractMap.SimpleEntry<Int, Bitmap>> {
+//        var preBitmap: Bitmap?
+//        return Observable.create<AbstractMap.SimpleEntry<Int, Bitmap>> {
+//            scene?.apply {
+//                record?.apply {
+//                    var bitmap = SceneDrawer.drawScene(scene, 0, scaleWidth, scaleHeight)
+//                    var bitmapIndex = 0
+//                    var trackPosition = -1
+//
+//                    for (t in 0..period step ((1f / FPS) * 1000).toLong()) {
+//                        for (track in tracks) {
+//                            if (t >= track.time && tracks.indexOf(track) > trackPosition) {
+//                                preBitmap = bitmap
+//                                preBitmap?.recycle()
+//
+//                                bitmap = SceneDrawer.drawScene(scene, track.positionX, scaleWidth, scaleHeight)
+//                                trackPosition = tracks.indexOf(track)
+//                            }
+//                        }
+//
+//                        bitmap?.apply {
+//                            it.onNext(AbstractMap.SimpleEntry(bitmapIndex++, this))
+//                        }
+//                    }
+//                    it.onComplete()
+//                }
+//            }
+//        }
+//    }
 
 
     data class FrameData(val sceneIndex: Int, val x: Int, var repeat: Int)

+ 9 - 3
src/main/java/com/bomostory/sceneeditmodule/basicdata/Actor.kt

@@ -1,7 +1,9 @@
 package com.bomostory.sceneeditmodule.basicdata
 
+import android.graphics.Paint
+
 open class Actor {
-    open var resourcePath: String? = null
+    open var resourcePath: String = ""
     var positionX: Int = 0
     var positionY: Int = 0
     var positionZ: Int = 0
@@ -9,5 +11,9 @@ open class Actor {
     var sideHeight: Int = 0
     var isSelect: Boolean = false
     var parentLayerIndex = 0
-    var isMoveable: Boolean = false
-}
+    var isMovable: Boolean = false
+    var text: String = ""
+    var textColor = "#000000"
+    var textAlign = Paint.Align.LEFT
+    var isDialogue = false
+}

+ 0 - 7
src/main/java/com/bomostory/sceneeditmodule/basicdata/Dialogue.kt

@@ -1,7 +0,0 @@
-package com.bomostory.sceneeditmodule.basicdata
-
-class Dialogue: Actor(){
-    var resource: Int = 0
-    var textPositionX: Int = 0
-    var textPositionY: Int = 0
-}

+ 2 - 4
src/main/java/com/bomostory/sceneeditmodule/layermanagement/LayerAdapter.kt

@@ -4,7 +4,6 @@ import android.graphics.drawable.Drawable
 import android.support.v7.widget.RecyclerView
 import android.view.*
 import com.bomostory.sceneeditmodule.basicdata.Actor
-import com.bomostory.sceneeditmodule.basicdata.Dialogue
 import com.example.tfat.myapplication.R
 import kotlinx.android.synthetic.main.actor_item.view.*
 
@@ -28,10 +27,9 @@ class LayerAdapter (actorData: ArrayList<Actor>, actorListeners: ArrayList<View.
 
     class ViewHolder (view : View) : RecyclerView.ViewHolder(view) {
         fun bind(actor: Actor, onTouchListener: View.OnTouchListener?) {
-            when (actor is Dialogue){
+            when (actor.isDialogue){
                 true -> {
-                    val dialogue = actor as Dialogue
-                    itemView.actor_image.setImageResource(dialogue.resource)
+                    itemView.actor_image.setImageResource(actor.resourcePath.toInt())
                 }
                 false -> itemView.actor_image.setImageDrawable(Drawable.createFromPath(actor.resourcePath))
             }

+ 4 - 4
src/main/java/com/bomostory/sceneeditmodule/sceneview/SceneView1.kt

@@ -5,11 +5,11 @@ import android.graphics.drawable.Drawable
 import android.support.constraint.ConstraintLayout
 import android.util.AttributeSet
 import android.view.View
+import android.widget.RelativeLayout
 import com.bomostory.sceneeditmodule.basicdata.Scene
 import kotlin.math.pow
 
 
-
 class SceneView1 : ConstraintLayout {
 
     private var backgroundView: LayerView? = null
@@ -19,12 +19,12 @@ class SceneView1 : ConstraintLayout {
             field = value
             value?.let {
                 removeAllViews()
-
                 backgroundView = LayerView(context)
-                backgroundView?.layoutParams = LayoutParams(it.sceneWidth + 69,LayoutParams.MATCH_PARENT)
+                var lParams = RelativeLayout.LayoutParams(it.sceneWidth + it.sceneWidth.div(32),it.sceneWidth.div(2))
+                backgroundView?.layoutParams = lParams
                 backgroundView?.background = Drawable.createFromPath(it.backgroundPath)
+                backgroundView?.x = -(it.sceneWidth.div(64)).toFloat()
                 addView(backgroundView)
-
                 for (layer in it.layers) {
                     val layerView = LayerView(context)
                     layerView.layoutParams = LayoutParams(it.sceneWidth + 69,LayoutParams.MATCH_PARENT)

+ 1 - 0
src/main/java/com/bomostory/sceneeditmodule/screen/movie/MovieEditActivity.kt

@@ -380,6 +380,7 @@ class MovieEditActivity : AppCompatActivity(),
         val project = project ?: return
 
         SuperMovieMaker().make(
+                this,
                 outputFile,
                 project,
                 musics,

+ 16 - 9
src/main/java/com/bomostory/sceneeditmodule/screen/view/ActorView.kt

@@ -1,30 +1,37 @@
 package com.bomostory.sceneeditmodule.screen.view
 
 import android.content.Context
+import android.graphics.*
 import android.graphics.drawable.Drawable
 import android.util.AttributeSet
 import android.widget.ImageView
+import com.bomostory.sceneeditmodule.DialogueDrawer
 import com.bomostory.sceneeditmodule.basicdata.Actor
-import com.bomostory.sceneeditmodule.basicdata.Dialogue
 
 class ActorView : ImageView {
-    var actor: Actor? = null
+
+    var data: Actor? = null
         set(value) {
+            field = value
             value?.let {
-                when (it is Dialogue){
-                    true -> {
-                        val dialogue =it as Dialogue
-                        setImageResource(dialogue.resource)
-                    }
-                    false -> setImageDrawable(Drawable.createFromPath(it.resourcePath))
+                if(!it.isDialogue){
+                    setImageDrawable(Drawable.createFromPath(it.resourcePath))
                 }
+
             }
         }
-
     constructor(context: Context) : super(context)
 
     constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
 
     constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
 
+    override fun onDraw(canvas: Canvas?) {
+        super.onDraw(canvas)
+        data?.let {
+            if (it.isDialogue) {
+                canvas?.drawBitmap(DialogueDrawer.drawDialogue(context, it), 0f, 0f, null)
+            }
+        }
+    }
 }

+ 68 - 65
src/main/java/com/bomostory/sceneeditmodule/screen/view/DialogueView.kt

@@ -2,18 +2,14 @@ package com.bomostory.sceneeditmodule.screen.view
 
 import android.content.Context
 import android.graphics.*
-import android.support.v4.content.ContextCompat
 import android.util.AttributeSet
 import android.view.View
-import com.example.tfat.myapplication.R
 import android.graphics.drawable.VectorDrawable
-import android.graphics.BitmapFactory
-import android.graphics.drawable.BitmapDrawable
 import android.graphics.Bitmap
 import android.view.MotionEvent
 import android.widget.RelativeLayout
+import com.bomostory.sceneeditmodule.DialogueDrawer
 import com.bomostory.sceneeditmodule.basicdata.Actor
-import com.bomostory.sceneeditmodule.basicdata.Dialogue
 import kotlinx.android.synthetic.main.actor_view.view.*
 
 class DialogueView : EditActorView{
@@ -24,7 +20,7 @@ class DialogueView : EditActorView{
 
     constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
 
-    var dialogue = Dialogue()
+    var dialogue = Actor()
         set(value) {
             value?.let {
                 field = value
@@ -34,7 +30,7 @@ class DialogueView : EditActorView{
                 actor_layout.layoutParams = layoutParams
                 val actorLayoutParams = RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
                 actor_view_layout.layoutParams = actorLayoutParams
-                when(it.isMoveable) {
+                when(it.isMovable) {
                     true -> actor_view_layout.setOnTouchListener(actorOnTouchListener())
                 }
                 when(it.isSelect){
@@ -44,36 +40,27 @@ class DialogueView : EditActorView{
             }
         }
 
-    override var actor = Actor()
 
     override fun onDraw(canvas: Canvas?) {
         super.onDraw(canvas)
-        val mPaint = Paint()
-        mPaint.style = Paint.Style.STROKE
-        mPaint.strokeWidth = 1f
-        mPaint.isAntiAlias = true
-        mPaint.color = Color.parseColor("#000000")
-        mPaint.textSize = 40f
-        mPaint.textAlign = Paint.Align.CENTER
-        var mResId = dialogue.resource
-        val drawable = ContextCompat.getDrawable(context, mResId)
-        var valuePaddingInPixels = resources.getDimension(R.dimen.edit_actor_padding)
-        if (drawable is BitmapDrawable) {
-            var bitmap = BitmapFactory.decodeResource(context.resources, mResId)
-            canvas?.drawBitmap(bitmap,0f,0f, null)
-        } else if (drawable is VectorDrawable) {
-            canvas?.drawBitmap(getBitmap(drawable),null, RectF(dialogue.positionX.toFloat() + valuePaddingInPixels, dialogue.positionY.toFloat() + valuePaddingInPixels,
-                              dialogue.positionX.toFloat() + dialogue.sideLength.toFloat() - valuePaddingInPixels,
-                            dialogue.positionY.toFloat() + dialogue.sideHeight.toFloat() - valuePaddingInPixels), null)
-        } else {
-            throw IllegalArgumentException("unsupported drawable type")
+        canvas?.drawBitmap(DialogueDrawer.drawDialogue(context, dialogue), dialogue.positionX.toFloat(), dialogue.positionY.toFloat(), null)
+        if(dialogue.isSelect) {
+            val mPaint = Paint()
+            mPaint.style = Paint.Style.STROKE
+            mPaint.strokeWidth = 5f
+            mPaint.isAntiAlias = true
+            mPaint.color = Color.parseColor("#4e342e")
+            mPaint.pathEffect = DashPathEffect(floatArrayOf(8f, 8f), 0f)
+            canvas?.drawLine(dialogue.positionX.toFloat() + 25 , dialogue.positionY.toFloat() + 25, dialogue.positionX.toFloat() + 25, dialogue.positionY.toFloat() + 25 + dialogue.sideHeight , mPaint)
+            canvas?.drawLine(dialogue.positionX.toFloat() + 25, dialogue.positionY.toFloat() + 25, dialogue.positionX.toFloat() + dialogue.sideLength.toFloat() - 25, dialogue.positionY.toFloat() + 25, mPaint)
+            canvas?.drawLine(dialogue.positionX.toFloat() + 25, dialogue.positionY.toFloat() + dialogue.sideHeight.toFloat() - 25, dialogue.positionX.toFloat()  + dialogue.sideLength.toFloat() + 25, dialogue.positionY.toFloat() + dialogue.sideHeight.toFloat() - 25, mPaint)
+            canvas?.drawLine(dialogue.positionX.toFloat() + dialogue.sideLength.toFloat() - 25, dialogue.positionY.toFloat() + 25, dialogue.positionX.toFloat() + dialogue.sideLength.toFloat() - 25, dialogue.positionY.toFloat() + dialogue.sideHeight.toFloat() - 25, mPaint)
         }
-        canvas?.drawText("Sample Text",dialogue.positionX.toFloat() + dialogue.sideLength.div(2),dialogue.positionY.toFloat() + dialogue.sideHeight.div(2), mPaint)
     }
 
     private fun getBitmap(vectorDrawable: VectorDrawable): Bitmap {
-        val bitmap = Bitmap.createBitmap(vectorDrawable.intrinsicWidth,
-                vectorDrawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
+        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)
@@ -94,7 +81,7 @@ class DialogueView : EditActorView{
                     positionEnd = (motionEvent.y).toInt()
                 }
                 MotionEvent.ACTION_MOVE -> {
-                    if (!(Math.abs(motionEvent.x - positionStart) < 10 && Math.abs(motionEvent.y - positionEnd) < 10) && actor.isSelect) {
+                    if (!(Math.abs(motionEvent.x - positionStart) < 10 && Math.abs(motionEvent.y - positionEnd) < 10) && dialogue.isSelect) {
                         mx = motionEvent.rawX.toInt() - positionStart
                         my = motionEvent.rawY.toInt() - positionEnd
                         var laParams = actor_layout.layoutParams as RelativeLayout.LayoutParams
@@ -102,18 +89,18 @@ class DialogueView : EditActorView{
                         actor_layout.layoutParams = laParams
                         val actorLayoutParams = RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
                         view.layoutParams = actorLayoutParams
-                        actor.positionX = mx
-                        actor.positionY = my - 200
+                        dialogue.positionX = mx
+                        dialogue.positionY = my - 200
                     }
                 }
                 MotionEvent.ACTION_UP -> {
                     if (Math.abs(motionEvent.x - positionStart) < 10 && Math.abs(motionEvent.y - positionEnd) < 10 && (System.currentTimeMillis() - clickPeriod) > 1000) {
-                        actorCallback?.onActorLongClick(actor)
+                        actorCallback?.onActorLongClick(dialogue)
                     } else if (Math.abs(motionEvent.x - positionStart) < 10 && Math.abs(motionEvent.y - positionEnd) < 10) {
-                        actorCallback?.onActorSelected(actor)
+                        actorCallback?.onActorSelected(dialogue)
                     } else {
-                        if (actor.isSelect){
-                            actorCallback?.onActorChange(actor)
+                        if (dialogue.isSelect){
+                            actorCallback?.onActorChange(dialogue)
                         }
                     }
                 }
@@ -147,21 +134,25 @@ class DialogueView : EditActorView{
                         true ->  my
                         false -> mx
                     }
-                    var dialogueData = Dialogue().apply {
-                        resource = dialogue.resource
+                    var dialogueData = Actor().apply {
+                        resourcePath = dialogue.resourcePath
+                        text = dialogue.text
+                        textColor = dialogue.textColor
+                        textAlign = dialogue.textAlign
                         this.positionX = x
                         this.positionY = y
-                        positionZ = actor.positionZ
+                        positionZ = dialogue.positionZ
                         sideLength = sizeX + dP
                         sideHeight = sizeY + dP
-                        isSelect = actor.isSelect
-                        parentLayerIndex = actor.parentLayerIndex
-                        isMoveable = actor.isMoveable
+                        isSelect = dialogue.isSelect
+                        parentLayerIndex = dialogue.parentLayerIndex
+                        isMovable = dialogue.isMovable
+                        isDialogue = dialogue.isDialogue
                     }
                     dialogue = dialogueData
                 }
                 MotionEvent.ACTION_UP -> {
-                    actor.isSelect = true
+                    dialogue.isSelect = true
                     actorCallback?.onActorChange(dialogue)
                 }
             }
@@ -194,21 +185,25 @@ class DialogueView : EditActorView{
                         true ->  my
                         false -> mx
                     }
-                    var dialogueData = Dialogue().apply {
-                        resource = dialogue.resource
+                    var dialogueData = Actor().apply {
+                        resourcePath = dialogue.resourcePath
+                        text = dialogue.text
+                        textColor = dialogue.textColor
+                        textAlign = dialogue.textAlign
                         this.positionX = x + dP
                         this.positionY = y + dP
-                        positionZ = actor.positionZ
+                        positionZ = dialogue.positionZ
                         sideLength = sizeX - dP
                         sideHeight = sizeY - dP
-                        isSelect = actor.isSelect
-                        parentLayerIndex = actor.parentLayerIndex
-                        isMoveable = actor.isMoveable
+                        isSelect = dialogue.isSelect
+                        parentLayerIndex = dialogue.parentLayerIndex
+                        isMovable = dialogue.isMovable
+                        isDialogue = dialogue.isDialogue
                     }
                     dialogue = dialogueData
                 }
                 MotionEvent.ACTION_UP -> {
-                    actor.isSelect = true
+                    dialogue.isSelect = true
                     actorCallback?.onActorChange(dialogue)
                 }
             }
@@ -241,21 +236,25 @@ class DialogueView : EditActorView{
                         true ->  my
                         false -> mx
                     }
-                    var dialogueData = Dialogue().apply {
-                        resource = dialogue.resource
+                    var dialogueData = Actor().apply {
+                        resourcePath = dialogue.resourcePath
+                        text = dialogue.text
+                        textColor = dialogue.textColor
+                        textAlign = dialogue.textAlign
                         this.positionX = x
                         this.positionY = y + my
-                        positionZ = actor.positionZ
+                        positionZ = dialogue.positionZ
                         sideLength = sizeX + mx
                         sideHeight = sizeY - my
-                        isSelect = actor.isSelect
-                        parentLayerIndex = actor.parentLayerIndex
-                        isMoveable = actor.isMoveable
+                        isSelect = dialogue.isSelect
+                        parentLayerIndex = dialogue.parentLayerIndex
+                        isMovable = dialogue.isMovable
+                        isDialogue = dialogue.isDialogue
                     }
                     dialogue = dialogueData
                 }
                 MotionEvent.ACTION_UP -> {
-                    actor.isSelect = true
+                    dialogue.isSelect = true
                     actorCallback?.onActorChange(dialogue)
                 }
             }
@@ -284,21 +283,25 @@ class DialogueView : EditActorView{
                 MotionEvent.ACTION_MOVE -> {
                     var mx =  motionEvent.rawX.toInt() - positionX
                     var my =  motionEvent.rawY.toInt() - positionY
-                    var dialogueData = Dialogue().apply {
-                        resource = dialogue.resource
+                    var dialogueData = Actor().apply {
+                        resourcePath = dialogue.resourcePath
+                        text = dialogue.text
+                        textColor = dialogue.textColor
+                        textAlign = dialogue.textAlign
                         this.positionX = x + mx
                         this.positionY = y
-                        positionZ = actor.positionZ
+                        positionZ = dialogue.positionZ
                         sideLength = sizeX - mx
                         sideHeight = sizeY + my
-                        isSelect = actor.isSelect
-                        parentLayerIndex = actor.parentLayerIndex
-                        isMoveable = actor.isMoveable
+                        isSelect = dialogue.isSelect
+                        parentLayerIndex = dialogue.parentLayerIndex
+                        isMovable = dialogue.isMovable
+                        isDialogue = dialogue.isDialogue
                     }
                     dialogue = dialogueData
                 }
                 MotionEvent.ACTION_UP -> {
-                    actor.isSelect = true
+                    dialogue.isSelect = true
                     actorCallback?.onActorChange(dialogue)
                 }
             }

+ 2 - 3
src/main/java/com/bomostory/sceneeditmodule/screen/view/EditActorView.kt

@@ -26,14 +26,14 @@ open class EditActorView @JvmOverloads constructor(
         set(value) {
             value?.let {
                 field = value
-                actor_view_layout.actor = it
+                actor_view_layout.data = it
                 val layoutParams = RelativeLayout.LayoutParams(it.sideLength, it.sideHeight)
                 layoutParams.leftMargin = it.positionX
                 layoutParams.topMargin = it.positionY
                 actor_layout.layoutParams = layoutParams
                 val actorLayoutParams = RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
                 actor_view_layout.layoutParams = actorLayoutParams
-                when(it.isMoveable) {
+                when(it.isMovable) {
                     true -> actor_view_layout.setOnTouchListener(actorOnTouchListener())
                 }
                 when(it.isSelect){
@@ -258,7 +258,6 @@ open class EditActorView @JvmOverloads constructor(
     }
 
     override fun onDraw(canvas: Canvas?) {
-        super.onDraw(canvas)
         val mPaint = Paint()
         if(actor.isSelect) {
             mPaint.style = Paint.Style.STROKE

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

@@ -4,7 +4,6 @@ import android.content.Context
 import android.util.AttributeSet
 import android.widget.RelativeLayout
 import com.bomostory.sceneeditmodule.basicdata.Actor
-import com.bomostory.sceneeditmodule.basicdata.Dialogue
 
 class LayerView : RelativeLayout {
 
@@ -23,14 +22,14 @@ class LayerView : RelativeLayout {
                 layoutParams.leftMargin = actor.positionX
                 layoutParams.topMargin = actor.positionY
                 actorView.layoutParams = layoutParams
-                actorView.actor = actor
+                actorView.data = actor
             }
         }
 
     var editActors = ArrayList<Actor>()
         set(value) {
             for (actor in value) {
-                if (actor is Dialogue){
+                if (actor.isDialogue){
                     var dialogueView = DialogueView(context)
                     dialogueView.actorCallback = context as EditActorView.OnActorChangeListener
                     addView(dialogueView)
@@ -38,8 +37,7 @@ class LayerView : RelativeLayout {
                     layoutParams.leftMargin = actor.positionX
                     layoutParams.topMargin = actor.positionY
                     dialogueView.dialogue = actor
-                    dialogueView.actor = actor
-                } else if (actor is Actor) {
+                } else if (!actor.isDialogue) {
                     var actorView = EditActorView(context)
                     actorView.actorCallback = context as EditActorView.OnActorChangeListener
                     addView(actorView)

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

@@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable
 import android.support.constraint.ConstraintLayout
 import android.util.AttributeSet
 import android.view.ViewGroup
+import android.widget.RelativeLayout
 import com.bomostory.sceneeditmodule.basicdata.Scene
 import kotlin.math.pow
 
@@ -19,8 +20,10 @@ class MovieView : ConstraintLayout {
                 removeAllViews()
 
                 backgroundView.apply {
-                    layoutParams = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
+                    var lParams = RelativeLayout.LayoutParams(it.sceneWidth + it.sceneWidth.div(32),it.sceneWidth.div(2))
+                    layoutParams = lParams
                     background = Drawable.createFromPath(it.backgroundPath)
+                    x = -(it.sceneWidth.div(64)).toFloat()
                 }
                 addView(backgroundView)
 

+ 4 - 4
src/main/java/com/bomostory/sceneeditmodule/utils/FileUtils.kt

@@ -35,7 +35,7 @@ object FileUtils {
         }
     }
 
-    fun saveProject(project: Project, scaleWidth: Int, scaleHeight: Int): Completable {
+    fun saveProject(context: Context, project: Project, scaleWidth: Int, scaleHeight: Int): Completable {
         return Completable.create {
             try {
                 val fileWriter = FileWriter(File(File(Config.PROJECTS_FOLDER, project.name),Config.PROJECT_FILE_NAME))
@@ -46,7 +46,7 @@ object FileUtils {
                         var fileOutputStream = FileOutputStream(project.scene1File)
                         project.story?.let {
                             it.scenes?.let {
-                                SceneDrawer.drawScene(it[0], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
+                                SceneDrawer.drawScene(context, it[0], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
                                         100, fileOutputStream)
                                 fileOutputStream.flush()
                                 fileOutputStream.close()
@@ -57,7 +57,7 @@ object FileUtils {
                         var fileOutputStream = FileOutputStream(project.scene1File)
                         project.story?.let {
                             it.scenes?.let {
-                                SceneDrawer.drawScene(it[0], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
+                                SceneDrawer.drawScene(context, it[0], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
                                         100, fileOutputStream)
                                 fileOutputStream.flush()
                                 fileOutputStream.close()
@@ -66,7 +66,7 @@ object FileUtils {
                         fileOutputStream = FileOutputStream(project.scene2File)
                         project.story?.let {
                             it.scenes?.let {
-                                SceneDrawer.drawScene(it[1], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
+                                SceneDrawer.drawScene(context, it[1], 0, scaleWidth, scaleHeight)?.compress(Bitmap.CompressFormat.PNG,
                                         100, fileOutputStream)
                                 fileOutputStream.flush()
                                 fileOutputStream.close()

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_black.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="oval">
+
+            <solid
+                android:color="#000000"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#ffffff" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_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="oval">
+
+            <solid
+                android:color="#4a90e2"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#ffffff" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_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="oval">
+
+            <solid
+                android:color="#417505"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#ffffff" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_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="oval">
+
+            <solid
+                android:color="#d0021b"/>
+
+            <stroke
+                android:width="1dp"
+                android:color="#ffffff" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_selected.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="oval">
+
+            <solid
+                android:color="#212121"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#ffecb3" />
+
+            <size
+                android:width="30dp"
+                android:height="30dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 20 - 0
src/main/res/drawable/btn_edit_text_dialog_circle_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="oval">
+
+            <solid
+                android:color="#f8e71c"/>
+
+            <stroke
+                android:width="2dp"
+                android:color="#ffffff" />
+
+            <size
+                android:width="24dp"
+                android:height="24dp"/>
+        </shape>
+    </item>
+</layer-list>

+ 10 - 0
src/main/res/drawable/ic_aligncenter.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,3L21,3L21,5L3,5L3,3ZM7,15L17,15L17,17L7,17L7,15ZM7,7L17,7L17,9L7,9L7,7ZM3,11L21,11L21,13L3,13L3,11ZM3,19L21,19L21,21L3,21L3,19Z"
+      android:fillColor="#4cffffff"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_aligncenter_w.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,3h18v2L3,5L3,3zM7,15h10v2L7,17v-2zM7,7h10v2L7,9L7,7zM3,11h18v2L3,13v-2zM3,19h18v2L3,21v-2z"
+      android:fillColor="#FFF"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_alignleft.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,19L21,19L21,21L3,21L3,19ZM3,7L15,7L15,9L3,9L3,7ZM3,3L21,3L21,5L3,5L3,3ZM3,15L15,15L15,17L3,17L3,15ZM3,11L21,11L21,13L3,13L3,11Z"
+      android:fillColor="#4cffffff"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_alignleft_w.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,19L21,19L21,21L3,21L3,19ZM3,7L15,7L15,9L3,9L3,7ZM3,3L21,3L21,5L3,5L3,3ZM3,15L15,15L15,17L3,17L3,15ZM3,11L21,11L21,13L3,13L3,11Z"
+      android:fillColor="#FFF"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_alignright.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,3L21,3L21,5L3,5L3,3ZM3,19L21,19L21,21L3,21L3,19ZM3,11L21,11L21,13L3,13L3,11ZM9,15L21,15L21,17L9,17L9,15ZM9,7L21,7L21,9L9,9L9,7Z"
+      android:fillColor="#4cffffff"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_alignright_w.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,3L21,3L21,5L3,5L3,3ZM3,19L21,19L21,21L3,21L3,19ZM3,11L21,11L21,13L3,13L3,11ZM9,15L21,15L21,17L9,17L9,15ZM9,7L21,7L21,9L9,9L9,7Z"
+      android:fillColor="#FFF"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_bold.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M17.25,8C17.25,5.74 15.5,4 13.25,4L7,4L7,18L14.04,18C16.13,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79C16.57,10.12 17.25,9.02 17.25,8ZM10,6.5L13,6.5C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5L10,9.5L10,6.5ZM13.5,15.5L10,15.5L10,12.5L13.5,12.5C14.33,12.5 15,13.17 15,14C15,14.83 14.33,15.5 13.5,15.5Z"
+      android:fillColor="#FFF"
+      android:fillType="nonZero"/>
+</vector>

+ 10 - 0
src/main/res/drawable/ic_tune.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M3,5L13,5L13,7L3,7L3,5ZM7,11L7,9L9,9L9,15L7,15L7,13L3,13L3,11L7,11ZM13,15L13,17L21,17L21,19L13,19L13,21L11,21L11,15L13,15ZM3,17L9,17L9,19L3,19L3,17ZM11,11L21,11L21,13L11,13L11,11ZM17,3L17,5L21,5L21,7L17,7L17,9L15,9L15,3L17,3Z"
+      android:fillColor="#FFF"
+      android:fillType="nonZero"/>
+</vector>

+ 115 - 0
src/main/res/layout/dialogfragment_edit_text.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+    <EditText
+        android:id="@+id/etv_text"
+        android:layout_width="800dp"
+        android:layout_height="200dp"/>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="46dp"
+        android:background="#212121"
+        android:orientation="horizontal">
+        <Button
+            android:drawableStart="@drawable/ic_bold"
+            android:background="#212121"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="24dp"
+            android:layout_height="24dp"  />
+        <ImageView
+            android:id="@+id/btn_edit_dialog_align_left"
+            android:src="@drawable/ic_alignleft_w"
+            android:background="#212121"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/btn_edit_dialog_align_center"
+            android:src="@drawable/ic_aligncenter"
+            android:background="#212121"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/btn_edit_dialog_align_right"
+            android:src="@drawable/ic_alignright"
+            android:background="#212121"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp"/>
+        <ImageView
+            android:id="@+id/iv_edit_text_red"
+            android:src="@drawable/btn_edit_text_dialog_circle_red"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/iv_edit_text_yellow"
+            android:src="@drawable/btn_edit_text_dialog_circle_yellow"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/iv_edit_text_blue"
+            android:src="@drawable/btn_edit_text_dialog_circle_blue"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/iv_edit_text_green"
+            android:src="@drawable/btn_edit_text_dialog_circle_green"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <ImageView
+            android:id="@+id/iv_edit_text_black"
+            android:src="@drawable/btn_edit_text_dialog_circle_black"
+            android:background="@drawable/btn_edit_text_dialog_circle_selected"
+            android:layout_marginTop="6dp"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:scaleType="center"
+            android:layout_width="30dp"
+            android:layout_height="30dp" />
+        <Button
+            android:drawableStart="@drawable/ic_tune"
+            android:background="#212121"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:layout_width="24dp"
+            android:layout_height="24dp" />
+
+        <Button
+            android:id="@+id/btn_edit_dialog_done"
+            android:text="DONE"
+            android:textColor="#ffecb3"
+            android:background="#212121"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+    </LinearLayout>
+</LinearLayout>

+ 160 - 0
src/main/res/layout/view_control_dialogue_dialog.xml

@@ -0,0 +1,160 @@
+<?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="#ffffff">
+    <LinearLayout
+        android:id="@+id/edit_content_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toTopOf="parent"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_duplicate_b"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:text="Edit Content"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/duplicate_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/edit_content_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_duplicate_b"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:text="Duplicate"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/opacity_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/duplicate_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_opacity_b"
+            android:tint="@android:color/darker_gray"/>
+        <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"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/Mirror_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/opacity_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_flip_b"
+            android:tint="@android:color/darker_gray"/>
+        <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"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/bring_to_front_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/Mirror_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_tofront"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:text="Bring to front"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/send_to_back_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/bring_to_front_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_toback"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:text="Sene to back"/>
+    </LinearLayout>
+    <LinearLayout
+        android:id="@+id/delete_dialogue"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/send_to_back_dialogue"
+        android:orientation="horizontal">
+        <ImageView
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginBottom="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:src="@drawable/ic_delete_b"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginBottom="20dp"
+            android:layout_marginLeft="16dp"
+            android:background="#ffffff"
+            android:text="Delete"/>
+    </LinearLayout>
+</android.support.constraint.ConstraintLayout>

+ 1 - 0
src/main/res/values/dimens.xml

@@ -6,4 +6,5 @@
     <dimen name="actor_height">120dp</dimen>
     <dimen name="actor_width">120dp</dimen>
     <dimen name="edit_actor_padding">24dp</dimen>
+    <dimen name="dialogue_padding">50dp</dimen>
 </resources>