|
@@ -1,6 +1,7 @@
|
|
package com.example.tfat.myapplication
|
|
package com.example.tfat.myapplication
|
|
|
|
|
|
import android.app.Activity
|
|
import android.app.Activity
|
|
|
|
+import android.app.AlertDialog
|
|
import android.app.ProgressDialog
|
|
import android.app.ProgressDialog
|
|
import android.content.Context
|
|
import android.content.Context
|
|
import android.content.DialogInterface
|
|
import android.content.DialogInterface
|
|
@@ -153,6 +154,10 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
|
|
|
|
override fun onResume() {
|
|
override fun onResume() {
|
|
super.onResume()
|
|
super.onResume()
|
|
|
|
+ hideStatusBar()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private fun hideStatusBar(){
|
|
window.decorView.apply {
|
|
window.decorView.apply {
|
|
systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
@@ -163,7 +168,6 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
|
|
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
private fun initResource(){
|
|
private fun initResource(){
|
|
resourceThemeBitmap = when(intent.getStringExtra("resource_actor")) {
|
|
resourceThemeBitmap = when(intent.getStringExtra("resource_actor")) {
|
|
null -> {
|
|
null -> {
|
|
@@ -295,21 +299,47 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
newSceneRecyclerView.adapter = addSceneAdapter
|
|
newSceneRecyclerView.adapter = addSceneAdapter
|
|
})
|
|
})
|
|
editSceneView.setOnClickDeleteListener(View.OnClickListener {
|
|
editSceneView.setOnClickDeleteListener(View.OnClickListener {
|
|
- project.story?.let {
|
|
|
|
- it.scenes?.let{
|
|
|
|
- if (it.size <= 1) { return@let }
|
|
|
|
- it.removeAt(currentSceneIndex)
|
|
|
|
- when(currentSceneIndex >= it.size){
|
|
|
|
- true -> {
|
|
|
|
- currentSceneIndex = 0
|
|
|
|
- sceneEditView.scene = it[0]
|
|
|
|
|
|
+ var builder = AlertDialog.Builder(this@SceneEditActivity).apply {
|
|
|
|
+ setTitle(resources.getString(R.string.delete_check))
|
|
|
|
+ setPositiveButton(R.string.uikit_others_yes) { dialog, whichButton ->
|
|
|
|
+ project.story?.let {
|
|
|
|
+ it.scenes?.let{
|
|
|
|
+ if (it.size <= 1) { return@let }
|
|
|
|
+ it.removeAt(currentSceneIndex)
|
|
|
|
+ when(currentSceneIndex >= it.size){
|
|
|
|
+ true -> {
|
|
|
|
+ currentSceneIndex = 0
|
|
|
|
+ sceneEditView.scene = it[0]
|
|
|
|
+ }
|
|
|
|
+ false -> sceneEditView.scene = it[currentSceneIndex]
|
|
|
|
+ }
|
|
|
|
+ initNavigationBarView(currentSceneIndex)
|
|
|
|
+ setControlSceneView()
|
|
}
|
|
}
|
|
- false -> sceneEditView.scene = it[currentSceneIndex]
|
|
|
|
}
|
|
}
|
|
- initNavigationBarView(currentSceneIndex)
|
|
|
|
- setControlSceneView()
|
|
|
|
|
|
+ window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
|
|
|
+ WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
|
|
|
+ actionBar?.hide()
|
|
|
|
+ supportActionBar?.hide()
|
|
|
|
+ hideStatusBar()
|
|
|
|
+ }
|
|
|
|
+ setNegativeButton(R.string.uikit_others_not) { dialog, whichButton ->
|
|
|
|
+ window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
|
|
|
+ WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
|
|
|
+ actionBar?.hide()
|
|
|
|
+ supportActionBar?.hide()
|
|
|
|
+ hideStatusBar()
|
|
|
|
+ }
|
|
|
|
+ setOnDismissListener {
|
|
|
|
+ window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
|
|
|
+ WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
|
|
|
+ actionBar?.hide()
|
|
|
|
+ supportActionBar?.hide()
|
|
|
|
+ hideStatusBar()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ val dialog: AlertDialog = builder.create()
|
|
|
|
+ dialog.show()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -823,7 +853,7 @@ class SceneEditActivity : AppCompatActivity(), ActorAdapter.OnActorDragListener,
|
|
project.story?.let {
|
|
project.story?.let {
|
|
it.scenes?.let{
|
|
it.scenes?.let{
|
|
scene.sceneWidth = monitorSize.widthPixels
|
|
scene.sceneWidth = monitorSize.widthPixels
|
|
- it.add(scene)
|
|
|
|
|
|
+ it.add(currentSceneIndex + 1,scene)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|