Browse Source

New: add share dialog string to res

liweihao 6 years ago
parent
commit
4313d1cc03

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

+ 3 - 0
src/main/res/values/strings.xml

@@ -76,6 +76,9 @@
     <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>