Browse Source

New: add music edit listener to button edit panel

Shan-PC\Shan 6 năm trước cách đây
mục cha
commit
473418c258

+ 5 - 0
src/main/java/com/bomostory/sceneeditmodule/MovieEditActivity.kt

@@ -140,6 +140,7 @@ class MovieEditActivity : AppCompatActivity(), DialogInterface.OnDismissListener
         movieEditView.onPlayClickListener = View.OnClickListener(this::playMovie)
         movieEditView.onPauseClickListener = View.OnClickListener(this::pauseMovie)
         movieEditView.onAddMusicClickListener = View.OnClickListener(this::addMusic)
+        movieEditView.onEditMusicClickListener = View.OnClickListener(this::editMusic)
         movieEditView.onDeleteMusicClickListener = View.OnClickListener(this::deleteMusic)
         movieEditView.onSaveMovieClickListener = View.OnClickListener(this::saveMovie)
         movieEditView.onSeekBarChangeListener = object : SeekBar.OnSeekBarChangeListener {
@@ -234,6 +235,10 @@ class MovieEditActivity : AppCompatActivity(), DialogInterface.OnDismissListener
         musicSelectDialog.show(supportFragmentManager, MUSIC_SELECT_DIALOG_TAG)
     }
 
+    private fun editMusic(view:View){
+        Log.d("Debug","edit music track $currentAudioPosition")
+    }
+
     private fun deleteMusic(view: View) {
         if (currentAudioPosition in 0 until musics.size) {
             moviePlayer.init()

+ 5 - 0
src/main/java/com/bomostory/sceneeditmodule/view/MovieEditBtnPanelView.kt

@@ -41,6 +41,11 @@ class MovieEditBtnPanelView : ConstraintLayout {
             addMusic.setOnClickListener(value)
         }
 
+    var onEditMusicClickListener: OnClickListener? = null
+        set(value) {
+            edit.setOnClickListener(value)
+        }
+
     var onDeleteMusicClickListener: OnClickListener? = null
         set(value) {
             delete.setOnClickListener(value)

+ 5 - 0
src/main/java/com/bomostory/sceneeditmodule/view/MovieEditView.kt

@@ -63,6 +63,11 @@ class MovieEditView : ConstraintLayout {
             movieEditBtnPanel.onAddMusicClickListener = value
         }
 
+    var onEditMusicClickListener: OnClickListener? = null
+        set(value) {
+            movieEditBtnPanel.onEditMusicClickListener = value
+        }
+
     var onSaveMovieClickListener: OnClickListener? = null
         set(value) {
             movieEditBtnPanel.onSaveMovieClickListener = value