Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

cooperku_kdanmobile vor 6 Jahren
Ursprung
Commit
f8c634e32b

+ 1 - 1
src/main/java/com/bomostory/sceneeditmodule/screen/movie/MovieEditViewModel.kt

@@ -110,7 +110,7 @@ class MovieEditViewModel : ViewModel() {
         val secret = context.getString(R.string.bomo_cloud_client_secret)
         val author = project.author ?: ""
         val name = project.name ?: ""
-        val category = 0
+        val category = project.category.id
         val filePart = MultipartBody.Part.createFormData("file", file.name, RequestBody.create(MediaType.parse("video/*"), file))
         return BoMoCloud(id, secret).videoService
                 .uploadVideo(author, name, category, filePart)

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

@@ -1,7 +1,6 @@
 package com.bomostory.sceneeditmodule.share
 
 import android.graphics.PorterDuff
-import android.graphics.drawable.Drawable
 import android.media.MediaMetadataRetriever
 import android.os.Bundle
 import android.support.v4.app.DialogFragment
@@ -13,6 +12,7 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.SeekBar
+import com.bomostory.sceneeditmodule.SceneDrawer
 import com.bomostory.sceneeditmodule.basicdata.Project
 import com.bomostory.sceneeditmodule.utils.HorizontalItemDecoration
 import com.bomostory.sceneeditmodule.utils.TimeUtils
@@ -192,7 +192,10 @@ class ShareDialog : DialogFragment() {
             fun bind(p1: Int) {
                 itemView.apply {
                     project.story?.apply {
-                        screenshot.setImageDrawable(Drawable.createFromPath(this.scenes[p1].backgroundPath))
+                        val width = context.resources.getDimension(R.dimen.share_dialog_screenshot_width).toInt()
+                        val height = context.resources.getDimension(R.dimen.share_dialog_screenshot_height).toInt()
+                        val bitmap = SceneDrawer.drawScene(context, scenes[p1], 0, width, height)
+                        screenshot.setImageBitmap(bitmap)
                     }
                 }
             }

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

@@ -19,4 +19,7 @@
     <dimen name="export_pdf_screenshot_height">72dp</dimen>
     <dimen name="export_pdf_cover_width">72dp</dimen>
     <dimen name="export_pdf_cover_height">72dp</dimen>
+
+    <dimen name="share_dialog_screenshot_width">144dp</dimen>
+    <dimen name="share_dialog_screenshot_height">72dp</dimen>
 </resources>