1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-06 00:02:48 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Onuray Sahin
6c91fa54e7 Merge branch 'develop' into feature/fix_draw_large_bitmap 2021-01-06 13:08:33 +03:00
Onuray Sahin
526320f4e3 Fix typo. 2020-12-21 11:58:38 +03:00
Onuray Sahin
5c67b3b216 Merge branch 'develop' into feature/fix_draw_large_bitmap 2020-12-21 11:56:02 +03:00
Onuray Sahin
d03521d153 Set image width as maximum as possible. 2020-12-18 16:24:52 +03:00
Onuray Sahin
d520f7a5d4 Merge branch 'develop' into feature/fix_draw_large_bitmap
* develop: (1406 commits)
  Version++
  Prepare release 1.0.13
  Typo in comment
  Improve redirect url, which can be visible to the user: "element://element" -> "element://connect"
  Fix compilation issue
  Add changelog
  Make MSC2858 implementation match the unstable policy of the spec
  Version++
  Prepare release 1.0.12
  /confetti /snow commands: send emote if text is blank (iso Element Web)
  Import SAS strings
  Ensure the message is understood as a debug indication (#2509)
  Add /snow command
  PR Review
  Chat Effects
  Remove bad translation
  Translated using Weblate (French)
  Translated using Weblate (Albanian)
  Translated using Weblate (Ukrainian)
  Translated using Weblate (Albanian)
  ...

# Conflicts:
#	CHANGES.md
2020-12-18 14:49:47 +03:00
Onuray Sahin
cfe7852ffd Let Glide reduce image size if it is too large.
Fixes #1951
2020-08-18 13:49:11 +03:00
3 changed files with 10 additions and 3 deletions

View File

@@ -8,6 +8,8 @@ Improvements 🙌:
- Add System theme option and set as default (#904) (#2387) - Add System theme option and set as default (#904) (#2387)
Bugfix 🐛: Bugfix 🐛:
- Fix Canvas: trying to draw too large bitmap (#1951)
- Url previews sometimes attached to wrong message (#2561)
- Unspecced msgType field in m.sticker (#2580) - Unspecced msgType field in m.sticker (#2580)
- Wait for all room members to be known before sending a message to a e2e room (#2518) - Wait for all room members to be known before sending a message to a e2e room (#2518)
- Url previews sometimes attached to wrong message (#2561) - Url previews sometimes attached to wrong message (#2561)

View File

@@ -30,6 +30,7 @@ import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.CustomViewTarget import com.bumptech.glide.request.target.CustomViewTarget
import com.bumptech.glide.request.target.Target import com.bumptech.glide.request.target.Target
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.ORIENTATION_USE_EXIF import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.ORIENTATION_USE_EXIF
import com.github.chrisbanes.photoview.PhotoView
import com.github.piasy.biv.view.BigImageView import com.github.piasy.biv.view.BigImageView
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.di.ActiveSessionHolder
@@ -152,7 +153,11 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
.load(resolvedUrl) .load(resolvedUrl)
} }
req.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) val maximumScale = (contextView as? PhotoView)?.maximumScale?.toInt() ?: 1
val width = min(contextView.resources.displayMetrics.widthPixels, data.width ?: 0).times(maximumScale)
val height = min(contextView.resources.displayMetrics.heightPixels, data.height ?: 0).times(maximumScale)
req.override(width, height)
.fitCenter() .fitCenter()
.into(target) .into(target)
} }

View File

@@ -52,8 +52,8 @@ class RoomEventsAttachmentProvider(
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(), elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
maxHeight = -1, maxHeight = -1,
maxWidth = -1, maxWidth = -1,
width = null, width = content.info?.width,
height = null, height = content.info?.height,
allowNonMxcUrls = it.root.sendState.isSending() allowNonMxcUrls = it.root.sendState.isSending()
) )