faterhenry 5 éve
szülő
commit
38c0cff839

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

@@ -21,7 +21,7 @@ object DialogueDrawer {
         textPaint.strokeWidth = 1f
         textPaint.isAntiAlias = true
         textPaint.color = data.textColor
-        textPaint.textSize = 40f
+        textPaint.textSize = data.textSize * 2
         textPaint.textAlign = data.textAlign
         var mResId = data.resourcePath.toInt()
         val drawable = ContextCompat.getDrawable(context, mResId)

+ 32 - 22
src/main/java/com/bomostory/sceneeditmodule/EditTextDialog.kt

@@ -33,8 +33,8 @@ class EditTextDialog : DialogFragment() {
                 iv_edit_text_blue.background = null
                 iv_edit_text_green.background = null
                 iv_edit_text_black.background = null
-                dialogueActor?.textColor = Color.parseColor("#d0021b")
-                etv_text.setTextColor(dialogueActor?.textColor)
+                dialogueActor.textColor = Color.parseColor("#d0021b")
+                etv_text.setTextColor(dialogueActor.textColor)
                 popupWindow.dismiss()
             }
             iv_edit_text_yellow.setOnClickListener {
@@ -43,8 +43,8 @@ class EditTextDialog : DialogFragment() {
                 iv_edit_text_blue.background = null
                 iv_edit_text_green.background = null
                 iv_edit_text_black.background = null
-                dialogueActor?.textColor = Color.parseColor("#f8e71c")
-                etv_text.setTextColor(dialogueActor?.textColor)
+                dialogueActor.textColor = Color.parseColor("#f8e71c")
+                etv_text.setTextColor(dialogueActor.textColor)
                 popupWindow.dismiss()
             }
             iv_edit_text_blue.setOnClickListener {
@@ -53,8 +53,8 @@ class EditTextDialog : DialogFragment() {
                 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 = Color.parseColor("#4a90e2")
-                etv_text.setTextColor(dialogueActor?.textColor)
+                dialogueActor.textColor = Color.parseColor("#4a90e2")
+                etv_text.setTextColor(dialogueActor.textColor)
                 popupWindow.dismiss()
             }
             iv_edit_text_green.setOnClickListener {
@@ -63,8 +63,8 @@ class EditTextDialog : DialogFragment() {
                 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 = Color.parseColor("#417505")
-                etv_text.setTextColor(dialogueActor?.textColor)
+                dialogueActor.textColor = Color.parseColor("#417505")
+                etv_text.setTextColor(dialogueActor.textColor)
                 popupWindow.dismiss()
             }
             iv_edit_text_black.setOnClickListener {
@@ -73,8 +73,8 @@ class EditTextDialog : DialogFragment() {
                 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 = Color.parseColor("#000000")
-                etv_text.setTextColor(dialogueActor?.textColor)
+                dialogueActor.textColor = Color.parseColor("#000000")
+                etv_text.setTextColor(dialogueActor.textColor)
                 popupWindow.dismiss()
 
             }
@@ -95,20 +95,30 @@ class EditTextDialog : DialogFragment() {
                 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
+                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
+                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
-            }
+                dialogueActor.textAlign = Paint.Align.RIGHT
+            }
+            seek_bar_dialog_view_size.progress = 25
+            etv_text.textSize = 25f
+            seek_bar_dialog_view_size.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+                override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
+                    etv_text.textSize = progress.toFloat()
+                    dialogueActor.textSize = progress.toFloat()
+                }
+                override fun onStartTrackingTouch(seekBar: SeekBar?) = Unit
+                override fun onStopTrackingTouch(seekBar: SeekBar?) {}
+            })
         }
     }
 
@@ -120,9 +130,9 @@ class EditTextDialog : DialogFragment() {
         popupView.sb_set_color_r.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 popupView.tv_set_color_r.text = progress.toString()
-                dialogueActor?.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
+                dialogueActor.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
                         popupView.tv_set_color_g.text.toString().toInt(),popupView.tv_set_color_b.text.toString().toInt())
