Explorar o código

Fix record not delete bug

cooperku_kdanmobile %!s(int64=6) %!d(string=hai) anos
pai
achega
93a7f5e8d3

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

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