|
@@ -23,6 +23,7 @@ import com.bomostory.sceneeditmodule.SuperMovieMaker
|
|
import com.bomostory.sceneeditmodule.basicdata.Music
|
|
import com.bomostory.sceneeditmodule.basicdata.Music
|
|
import com.bomostory.sceneeditmodule.basicdata.Project
|
|
import com.bomostory.sceneeditmodule.basicdata.Project
|
|
import com.bomostory.sceneeditmodule.basicdata.Scene
|
|
import com.bomostory.sceneeditmodule.basicdata.Scene
|
|
|
|
+import com.bomostory.sceneeditmodule.cover.CoverEditorDialog
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicEditDialog
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicEditDialog
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicSelectDialog
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicSelectDialog
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicSelectFragment
|
|
import com.bomostory.sceneeditmodule.screen.movie.music.MusicSelectFragment
|
|
@@ -379,9 +380,61 @@ class MovieEditActivity : AppCompatActivity(),
|
|
}
|
|
}
|
|
onClickExportPdf = Runnable { onClickExportPdf() }
|
|
onClickExportPdf = Runnable { onClickExportPdf() }
|
|
onClickPrint = Runnable { onClickPrint() }
|
|
onClickPrint = Runnable { onClickPrint() }
|
|
|
|
+ onClickEditCover = Runnable { onClickEditCover(project) }
|
|
}.show(supportFragmentManager)
|
|
}.show(supportFragmentManager)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun onClickEditCover(project: Project) {
|
|
|
|
+ val dialog = CoverEditorDialog()
|
|
|
|
+ dialog.project = project
|
|
|
|
+ dialog.onViewCreated = Runnable {
|
|
|
|
+ dialog.apply {
|
|
|
|
+ val oldName = project.name ?: ""
|
|
|
|
+ onSave = View.OnClickListener { it ->
|
|
|
|
+ if (storyName == "") {
|
|
|
|
+ showEmptyProjectNameMsg()
|
|
|
|
+ /** TODO: 目前不支援 rename **/
|
|
|
|
+ /**
|
|
|
|
+ } else if (storyName != oldName && viewModel.isProjectNameExist(storyName)) {
|
|
|
|
+ showDuplicatedProjectNameMsg()
|
|
|
|
+ **/
|
|
|
|
+ } else {
|
|
|
|
+ if (coverFile == null) {
|
|
|
|
+ project.coverFile = null
|
|
|
|
+ } else {
|
|
|
|
+ project.coverFile = coverFile
|
|
|
|
+ }
|
|
|
|
+ project.name = storyName
|
|
|
|
+ project.author = author
|
|
|
|
+ project.frontCoverColor = frontCoverColor
|
|
|
|
+ project.backCoverColor = backCoverColor
|
|
|
|
+ project.category = category
|
|
|
|
+
|
|
|
|
+ val context = this@MovieEditActivity
|
|
|
|
+ val pd = ProgressDialog(context)
|
|
|
|
+ viewModel.saveProject(context, project, oldName)
|
|
|
|
+ .doOnSubscribe { pd.show() }
|
|
|
|
+ .doFinally { pd.dismiss() }
|
|
|
|
+ .subscribe {
|
|
|
|
+// projectManager.reloadProjects()
|
|
|
|
+ dismiss()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ coverFile = project.coverFile
|
|
|
|
+ onCancel = View.OnClickListener { this.dismiss() }
|
|
|
|
+ storyName = project.name ?: ""
|
|
|
|
+ author = project.author ?: ""
|
|
|
|
+ category = project.category
|
|
|
|
+ if (project.coverFile == null) {
|
|
|
|
+ frontCoverColor = project.frontCoverColor
|
|
|
|
+ }
|
|
|
|
+ backCoverColor = project.backCoverColor
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dialog.show(supportFragmentManager)
|
|
|
|
+ }
|
|
|
|
+
|
|
private fun onClickPrint() {
|
|
private fun onClickPrint() {
|
|
ExportPdfDialog().also { exportPdfDialog ->
|
|
ExportPdfDialog().also { exportPdfDialog ->
|
|
exportPdfDialog.project = viewModel.project!!
|
|
exportPdfDialog.project = viewModel.project!!
|