-                etv_text.setTextColor(dialogueActor?.textColor)
+                etv_text.setTextColor(dialogueActor.textColor)
             }
             override fun onStartTrackingTouch(p0: SeekBar?) {
             }
@@ -135,9 +145,9 @@ class EditTextDialog : DialogFragment() {
         popupView.sb_set_color_g.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 popupView.tv_set_color_g.text = progress.toString()
-                dialogueActor?.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
+                dialogueActor.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
                         popupView.tv_set_color_g.text.toString().toInt(),popupView.tv_set_color_b.text.toString().toInt())
-                etv_text.setTextColor(dialogueActor?.textColor)
+                etv_text.setTextColor(dialogueActor.textColor)
             }
             override fun onStartTrackingTouch(p0: SeekBar?) {
             }
@@ -150,9 +160,9 @@ class EditTextDialog : DialogFragment() {
         popupView.sb_set_color_b.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 popupView.tv_set_color_b.text = progress.toString()
-                dialogueActor?.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
+                dialogueActor.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
                         popupView.tv_set_color_g.text.toString().toInt(),popupView.tv_set_color_b.text.toString().toInt())
-                etv_text.setTextColor(dialogueActor?.textColor)
+                etv_text.setTextColor(dialogueActor.textColor)
             }
             override fun onStartTrackingTouch(p0: SeekBar?) {
             }
@@ -165,9 +175,9 @@ class EditTextDialog : DialogFragment() {
         popupView.sb_set_color_a.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 popupView.tv_set_color_r.text = progress.toString()
-                dialogueActor?.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
+                dialogueActor.textColor = Color.argb(popupView.tv_set_color_a.text.toString().toInt(),popupView.tv_set_color_r.text.toString().toInt(),
                         popupView.tv_set_color_g.text.toString().toInt(),popupView.tv_set_color_b.text.toString().toInt())
-                etv_text.setTextColor(dialogueActor?.textColor)
+                etv_text.setTextColor(dialogueActor.textColor)
 
             }
             override fun onStartTrackingTouch(p0: SeekBar?) {

+ 22 - 9
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -6,6 +6,8 @@ import android.app.ProgressDialog
 import android.content.Context
 import android.content.DialogInterface
 import android.content.Intent
+import android.content.res.Configuration
+import android.content.res.Resources
 import android.graphics.Bitmap
 import android.graphics.BitmapFactory
 import android.graphics.Canvas
@@ -97,8 +99,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         const val FROM_GALLERY_AND_CROP = 3
         const val CROP_TO_BACKGROUND = 4
         const val LAYER_MANAGEMENT = "layer_management"
-        const val ACTOR_HEIGHT = 400
-        const val ACTOR_WIDTH = 400
+        const val ACTOR_HEIGHT_ZOOM_OUT = 3
+        const val ACTOR_WIDTH_ZOOM_OUT = 3
         const val DIALOGUE_HEIGHT = 320
         const val DIALOGUE_WIDTH = 400
         const val ACTOR_INIT_POSITION_X = 200
@@ -609,6 +611,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                                         newActor.text = actor.text
                                         newActor.textColor = actor.textColor
                                         newActor.textAlign = actor.textAlign
+                                        newActor.textSize = actor.textSize
                                         newActor.isDialogue = actor.isDialogue
                                         newActor.isMirror = actor.isMirror
                                         newActor.opacity = actor.opacity
@@ -1197,8 +1200,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         project.story?.let {
             it.scenes?.let{
                 val actorData = Actor()
-                actorData.sideLength = ACTOR_WIDTH
-                actorData.sideHeight = ACTOR_HEIGHT
+                actorData.sideLength = BitmapFactory.decodeFile(resourcePath).width / ACTOR_WIDTH_ZOOM_OUT
+                actorData.sideHeight = BitmapFactory.decodeFile(resourcePath).height / ACTOR_HEIGHT_ZOOM_OUT
                 actorData.positionX = Math.max(0, Math.min(screenWidth - actorData.sideLength, positionX))
                 actorData.positionY = Math.max(0, Math.min(screenHeight - actorData.sideHeight, positionY))
                 actorData.positionZ = it[currentSceneIndex].layers[currentLayerIndex].actors.size
@@ -1252,8 +1255,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         project.story?.let {
             it.scenes?.let{
                 val actorData = Actor()
-                actorData.sideLength = ACTOR_WIDTH
-                actorData.sideHeight = ACTOR_HEIGHT
+                actorData.sideLength = BitmapFactory.decodeFile(resourcePath).width / ACTOR_WIDTH_ZOOM_OUT
+                actorData.sideHeight = BitmapFactory.decodeFile(resourcePath).height / ACTOR_HEIGHT_ZOOM_OUT
                 actorData.positionX = Math.max(0, Math.min(screenWidth - actorData.sideLength, positionX))
                 actorData.positionY = Math.max(0, Math.min(screenHeight - actorData.sideHeight, positionY))
                 actorData.positionZ = it[currentSceneIndex].layers[currentLayerIndex].actors.size
@@ -1400,7 +1403,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                     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()
+                            it[currentSceneIndex].layers[currentLayerIndex].actors[actor.positionZ].opacity = p1.toFloat() / 100
                             sceneEditView.scene = it[currentSceneIndex]
                             sceneEditView.setLayerVisible(currentLayerIndex)
                         }
@@ -1997,8 +2000,10 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     }
 
     override fun onSceneTouch(){
-        unSelectActor()
-        sceneEditView.setLayerVisible(currentLayerIndex)
+        if(currentSceneIndex != 0) {
+            unSelectActor()
+            sceneEditView.setLayerVisible(currentLayerIndex)
+        }
     }
 
     override fun onSceneLongClick() {
@@ -2296,4 +2301,12 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
             }
         }
     }
+
+    override fun getResources(): Resources {
+        val resources = super.getResources()
+        val configuration = Configuration()
+        configuration.setToDefaults()
+        resources.updateConfiguration(configuration, resources.displayMetrics)
+        return resources
+    }
 }

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

