Browse Source

Merge branch 'feature_movie_edit_muti_language'

liweihao 6 years ago
parent
commit
3a99b5f848

+ 3 - 3
src/main/java/com/bomostory/sceneeditmodule/screen/movie/MovieEditActivity.kt

@@ -125,7 +125,7 @@ class MovieEditActivity : AppCompatActivity(),
         setContentView(R.layout.activity_movie_edit)
         setContentView(R.layout.activity_movie_edit)
 
 
         progressDialog = ProgressDialog(this).apply {
         progressDialog = ProgressDialog(this).apply {
-            setMessage("progressing")
+            setMessage(getString(R.string.progressing))
             setCancelable(false)
             setCancelable(false)
         }
         }
 
 
@@ -546,7 +546,7 @@ class MovieEditActivity : AppCompatActivity(),
         val pd = ProgressDialog(this).apply {
         val pd = ProgressDialog(this).apply {
             val t = viewModel.storyPeriodLiveData.value ?: 0
             val t = viewModel.storyPeriodLiveData.value ?: 0
             max = (t / 33).toInt()
             max = (t / 33).toInt()
-            setMessage("progressing")
+            setMessage(getString(R.string.progressing))
             setOnCancelListener {
             setOnCancelListener {
                 disposable?.dispose()
                 disposable?.dispose()
                 onMovieSavedListener.onSaved(outputFile)
                 onMovieSavedListener.onSaved(outputFile)
@@ -600,7 +600,7 @@ class MovieEditActivity : AppCompatActivity(),
                 .subscribe({
                 .subscribe({
                     val progress = (it * 100).toInt()
                     val progress = (it * 100).toInt()
                     val msg = if (progress >= 100) {
                     val msg = if (progress >= 100) {
-                        "processing ..."
+                        getString(R.string.progressing)
                     } else {
                     } else {
                         "$progress%"
                         "$progress%"
                     }
                     }

+ 2 - 2
src/main/java/com/bomostory/sceneeditmodule/screen/movie/music/MusicEditDialog.kt

@@ -87,7 +87,7 @@ class MusicEditDialog : DialogFragment() {
                 startTime.text = TimeUtils.getPlayMovieTimeFormat(0)
                 startTime.text = TimeUtils.getPlayMovieTimeFormat(0)
                 endTime.text = TimeUtils.getPlayMovieTimeFormat(it.endTime)
                 endTime.text = TimeUtils.getPlayMovieTimeFormat(it.endTime)
                 volumeSeekBar.progress = (it.volume * volumeSeekBar.max).toInt()
                 volumeSeekBar.progress = (it.volume * volumeSeekBar.max).toInt()
-                volumeText.text = "${volumeSeekBar.progress} %"
+                volumeText.text = getString(R.string.volume_percentage, volumeSeekBar.progress)
 
 
                 play.setOnClickListener { _ ->
                 play.setOnClickListener { _ ->
                     val startPosition = it.duration * headScrollRatio
                     val startPosition = it.duration * headScrollRatio
@@ -114,7 +114,7 @@ class MusicEditDialog : DialogFragment() {
 
 
                 volumeSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                 volumeSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                     override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
                     override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-                        volumeText.text = "$p1 %"
+                        volumeText.text = getString(R.string.volume_percentage, p1)
 
 
                         val volume = p1.toFloat() / volumeSeekBar.max.toFloat()
                         val volume = p1.toFloat() / volumeSeekBar.max.toFloat()
                         listener?.onMusicVolumeChanged(volume)
                         listener?.onMusicVolumeChanged(volume)

+ 2 - 2
src/main/java/com/bomostory/sceneeditmodule/screen/movie/music/MusicSelectDialog.kt

@@ -80,8 +80,8 @@ class MusicSelectDialog : DialogFragment() {
 
 
         override fun getPageTitle(position: Int): CharSequence? {
         override fun getPageTitle(position: Int): CharSequence? {
             when (position) {
             when (position) {
-                0 -> return "Library"
-                1 -> return "Device"
+                0 -> return getString(R.string.library)
+                1 -> return getString(R.string.device)
             }
             }
             return super.getPageTitle(position)
             return super.getPageTitle(position)
         }
         }

+ 2 - 3
src/main/java/com/bomostory/sceneeditmodule/share/ShareDialog.kt

@@ -43,7 +43,6 @@ class ShareDialog : DialogFragment() {
     var onClickFacebook = Runnable {}
     var onClickFacebook = Runnable {}
     var onClickTwitter = Runnable {}
     var onClickTwitter = Runnable {}
     var onClickMore = Runnable {}
     var onClickMore = Runnable {}
-    var onClickPlay = Runnable {}
 
 
 
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
@@ -94,7 +93,7 @@ class ShareDialog : DialogFragment() {
                                 activity?.runOnUiThread {
                                 activity?.runOnUiThread {
                                     if (!isPause) {
                                     if (!isPause) {
                                         seekBarMoviePlay.progress = videoShareDialogPreview.currentPosition
                                         seekBarMoviePlay.progress = videoShareDialogPreview.currentPosition
-                                        tv_shareDialog_time?.text = "${TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.progress.toLong())}/${TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.max.toLong())}"
+                                        tv_shareDialog_time?.text = getString(R.string.preview_progress_time,TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.progress.toLong()),TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.max.toLong()))
                                     }
                                     }
                                 }
                                 }
                             }
                             }
@@ -111,7 +110,7 @@ class ShareDialog : DialogFragment() {
                     isPause = true
                     isPause = true
                 }
                 }
 
 
-                tv_shareDialog_time?.text = "${TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.progress.toLong())}/${TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.max.toLong())}"
+                tv_shareDialog_time?.text = getString(R.string.preview_progress_time,TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.progress.toLong()),TimeUtils.getPlayMovieTimeFormat(seekBarMoviePlay.max.toLong()))
 
 
                 seekBarMoviePlay.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                 seekBarMoviePlay.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                     override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
                     override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {

+ 5 - 6
src/main/res/layout/dialog_share.xml

@@ -17,7 +17,6 @@
         app:layout_constraintTop_toTopOf="parent" />
         app:layout_constraintTop_toTopOf="parent" />
 
 
     <TextView
     <TextView
-
         android:id="@+id/tv_shareDialog_name"
         android:id="@+id/tv_shareDialog_name"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
@@ -130,7 +129,6 @@
 
 
     <ImageView
     <ImageView
         android:id="@+id/iv_shareDialog_youtube"
         android:id="@+id/iv_shareDialog_youtube"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
         android:layout_marginLeft="36dp"
@@ -138,12 +136,12 @@
         android:layout_marginTop="16dp"
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_youtube_01"
         android:src="@drawable/ic_btn_youtube_01"
         android:tint="@android:color/darker_gray"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_bomo" />
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_bomo" />
 
 
     <ImageView
     <ImageView
         android:id="@+id/iv_shareDialog_facebook"
         android:id="@+id/iv_shareDialog_facebook"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
         android:layout_marginLeft="36dp"
@@ -151,12 +149,12 @@
         android:layout_marginTop="16dp"
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_facebook_01"
         android:src="@drawable/ic_btn_facebook_01"
         android:tint="@android:color/darker_gray"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_youtube" />
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_youtube" />
 
 
     <ImageView
     <ImageView
         android:id="@+id/iv_shareDialog_twitter"
         android:id="@+id/iv_shareDialog_twitter"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
         android:layout_marginLeft="36dp"
@@ -164,6 +162,7 @@
         android:layout_marginTop="16dp"
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_twitter_01"
         android:src="@drawable/ic_btn_twitter_01"
         android:tint="@android:color/darker_gray"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_facebook" />
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_facebook" />
 
 
@@ -191,11 +190,11 @@
         android:id="@+id/iv_shareDialog_pause"
         android:id="@+id/iv_shareDialog_pause"
         android:layout_width="48dp"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_height="48dp"
-        android:visibility="invisible"
         android:layout_marginTop="8dp"
         android:layout_marginTop="8dp"
         android:src="@drawable/ic_pause"
         android:src="@drawable/ic_pause"
+        android:visibility="invisible"
         app:layout_constraintLeft_toLeftOf="@id/videoShareDialogPreview"
         app:layout_constraintLeft_toLeftOf="@id/videoShareDialogPreview"
-        app:layout_constraintTop_toBottomOf="@id/videoShareDialogPreview"/>
+        app:layout_constraintTop_toBottomOf="@id/videoShareDialogPreview" />
 
 
     <TextView
     <TextView
         android:id="@+id/tv_shareDialog_time"
         android:id="@+id/tv_shareDialog_time"

+ 5 - 5
src/main/res/layout/movie_edit_btn_panel_view.xml

@@ -19,7 +19,7 @@
         android:id="@+id/loopText"
         android:id="@+id/loopText"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Loop"
+        android:text="@string/loop"
         android:textColor="@android:color/white"
         android:textColor="@android:color/white"
         android:visibility="gone"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="@+id/loopSwitch"
         app:layout_constraintBottom_toBottomOf="@+id/loopSwitch"
@@ -35,7 +35,7 @@
         android:drawableStart="@drawable/ic_delete_w"
         android:drawableStart="@drawable/ic_delete_w"
         android:paddingLeft="16dp"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
         android:paddingRight="16dp"
-        android:text="DELETE"
+        android:text="@string/delete"
         android:textColor="@android:color/white"
         android:textColor="@android:color/white"
         android:visibility="gone"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -54,7 +54,7 @@
         android:drawableStart="@drawable/ic_edit"
         android:drawableStart="@drawable/ic_edit"
         android:paddingLeft="16dp"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
         android:paddingRight="16dp"
-        android:text="EDIT"
+        android:text="@string/edit"
         android:visibility="gone"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/addMusic"
         app:layout_constraintRight_toLeftOf="@+id/addMusic"
@@ -69,7 +69,7 @@
         android:drawableStart="@drawable/ic_music"
         android:drawableStart="@drawable/ic_music"
         android:paddingLeft="16dp"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
         android:paddingRight="16dp"
-        android:text="ADD MUSIC"
+        android:text="@string/add_music"
         android:textSize="14sp"
         android:textSize="14sp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/save"
         app:layout_constraintRight_toLeftOf="@+id/save"
@@ -84,7 +84,7 @@
         android:drawableStart="@drawable/ic_save"
         android:drawableStart="@drawable/ic_save"
         android:paddingLeft="16dp"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
         android:paddingRight="16dp"
-        android:text="SAVE&amp;SHARE"
+        android:text="@string/save_and_share"
         android:textSize="14sp"
         android:textSize="14sp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintRight_toRightOf="parent"

+ 24 - 5
src/main/res/values/strings.xml

@@ -5,11 +5,6 @@
     <string name="dummy_button">Dummy Button</string>
     <string name="dummy_button">Dummy Button</string>
     <string name="dummy_content">DUMMY\nCONTENT</string>
     <string name="dummy_content">DUMMY\nCONTENT</string>
 
 
-    <string name="music_length">Music Length: %1$s</string>
-    <string name="volume">Volume</string>
-    <string name="save">Save</string>
-    <string name="cancel">Cancel</string>
-
     <!-- TODO: Remove or change this placeholder text -->
     <!-- TODO: Remove or change this placeholder text -->
     <string name="hello_blank_fragment">Hello blank fragment</string>
     <string name="hello_blank_fragment">Hello blank fragment</string>
 
 
@@ -60,6 +55,30 @@
     <string name="front_cover_scene_choose_dialog_align_left">Align to left</string>
     <string name="front_cover_scene_choose_dialog_align_left">Align to left</string>
     <string name="front_cover_scene_choose_dialog_align_right">Align to right</string>
     <string name="front_cover_scene_choose_dialog_align_right">Align to right</string>
 
 
+    <!--music select dialog-->
+    <string name="library">Library</string>
+    <string name="device">Device</string>
+
+    <!--movie edit button panel-->
+    <string name="loop">Loop</string>
+    <string name="delete">Delete</string>
+    <string name="edit">Edit</string>
+    <string name="add_music">Add Music</string>
+    <string name="save_and_share">Save&amp;Share</string>
+
+    <!--movie edit activity-->
+    <string name="progressing">Progressing</string>
+
+    <!--music edit dialog-->
+    <string name="music_length">Music Length: %1$s</string>
+    <string name="volume">Volume</string>
+    <string name="volume_percentage">%1$d %%</string>
+    <string name="save">Save</string>
+    <string name="cancel">Cancel</string>
+
+    <!--share dialog-->
+    <string name="preview_progress_time">%1$s/%2$s</string>
+
     <!--brush-->
     <!--brush-->
     <string name="pencil">Pencil</string>
     <string name="pencil">Pencil</string>
     <string name="crayon">Crayon</string>
     <string name="crayon">Crayon</string>