Explorar el Código

Merge branch 'feature_movie_edit_muti_language'

liweihao hace 6 años
padre
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)
 
         progressDialog = ProgressDialog(this).apply {
-            setMessage("progressing")
+            setMessage(getString(R.string.progressing))
             setCancelable(false)
         }
 
@@ -546,7 +546,7 @@ class MovieEditActivity : AppCompatActivity(),
         val pd = ProgressDialog(this).apply {
             val t = viewModel.storyPeriodLiveData.value ?: 0
             max = (t / 33).toInt()
-            setMessage("progressing")
+            setMessage(getString(R.string.progressing))
             setOnCancelListener {
                 disposable?.dispose()
                 onMovieSavedListener.onSaved(outputFile)
@@ -600,7 +600,7 @@ class MovieEditActivity : AppCompatActivity(),
                 .subscribe({
                     val progress = (it * 100).toInt()
                     val msg = if (progress >= 100) {
-                        "processing ..."
+                        getString(R.string.progressing)
                     } else {
                         "$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)
                 endTime.text = TimeUtils.getPlayMovieTimeFormat(it.endTime)
                 volumeSeekBar.progress = (it.volume * volumeSeekBar.max).toInt()
-                volumeText.text = "${volumeSeekBar.progress} %"
+                volumeText.text = getString(R.string.volume_percentage, volumeSeekBar.progress)
 
                 play.setOnClickListener { _ ->
                     val startPosition = it.duration * headScrollRatio
@@ -114,7 +114,7 @@ class MusicEditDialog : DialogFragment() {
 
                 volumeSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                     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()
                         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? {
             when (position) {
-                0 -> return "Library"
-                1 -> return "Device"
+                0 -> return getString(R.string.library)
+                1 -> return getString(R.string.device)
             }
             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 onClickTwitter = Runnable {}
     var onClickMore = Runnable {}
-    var onClickPlay = Runnable {}
 
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
@@ -94,7 +93,7 @@ class ShareDialog : DialogFragment() {
                                 activity?.runOnUiThread {
                                     if (!isPause) {
                                         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
                 }
 
-                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 {
                     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" />
 
     <TextView
-
         android:id="@+id/tv_shareDialog_name"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -130,7 +129,6 @@
 
     <ImageView
         android:id="@+id/iv_shareDialog_youtube"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
@@ -138,12 +136,12 @@
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_youtube_01"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_bomo" />
 
     <ImageView
         android:id="@+id/iv_shareDialog_facebook"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
@@ -151,12 +149,12 @@
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_facebook_01"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_youtube" />
 
     <ImageView
         android:id="@+id/iv_shareDialog_twitter"
-        android:visibility="gone"
         android:layout_width="48dp"
         android:layout_height="48dp"
         android:layout_marginLeft="36dp"
@@ -164,6 +162,7 @@
         android:layout_marginTop="16dp"
         android:src="@drawable/ic_btn_twitter_01"
         android:tint="@android:color/darker_gray"
+        android:visibility="gone"
         app:layout_constraintLeft_toRightOf="@id/videoShareDialogPreview"
         app:layout_constraintTop_toBottomOf="@id/iv_shareDialog_facebook" />
 
@@ -191,11 +190,11 @@
         android:id="@+id/iv_shareDialog_pause"
         android:layout_width="48dp"
         android:layout_height="48dp"
-        android:visibility="invisible"
         android:layout_marginTop="8dp"
         android:src="@drawable/ic_pause"
+        android:visibility="invisible"
         app:layout_constraintLeft_toLeftOf="@id/videoShareDialogPreview"
-        app:layout_constraintTop_toBottomOf="@id/videoShareDialogPreview"/>
+        app:layout_constraintTop_toBottomOf="@id/videoShareDialogPreview" />
 
     <TextView
         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:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Loop"
+        android:text="@string/loop"
         android:textColor="@android:color/white"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="@+id/loopSwitch"
@@ -35,7 +35,7 @@
         android:drawableStart="@drawable/ic_delete_w"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
-        android:text="DELETE"
+        android:text="@string/delete"
         android:textColor="@android:color/white"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -54,7 +54,7 @@
         android:drawableStart="@drawable/ic_edit"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
-        android:text="EDIT"
+        android:text="@string/edit"
         android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/addMusic"
@@ -69,7 +69,7 @@
         android:drawableStart="@drawable/ic_music"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
-        android:text="ADD MUSIC"
+        android:text="@string/add_music"
         android:textSize="14sp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toLeftOf="@+id/save"
@@ -84,7 +84,7 @@
         android:drawableStart="@drawable/ic_save"
         android:paddingLeft="16dp"
         android:paddingRight="16dp"
-        android:text="SAVE&amp;SHARE"
+        android:text="@string/save_and_share"
         android:textSize="14sp"
         app:layout_constraintBottom_toBottomOf="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_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 -->
     <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_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-->
     <string name="pencil">Pencil</string>
     <string name="crayon">Crayon</string>