ソースを参照

[fix] Scene can't be edit when Scene is recorded

faterhenry 6 年 前
コミット
d250118822

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

@@ -116,6 +116,16 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     private fun initControlBarView() {
         controlBarView.setBtnSelected(6)
         switchToPreViewLayer()
+        project.story?.let {
+            it.scenes?.let {
+                if (it[currentSceneIndex].record != null) {
+                    controlBarView.visibility = View.INVISIBLE
+                    sceneEditView.setOnTouchListener(null)
+                } else {
+                    controlBarView.visibility = View.VISIBLE
+                }
+            }
+        }
         controlBarView.setonClickSwipeLayerBtn(View.OnClickListener {
             switchToPreViewLayer()
         })
@@ -147,7 +157,6 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
         })
     }
 
-    //TFAT
     private fun initNavigationBarView() {
         project.story?.let {
             it.scenes?.let {
@@ -347,6 +356,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 }
                 startRecord.setImageDrawable(resources.getDrawable(R.drawable.ic_btn_record))
                 navigationBar.visibility = View.VISIBLE
+                initControlBarView()
                 initControlSceneView()
                 initRecordFinishView()
             }
@@ -463,7 +473,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
     private fun addScene(position: Int): View.OnClickListener {
         return View.OnClickListener {
             var scene = Scene()
-            for (i in 0 until 5){
+            for (i in 5 until 0){
                 val layer = Layer()
                 layer.id = i
                 scene.layers.add(layer)