mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
Fix / view attachment crash + freeze when offline
This commit is contained in:
parent
246f6bb0d0
commit
c63128cfbd
2 changed files with 8 additions and 4 deletions
|
@ -151,7 +151,10 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||
.into(imageView)
|
||||
}
|
||||
|
||||
fun renderThumbnailDontTransform(data: Data, imageView: ImageView, callback: ((Boolean) -> Unit)? = null) {
|
||||
/**
|
||||
* onlyRetrieveFromCache is true!
|
||||
*/
|
||||
fun renderForSharedElementTransition(data: Data, imageView: ImageView, callback: ((Boolean) -> Unit)? = null) {
|
||||
// a11y
|
||||
imageView.contentDescription = data.filename
|
||||
|
||||
|
@ -186,7 +189,8 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
|
|||
return false
|
||||
}
|
||||
})
|
||||
.dontTransform()
|
||||
.onlyRetrieveFromCache(true)
|
||||
.fitCenter()
|
||||
.into(imageView)
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), BaseAttachmen
|
|||
// will be shown at end of transition
|
||||
pager2.isInvisible = true
|
||||
supportPostponeEnterTransition()
|
||||
imageContentRenderer.renderThumbnailDontTransform(mediaData, imageTransitionView) {
|
||||
imageContentRenderer.renderForSharedElementTransition(mediaData, imageTransitionView) {
|
||||
// Proceed with transaction
|
||||
scheduleStartPostponedTransition(imageTransitionView)
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), BaseAttachmen
|
|||
// will be shown at end of transition
|
||||
pager2.isInvisible = true
|
||||
supportPostponeEnterTransition()
|
||||
imageContentRenderer.renderThumbnailDontTransform(mediaData.thumbnailMediaData, imageTransitionView) {
|
||||
imageContentRenderer.renderForSharedElementTransition(mediaData.thumbnailMediaData, imageTransitionView) {
|
||||
// Proceed with transaction
|
||||
scheduleStartPostponedTransition(imageTransitionView)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue