|
@@ -30,6 +30,7 @@ import com.bomostory.sceneeditmodule.utils.FileUtils
|
|
import com.bomostory.sceneeditmodule.view.LayerView
|
|
import com.bomostory.sceneeditmodule.view.LayerView
|
|
import android.util.DisplayMetrics
|
|
import android.util.DisplayMetrics
|
|
import com.bomostory.sceneeditmodule.MovieEditActivity
|
|
import com.bomostory.sceneeditmodule.MovieEditActivity
|
|
|
|
+import com.bomostory.sceneeditmodule.view.OnTouchSceneListener
|
|
import com.example.tfat.myapplication.navigationbar.EditSceneView
|
|
import com.example.tfat.myapplication.navigationbar.EditSceneView
|
|
import com.example.tfat.myapplication.navigationbar.RecordFinishView
|
|
import com.example.tfat.myapplication.navigationbar.RecordFinishView
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
@@ -38,7 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList
|
|
|
|
|
|
class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener, EditActorView.OnActorChangeListener,
|
|
class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener, EditActorView.OnActorChangeListener,
|
|
OnTouchBoMoSceneListener.OnSceneMoveListener, DialogInterface.OnDismissListener, FileUtils.OnSaveActorImage,
|
|
OnTouchBoMoSceneListener.OnSceneMoveListener, DialogInterface.OnDismissListener, FileUtils.OnSaveActorImage,
|
|
- LayerManagementDialog.OnLayerChange {
|
|
|
|
|
|
+ OnTouchSceneListener.OnSceneTouchListener,LayerManagementDialog.OnLayerChange {
|
|
|
|
|
|
private lateinit var project: Project
|
|
private lateinit var project: Project
|
|
private var currentSceneIndex = 0
|
|
private var currentSceneIndex = 0
|
|
@@ -407,6 +408,15 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
|
|
|
private fun switchLayer(layerIndex: Int){
|
|
private fun switchLayer(layerIndex: Int){
|
|
viewContainer.removeAllViews()
|
|
viewContainer.removeAllViews()
|
|
|
|
+ if(currentLayerIndex != 6) {
|
|
|
|
+ project.story?.let {
|
|
|
|
+ it.scenes?.let {
|
|
|
|
+ for (i in 0 until it[currentSceneIndex].layers[currentLayerIndex].actors.size) {
|
|
|
|
+ it[currentSceneIndex].layers[currentLayerIndex].actors[i].isSelect = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
currentLayerIndex = layerIndex
|
|
currentLayerIndex = layerIndex
|
|
controlBarView.setBtnSelected(4 - layerIndex)
|
|
controlBarView.setBtnSelected(4 - layerIndex)
|
|
project.story?.let {
|
|
project.story?.let {
|
|
@@ -423,10 +433,13 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- sceneEditView.setOnTouchListener(null)
|
|
|
|
|
|
+ val sceneListener = OnTouchSceneListener()
|
|
|
|
+ sceneListener.setCallBack(this)
|
|
|
|
+ sceneEditView.setOnTouchListener(sceneListener)
|
|
sceneEditView.x = 0
|
|
sceneEditView.x = 0
|
|
setActorDropLayer()
|
|
setActorDropLayer()
|
|
sceneEditView.setLayerVisible(layerIndex)
|
|
sceneEditView.setLayerVisible(layerIndex)
|
|
@@ -532,6 +545,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
setActorDropLayer()
|
|
setActorDropLayer()
|
|
|
|
+ sceneEditView.setLayerVisible(currentLayerIndex)
|
|
}
|
|
}
|
|
|
|
|
|
private fun addDialogue(positionX: Int, positionY: Int, resource: Int) {
|
|
private fun addDialogue(positionX: Int, positionY: Int, resource: Int) {
|
|
@@ -563,6 +577,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ sceneEditView.setLayerVisible(currentLayerIndex)
|
|
}
|
|
}
|
|
|
|
|
|
override fun onActorSelected(actor: Actor) {
|
|
override fun onActorSelected(actor: Actor) {
|
|
@@ -579,6 +594,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ sceneEditView.setLayerVisible(currentLayerIndex)
|
|
}
|
|
}
|
|
|
|
|
|
override fun onActorLongClick(actor: Actor) {
|
|
override fun onActorLongClick(actor: Actor) {
|
|
@@ -595,6 +611,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
sceneEditView.scene = it[currentSceneIndex]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ sceneEditView.setLayerVisible(currentLayerIndex)
|
|
var popupWindow = PopupWindow(this)
|
|
var popupWindow = PopupWindow(this)
|
|
val popupView = LayoutInflater.from(this).inflate(R.layout.control_actor_dialog, null)
|
|
val popupView = LayoutInflater.from(this).inflate(R.layout.control_actor_dialog, null)
|
|
popupView.duplicate.setOnClickListener{
|
|
popupView.duplicate.setOnClickListener{
|
|
@@ -742,4 +759,20 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
return@OnDragListener true
|
|
return@OnDragListener true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ override fun onSceneTouch(){
|
|
|
|
+ unSelectActor()
|
|
|
|
+ sceneEditView.setLayerVisible(currentLayerIndex)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private fun unSelectActor(){
|
|
|
|
+ project.story?.let {
|
|
|
|
+ it.scenes?.let {
|
|
|
|
+ for(i in 0 until it[currentSceneIndex].layers[currentLayerIndex].actors.size){
|
|
|
|
+ it[currentSceneIndex].layers[currentLayerIndex].actors[i].isSelect = false
|
|
|
|
+ }
|
|
|
|
+ sceneEditView.scene = it[currentSceneIndex]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|