Procházet zdrojové kódy

Merge branch 'transparent-dialog-fix-issue'

faterhenry před 6 roky
rodič
revize
a2077a31c5

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

@@ -44,7 +44,7 @@ object DialogueDrawer {
                         data.sideHeight.toFloat() - valuePaddingInPixels), null)
             }
         } else {
-            throw IllegalArgumentException("unsupported drawable type")
+            //for Transparent dialogue case, do nothing
         }
         val textPositionX: Float
         val textPositionY: Float

+ 12 - 3
src/main/java/com/bomostory/sceneeditmodule/SceneEditActivity.kt

@@ -820,7 +820,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 sceneEditView.scene = it[currentSceneIndex]
             }
         }
-        setActorDropLayer()
+        viewContainer.removeAllViews()
         sceneEditView.setLayerVisible(currentLayerIndex)
     }
 
@@ -840,7 +840,8 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 sceneEditView.scene = it[currentSceneIndex]
             }
         }
-        sceneEditView.findViewById<LayerView>(currentLayerIndex).setOnDragListener(objectDragListener())
+        sceneEditView.setLayerVisible(currentLayerIndex)
+        viewContainer.removeAllViews()
     }
     private fun addDialogue(positionX: Int, positionY: Int, resource: Int) {
         project.story?.let {
@@ -859,9 +860,14 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 dialog.dialogColor = DialogueColorData.getDialogColorType(resource).second
                 it[currentSceneIndex].layers[currentLayerIndex].actors.add(dialog)
                 sceneEditView.scene = it[currentSceneIndex]
+                editTextDialog = EditTextDialog()
+                editTextDialog.setCallBack(this)
+                editTextDialog.setDialogue(dialog)
+                editTextDialog.show(supportFragmentManager,LAYER_MANAGEMENT)
             }
         }
-        sceneEditView.findViewById<LayerView>(currentLayerIndex).setOnDragListener(dragListener())
+        sceneEditView.setLayerVisible(currentLayerIndex)
+        viewContainer.removeAllViews()
     }
     override fun onActorDropFinish(positionX: Int, positionY: Int, resourcePath: String) {
         addActor(positionX, positionY, resourcePath)
@@ -1425,6 +1431,9 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                     or View.SYSTEM_UI_FLAG_LOW_PROFILE
                     or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
         }
+        sceneEditView.setLayerVisible(currentLayerIndex)
+        viewContainer.removeAllViews()
+        startRecord.visibility = View.VISIBLE
     }
 
     override fun onSelectBrush(brush: Brush?) {

+ 6 - 0
src/main/java/com/bomostory/sceneeditmodule/navigationbar/dialogue/DialogueView.kt

@@ -41,6 +41,7 @@ class DialogueView: LinearLayout{
         }
         this.dialogueData.apply {
             clear()
+            add(R.drawable.dialog_transparent)
             add(R.drawable.ic_speechbubble_w1)
             add(R.drawable.ic_speechbubble_w2)
             add(R.drawable.ic_speechbubble_w3)
@@ -61,6 +62,7 @@ class DialogueView: LinearLayout{
         iv_dialogue_view_white.setOnClickListener {
             this.dialogueData.apply {
                 clear()
+                add(R.drawable.dialog_transparent)
                 add(R.drawable.ic_speechbubble_w1)
                 add(R.drawable.ic_speechbubble_w2)
                 add(R.drawable.ic_speechbubble_w3)
@@ -82,6 +84,7 @@ class DialogueView: LinearLayout{
         iv_dialogue_view_blue.setOnClickListener {
             this.dialogueData.apply {
                 clear()
+                add(R.drawable.dialog_transparent)
                 add(R.drawable.ic_speechbubble_b1)
                 add(R.drawable.ic_speechbubble_b2)
                 add(R.drawable.ic_speechbubble_b3)
@@ -102,6 +105,7 @@ class DialogueView: LinearLayout{
         iv_dialogue_view_yellow.setOnClickListener {
             this.dialogueData.apply {
                 clear()
+                add(R.drawable.dialog_transparent)
                 add(R.drawable.ic_speechbubble_y1)
                 add(R.drawable.ic_speechbubble_y2)
                 add(R.drawable.ic_speechbubble_y3)
@@ -122,6 +126,7 @@ class DialogueView: LinearLayout{
         iv_dialogue_view_green.setOnClickListener {
             this.dialogueData.apply {
                 clear()
+                add(R.drawable.dialog_transparent)
                 add(R.drawable.ic_speechbubble_g1)
                 add(R.drawable.ic_speechbubble_g2)
                 add(R.drawable.ic_speechbubble_g3)
@@ -142,6 +147,7 @@ class DialogueView: LinearLayout{
         iv_dialogue_view_orange.setOnClickListener {
             this.dialogueData.apply {
                 clear()
+                add(R.drawable.dialog_transparent)
                 add(R.drawable.ic_speechbubble_r1)
                 add(R.drawable.ic_speechbubble_r2)
                 add(R.drawable.ic_speechbubble_r3)

+ 11 - 0
src/main/res/drawable/dialog_transparent.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+        <solid android:color="#00FFFFFF"></solid>
+        <stroke
+            android:width="1dp"
+    android:dashGap="2dp"
+    android:dashWidth="3dp"
+            android:color="#FFFFFF"></stroke>
+        <corners android:radius="4dp" />
+    </shape>