@@ -48,6 +48,7 @@ import com.owncloud.android.R
4848import com.owncloud.android.databinding.PreviewImageFragmentBinding
4949import com.owncloud.android.databinding.TopProgressBarBinding
5050import com.owncloud.android.datamodel.OCFile
51+ import com.owncloud.android.domain.files.MIME_SVG
5152import com.owncloud.android.files.FileMenuFilter
5253import com.owncloud.android.ui.controller.TransferProgressController
5354import com.owncloud.android.ui.dialog.ConfirmationDialogFragment
@@ -328,21 +329,21 @@ class PreviewImageFragment : FileFragment() {
328329 return false
329330 }
330331
331- override fun onResourceReady (
332- resource : Drawable ? , model : Any , target : Target <Drawable ?>,
333- dataSource : DataSource , isFirstResource : Boolean
334- ): Boolean {
335- Timber .d(" Loading image %s" , file.fileName)
336- binding.progressWheel.isVisible = false
337- return false
338- }
339- })
340- .into(binding.photoView)
332+ override fun onResourceReady (
333+ resource : Drawable ? , model : Any , target : Target <Drawable ?>,
334+ dataSource : DataSource , isFirstResource : Boolean
335+ ): Boolean {
336+ Timber .d(" Loading image %s" , file.fileName)
337+ binding.progressWheel.isVisible = false
338+ return false
339+ }
340+ })
341+ .into(binding.photoView)
341342
342343 binding.photoView.isVisible = true
343344 }
344345
345- private fun isSVGFile (file : OCFile ): Boolean = file.mimetype == SVG_MIMETYPE
346+ private fun isSVGFile (file : OCFile ): Boolean = file.mimetype == MIME_SVG
346347
347348 private fun getBackgroundColor (file : OCFile ): Int {
348349 return if (isSVGFile(file)) Color .WHITE else Color .BLACK
@@ -359,7 +360,6 @@ class PreviewImageFragment : FileFragment() {
359360 private const val ARG_FILE = " FILE"
360361 private const val ARG_ACCOUNT = " ACCOUNT"
361362 private const val ARG_IGNORE_FIRST = " IGNORE_FIRST"
362- private const val SVG_MIMETYPE = " image/svg+xml"
363363
364364 /* *
365365 * Public factory method to create a new fragment that previews an image.
0 commit comments