Sfoglia il codice sorgente

New: add music edit dialog string to res

liweihao 6 anni fa
parent
commit
a905c035d5

+ 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)

+ 7 - 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>
 
@@ -71,6 +66,13 @@
     <string name="add_music">Add Music</string>
     <string name="save_and_share">Save&amp;Share</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>
+
     <!--brush-->
     <string name="pencil">Pencil</string>
     <string name="crayon">Crayon</string>