feat: Regulate when thumbnails are animated as per MSC2705

This commit is contained in:
Sorunome 2020-12-29 10:43:32 +01:00
parent 92684da3c3
commit f5e11c2a21
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
6 changed files with 14 additions and 8 deletions

View File

@ -30,6 +30,7 @@ class ContentBanner extends StatelessWidget {
width: bannerSize,
height: bannerSize,
method: ThumbnailMethod.scale,
animated: true,
);
return Container(
height: 300,

View File

@ -60,6 +60,7 @@ class HtmlMessage extends StatelessWidget {
width: (width ?? 800) * ratio,
height: (height ?? 800) * ratio,
method: ThumbnailMethod.scale,
animated: true,
);
},
setCodeLanguage: (String key, String value) async {

View File

@ -81,8 +81,9 @@ class _ImageBubbleState extends State<ImageBubble> {
@override
void initState() {
thumbnailUrl = widget.event.getAttachmentUrl(getThumbnail: true);
attachmentUrl = widget.event.getAttachmentUrl();
thumbnailUrl =
widget.event.getAttachmentUrl(getThumbnail: true, animated: true);
attachmentUrl = widget.event.getAttachmentUrl(animated: true);
if (thumbnailUrl == null) {
_requestFile(getThumbnail: true);
}
@ -196,9 +197,11 @@ class _ImageBubbleState extends State<ImageBubble> {
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
thumbnailUrl = widget.event.getAttachmentUrl(
getThumbnail: true, useThumbnailMxcUrl: true);
attachmentUrl =
widget.event.getAttachmentUrl(useThumbnailMxcUrl: true);
getThumbnail: true,
useThumbnailMxcUrl: true,
animated: true);
attachmentUrl = widget.event
.getAttachmentUrl(useThumbnailMxcUrl: true, animated: true);
});
});
}

View File

@ -147,6 +147,7 @@ class InputBar extends StatelessWidget {
width: size * ratio,
height: size * ratio,
method: ThumbnailMethod.scale,
animated: true,
);
return Container(
padding: EdgeInsets.all(4.0),

View File

@ -1084,7 +1084,7 @@ class _ChatState extends State<_Chat> {
Timer(Duration(seconds: 2), () {
typingCoolDown = null;
currentlyTyping = false;
room.sendTypingInfo(false);
room.sendTypingNotification(false);
});
typingTimeout ??=
Timer(Duration(seconds: 30), () {
@ -1093,7 +1093,7 @@ class _ChatState extends State<_Chat> {
});
if (!currentlyTyping) {
currentlyTyping = true;
room.sendTypingInfo(true,
room.sendTypingNotification(true,
timeout: Duration(seconds: 30)
.inMilliseconds);
}

View File

@ -202,7 +202,7 @@ packages:
description:
path: "."
ref: main
resolved-ref: bce0c1d4856030e31338ea96218e9d8f11645dfb
resolved-ref: "03b9c6e2eec31c9645a0c7354fe90f8b1906efa8"
url: "https://gitlab.com/famedly/famedlysdk.git"
source: git
version: "0.0.1"