@@ -16,6 +16,7 @@ open class Actor {
     var text: String = ""
     var textColor = Color.BLACK
     var textAlign = Paint.Align.LEFT
+    var textSize = 25f
     var isDialogue = false
     var isMirror = false
     var opacity = 1.0f

+ 31 - 1
src/main/java/com/bomostory/sceneeditmodule/screen/draw/DrawActivity.kt

@@ -25,6 +25,7 @@ import com.kdanmobile.kdanbrushlib.model.KdanBrush
 import com.kdanmobile.kdanbrushlib.widget.DrawView
 import kotlinx.android.synthetic.main.activity_draw.*
 import kotlinx.android.synthetic.main.activity_scene_edit.*
+import kotlinx.android.synthetic.main.popupview_set_color.*
 import kotlinx.android.synthetic.main.popupview_set_color.view.*
 import kotlinx.android.synthetic.main.scene_brush_view.view.*
 
@@ -305,11 +306,22 @@ class DrawActivity : AppCompatActivity() , FileUtils.OnSaveActorImage{
         popupView.tv_set_color_g.text = popupView.sb_set_color_g.progress.toString()
         popupView.tv_set_color_b.text = popupView.sb_set_color_b.progress.toString()
         popupView.tv_set_color_a.text = popupView.sb_set_color_a.progress.toString()
-
+        popupView.iv_set_color_header.setBackgroundColor(
+                Color.argb(popupView.sb_set_color_a.progress,
+                        popupView.sb_set_color_r.progress,
+                        popupView.sb_set_color_g.progress,
+                        popupView.sb_set_color_b.progress)
+        )
         popupView.sb_set_color_r.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 if (fromUser) onColorRValueChanged(progress)
                 popupView.tv_set_color_r.text = progress.toString()
+                popupView.iv_set_color_header.setBackgroundColor(
+                        Color.argb(popupView.sb_set_color_a.progress,
+                                   popupView.sb_set_color_r.progress,
+                                   popupView.sb_set_color_g.progress,
+                                   popupView.sb_set_color_b.progress)
+                )
             }
 
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}
@@ -320,6 +332,12 @@ class DrawActivity : AppCompatActivity() , FileUtils.OnSaveActorImage{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 if (fromUser) onColorGValueChanged(progress)
                 popupView.tv_set_color_g.text = progress.toString()
+                popupView.iv_set_color_header.setBackgroundColor(
+                        Color.argb(popupView.sb_set_color_a.progress,
+                                popupView.sb_set_color_r.progress,
+                                popupView.sb_set_color_g.progress,
+                                popupView.sb_set_color_b.progress)
+                )
             }
 
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}
@@ -331,6 +349,12 @@ class DrawActivity : AppCompatActivity() , FileUtils.OnSaveActorImage{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 if (fromUser) onColorBValueChanged(progress)
                 popupView.tv_set_color_b.text = progress.toString()
+                popupView.iv_set_color_header.setBackgroundColor(
+                        Color.argb(popupView.sb_set_color_a.progress,
+                                popupView.sb_set_color_r.progress,
+                                popupView.sb_set_color_g.progress,
+                                popupView.sb_set_color_b.progress)
+                )
             }
 
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}
@@ -342,6 +366,12 @@ class DrawActivity : AppCompatActivity() , FileUtils.OnSaveActorImage{
             override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                 if (fromUser) onColorAValueChanged(progress)
                 popupView.tv_set_color_a.text = progress.toString()
+                popupView.iv_set_color_header.setBackgroundColor(
+                        Color.argb(popupView.sb_set_color_a.progress,
+                                popupView.sb_set_color_r.progress,
+                                popupView.sb_set_color_g.progress,
+                                popupView.sb_set_color_b.progress)
+                )
             }
 
             override fun onStartTrackingTouch(seekBar: SeekBar?) {}

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

