Browse Source

Fix record not delete bug

cooperku_kdanmobile 6 years ago
parent
commit
93a7f5e8d3

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

@@ -597,14 +597,14 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
 
 
     private fun initRecord(){
     private fun initRecord(){
         var recordPath: String? = null
         var recordPath: String? = null
-        startRecord.setOnClickListener(View.OnClickListener {
+        startRecord.setOnClickListener {
             if (!isRecord) {
             if (!isRecord) {
                 //  delete record
                 //  delete record
                 project.story?.let {
                 project.story?.let {
                     it.scenes?.let{
                     it.scenes?.let{
-                        it[currentSceneIndex].record = null
                         if (it[currentSceneIndex].recordPath != null)
                         if (it[currentSceneIndex].recordPath != null)
                             File(it[currentSceneIndex].recordPath).delete()
                             File(it[currentSceneIndex].recordPath).delete()
+                        it[currentSceneIndex].record = null
                     }
                     }
                 }
                 }
                 recordPath = getRecordFilePath()
                 recordPath = getRecordFilePath()
@@ -675,7 +675,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
                 initControlSceneView()
                 initControlSceneView()
                 initRecordFinishView()
                 initRecordFinishView()
             }
             }
-        })
+        }
     }
     }
 
 
     private fun initRecordFinishView(){
     private fun initRecordFinishView(){