@@ -4,6 +4,7 @@ import android.content.Context
 import android.graphics.*
 import android.graphics.drawable.BitmapDrawable
 import android.util.AttributeSet
+import android.util.Log
 import android.widget.ImageView
 import com.bomostory.sceneeditmodule.DialogueDrawer
 import com.bomostory.sceneeditmodule.ImageOperation
@@ -25,7 +26,8 @@ class ActorView : ImageView {
                         setImageDrawable(gifDrawable)
                         gifDrawable?.start()
                     } else {
-                        setImageBitmap(ImageOperation.imageOperation(BitmapFactory.decodeFile(it.resourcePath),it.hue,it.saturation.div(50),it.brightness.div(50)))
+                        val bitmap = BitmapFactory.decodeFile(it.resourcePath)
+                        setImageBitmap(ImageOperation.imageOperation(bitmap,it.hue,it.saturation.div(50),it.brightness.div(50)))
                     }
                 }
                 if (it.isMirror && !it.isDialogue) {

+ 4 - 0
src/main/java/com/bomostory/sceneeditmodule/screen/view/DialogueView.kt

@@ -151,6 +151,7 @@ class DialogueView : EditActorView{
                         text = dialogue.text
                         textColor = dialogue.textColor
                         textAlign = dialogue.textAlign
+                        textSize = dialogue.textSize
                         positionZ = dialogue.positionZ
                         isSelect = dialogue.isSelect
                         parentLayerIndex = dialogue.parentLayerIndex
@@ -220,6 +221,7 @@ class DialogueView : EditActorView{
                         text = dialogue.text
                         textColor = dialogue.textColor
                         textAlign = dialogue.textAlign
+                        textSize = dialogue.textSize
                         positionZ = dialogue.positionZ
                         isSelect = dialogue.isSelect
                         parentLayerIndex = dialogue.parentLayerIndex
@@ -287,6 +289,7 @@ class DialogueView : EditActorView{
                         text = dialogue.text
                         textColor = dialogue.textColor
                         textAlign = dialogue.textAlign
+                        textSize = dialogue.textSize
                         positionZ = dialogue.positionZ
                         isSelect = dialogue.isSelect
                         parentLayerIndex = dialogue.parentLayerIndex
@@ -354,6 +357,7 @@ class DialogueView : EditActorView{
                         text = dialogue.text
                         textColor = dialogue.textColor
                         textAlign = dialogue.textAlign
+                        textSize = dialogue.textSize
                         positionZ = dialogue.positionZ
                         isSelect = dialogue.isSelect
                         parentLayerIndex = dialogue.parentLayerIndex

+ 8 - 0
src/main/java/com/bomostory/sceneeditmodule/screen/view/EditActorView.kt

@@ -148,6 +148,7 @@ open class EditActorView @JvmOverloads constructor(
                         text = actor.text
                         textColor = actor.textColor
                         textAlign = actor.textAlign
+                        textSize = actor.textSize
                         positionZ = actor.positionZ
                         isSelect = actor.isSelect
                         parentLayerIndex = actor.parentLayerIndex
@@ -208,6 +209,8 @@ open class EditActorView @JvmOverloads constructor(
                         text = actor.text
                         textColor = actor.textColor
                         textAlign = actor.textAlign
+                        textSize = actor.textSize
+                        positionZ = actor.positionZ
                         positionZ = actor.positionZ
                         isSelect = actor.isSelect
                         parentLayerIndex = actor.parentLayerIndex
@@ -266,6 +269,8 @@ open class EditActorView @JvmOverloads constructor(
                         text = actor.text
                         textColor = actor.textColor
                         textAlign = actor.textAlign
+                        textSize = actor.textSize
+                        positionZ = actor.positionZ
                         positionZ = actor.positionZ
                         isSelect = actor.isSelect
                         parentLayerIndex = actor.parentLayerIndex
@@ -324,6 +329,8 @@ open class EditActorView @JvmOverloads constructor(
                         text = actor.text
                         textColor = actor.textColor
                         textAlign = actor.textAlign
+                        textSize = actor.textSize
+                        positionZ = actor.positionZ
                         positionZ = actor.positionZ
                         isSelect = actor.isSelect
                         parentLayerIndex = actor.parentLayerIndex
@@ -348,6 +355,7 @@ open class EditActorView @JvmOverloads constructor(
 
     override fun onDraw(canvas: Canvas?) {
         val mPaint = Paint()
+        setLayerType(LAYER_TYPE_SOFTWARE, null)
         if(actor.isSelect) {
             mPaint.style = Paint.Style.STROKE
             mPaint.strokeWidth = 5f

+ 2 - 0
src/main/java/com/bomostory/sceneeditmodule/screen/view/MovieView.kt

@@ -81,6 +81,8 @@ class MovieView : ConstraintLayout {
                             text = actor.text
                             textColor = actor.textColor
                             textAlign = actor.textAlign
+                            textSize = actor.textSize
+                            positionZ = actor.positionZ
                             isDialogue = actor.isDialogue
                             isMirror = actor.isMirror
                             opacity = actor.opacity

+ 0 - 3
src/main/res/drawable/btn_edit_text_dialog_circle_black.xml

@@ -12,9 +12,6 @@
                 android:width="2dp"
                 android:color="#ffffff" />
 
-            <size
-                android:width="24dp"
-                android:height="24dp"/>
         </shape>
     </item>
 </layer-list>

+ 0 - 3
src/main/res/drawable/btn_edit_text_dialog_circle_blue.xml

@@ -12,9 +12,6 @@
                 android:width="2dp"
                 android:color="#ffffff" />
 
-            <size
-                android:width="24dp"
-                android:height="24dp"/>
         </shape>
     </item>
 </layer-list>

+ 0 - 3
src/main/res/drawable/btn_edit_text_dialog_circle_green.xml

@@ -12,9 +12,6 @@
                 android:width="2dp"
                 android:color="#ffffff" />
 
-            <size
-                android:width="24dp"
-                android:height="24dp"/>
         </shape>
     </item>
 </layer-list>

+ 0 - 4
src/main/res/drawable/btn_edit_text_dialog_circle_red.xml

@@ -8,10 +8,6 @@
             <solid
                 android:color="#d0021b"/>
 
-            <stroke
-                android:width="1dp"
-                android:color="#ffffff" />
-
             <size
                 android:width="24dp"
                 android:height="24dp"/>

+ 0 - 3
src/main/res/drawable/btn_edit_text_dialog_circle_yellow.xml

@@ -12,9 +12,6 @@
                 android:width="2dp"
                 android:color="#ffffff" />
 
-            <size
-                android:width="24dp"
-                android:height="24dp"/>
         </shape>
     </item>
 </layer-list>

+ 3 - 1
src/main/res/layout/activity_draw.xml

@@ -30,8 +30,10 @@
 
     <com.bomostory.sceneeditmodule.navigationbar.brush.BrushView
         android:id="@+id/brush_view"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintBottom_toBottomOf="parent">
     </com.bomostory.sceneeditmodule.navigationbar.brush.BrushView>
     <!--<ImageView-->

+ 79 - 24
src/main/res/layout/dialogfragment_edit_text.xml

@@ -1,25 +1,36 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     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_width="850dp"
+        android:layout_height="200dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"/>
+    <android.support.constraint.ConstraintLayout
+        android:layout_width="0dp"
         android:layout_height="46dp"
         android:background="#212121"
+        app:layout_constraintTop_toBottomOf="@id/etv_text"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
         android:orientation="horizontal">
         <Button
+            android:id="@+id/btn_edit_dialog_ic_bold"
             android:drawableStart="@drawable/ic_bold"
             android:background="#212121"
             android:layout_marginRight="12dp"
-            android:layout_marginLeft="12dp"
+            android:layout_marginLeft="24dp"
             android:scaleType="center"
             android:layout_width="24dp"
-            android:layout_height="24dp"  />
+            android:layout_height="24dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toLeftOf="@+id/btn_edit_dialog_align_left"/>
         <ImageView
             android:id="@+id/btn_edit_dialog_align_left"
             android:src="@drawable/ic_alignleft_w"
@@ -29,7 +40,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/btn_edit_dialog_ic_bold"
+            app:layout_constraintRight_toLeftOf="@+id/btn_edit_dialog_align_center"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/btn_edit_dialog_align_center"
             android:src="@drawable/ic_aligncenter"
@@ -39,7 +53,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/btn_edit_dialog_align_left"
+            app:layout_constraintRight_toLeftOf="@+id/btn_edit_dialog_align_right"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/btn_edit_dialog_align_right"
             android:src="@drawable/ic_alignright"
@@ -49,7 +66,22 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp"/>
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/btn_edit_dialog_align_center"
+            app:layout_constraintRight_toLeftOf="@+id/seek_bar_dialog_view_size"
+            app:layout_constraintTop_toTopOf="parent"/>
+        <android.support.v7.widget.AppCompatSeekBar
+            android:id="@+id/seek_bar_dialog_view_size"
+            android:layout_width="180dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="12dp"
+            android:layout_marginLeft="12dp"
+            android:thumbTint="@color/white"
+            app:layout_constraintHorizontal_bias="0.5"
+            app:layout_constraintLeft_toRightOf="@id/btn_edit_dialog_align_right"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_red"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_red"
             android:src="@drawable/btn_edit_text_dialog_circle_red"
@@ -58,7 +90,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/seek_bar_dialog_view_size"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_yellow"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_yellow"
             android:src="@drawable/btn_edit_text_dialog_circle_yellow"
@@ -67,7 +102,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/iv_edit_text_red"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_blue"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_blue"
             android:src="@drawable/btn_edit_text_dialog_circle_blue"
@@ -76,7 +114,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/iv_edit_text_yellow"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_green"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_green"
             android:src="@drawable/btn_edit_text_dialog_circle_green"
@@ -85,7 +126,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/iv_edit_text_blue"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_black"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_black"
             android:src="@drawable/btn_edit_text_dialog_circle_black"
@@ -95,7 +139,10 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/iv_edit_text_green"
+            app:layout_constraintRight_toLeftOf="@+id/iv_edit_text_tune"
+            app:layout_constraintTop_toTopOf="parent"/>
         <ImageView
             android:id="@+id/iv_edit_text_tune"
             android:src="@drawable/ic_tune"
@@ -104,13 +151,21 @@
             android:layout_marginLeft="12dp"
             android:scaleType="center"
             android:layout_width="30dp"
-            android:layout_height="30dp" />
+            android:layout_height="30dp"
+            app:layout_constraintLeft_toRightOf="@id/iv_edit_text_black"
+            app:layout_constraintRight_toLeftOf="@+id/btn_edit_dialog_done"
+            app:layout_constraintTop_toTopOf="parent"/>
        <Button
-            android:id="@+id/btn_edit_dialog_done"
-            android:text="@string/uikit_edit_done"
-            android:textColor="#ffecb3"
-            android:background="#212121"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-    </LinearLayout>
-</LinearLayout>
+           android:id="@+id/btn_edit_dialog_done"
+           android:text="@string/uikit_edit_done"
+           android:textColor="#ffecb3"
+           android:background="#212121"
+           android:layout_marginRight="24dp"
+           android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           app:layout_constraintRight_toRightOf="parent"
+           app:layout_constraintLeft_toRightOf="@id/iv_edit_text_tune"
+           app:layout_constraintTop_toTopOf="parent"
+           app:layout_constraintBottom_toBottomOf="parent"/>
+    </android.support.constraint.ConstraintLayout>
+</android.support.constraint.ConstraintLayout>

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

@@ -71,6 +71,7 @@
         android:layout_height="wrap_content"
         android:text="@string/uikit_edit_size"
         android:textColor="#ffffff"
+        android:layout_marginTop="4dp"
         app:layout_constraintLeft_toLeftOf="@+id/seek_bar_brush_view_size"
         app:layout_constraintBottom_toTopOf="@id/seek_bar_brush_view_size"
         app:layout_constraintTop_toTopOf="parent" />
@@ -79,7 +80,9 @@
         android:id="@+id/seek_bar_brush_view_size"
         android:layout_width="180dp"
         android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
         android:layout_marginLeft="36dp"
+        android:thumbTint="@color/white"
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_brush5"
         app:layout_constraintRight_toLeftOf="@+id/iv_brush_view_color1"
@@ -90,6 +93,7 @@
         android:layout_width="30dp"
         android:layout_height="30dp"
         android:layout_marginLeft="30dp"
+        android:layout_marginTop="4dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color1"
         app:layout_constraintLeft_toRightOf="@+id/seek_bar_brush_view_size"
@@ -100,6 +104,7 @@
         android:id="@+id/iv_brush_view_color2"
         android:layout_width="30dp"
         android:layout_height="30dp"
+        android:layout_marginTop="4dp"
         android:layout_marginLeft="30dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color2"
@@ -112,6 +117,7 @@
         android:layout_width="30dp"
         android:layout_height="30dp"
         android:layout_marginLeft="30dp"
+        android:layout_marginTop="4dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color3"
         app:layout_constraintLeft_toRightOf="@id/iv_brush_view_color2"
@@ -123,6 +129,7 @@
         android:layout_width="30dp"
         android:layout_height="30dp"
         android:layout_marginLeft="30dp"
+        android:layout_marginTop="4dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color4"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_color3"
@@ -134,6 +141,7 @@
         android:layout_width="30dp"
         android:layout_height="30dp"
         android:layout_marginLeft="30dp"
+        android:layout_marginTop="4dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color5"
         app:layout_constraintLeft_toRightOf="@+id/iv_brush_view_color4"
@@ -145,6 +153,7 @@
         android:layout_width="30dp"
         android:layout_height="30dp"
         android:layout_marginBottom="4dp"
+        android:layout_marginTop="4dp"
         android:scaleType="center"
         android:src="@drawable/btn_edit_brush_color_circle_color6"
         app:layout_constraintBottom_toBottomOf="parent"