diff --git a/lib/api/marianumcloud/talk/chat/richObjectStringProcessor.dart b/lib/api/marianumcloud/talk/chat/richObjectStringProcessor.dart index 27241a9..fee0b53 100644 --- a/lib/api/marianumcloud/talk/chat/richObjectStringProcessor.dart +++ b/lib/api/marianumcloud/talk/chat/richObjectStringProcessor.dart @@ -33,7 +33,7 @@ class RichObjectStringProcessor { return const Padding(padding: EdgeInsets.all(10), child: CircularProgressIndicator()); }, fadeInDuration: const Duration(seconds: 1), - imageUrl: "https://cloud.marianum-fulda.de/core/preview?fileId=${value.id}&x=110&y=-1&a=1", + imageUrl: "https://cloud.marianum-fulda.de/core/preview?fileId=${value.id}&x=100&y=-1&a=1", httpHeaders: { "Authorization": "Basic ${base64.encode(utf8.encode("${preferences.getString("username")}:${preferences.getString("password")}"))}" }, diff --git a/lib/screen/pages/talk/chatView.dart b/lib/screen/pages/talk/chatView.dart index 1fabbf4..9e53e53 100644 --- a/lib/screen/pages/talk/chatView.dart +++ b/lib/screen/pages/talk/chatView.dart @@ -29,23 +29,27 @@ class _ChatViewState extends State { alignment: Alignment.center, ); - static const styleOther = BubbleStyle( - nip: BubbleNip.leftTop, - color: Colors.white, - borderWidth: 1, - elevation: 1, - margin: BubbleEdges.only(top: 15, left: 10, right: 50), - alignment: Alignment.topLeft, - ); + static BubbleStyle getStyleOther(bool seamless) { + return BubbleStyle( + nip: BubbleNip.leftTop, + color: seamless ? Colors.transparent : Colors.white, + borderWidth: seamless ? 0 : 1, + elevation: seamless ? 0 : 1, + margin: const BubbleEdges.only(top: 15, left: 10, right: 50), + alignment: Alignment.topLeft, + ); + } - static const styleSelf = BubbleStyle( - nip: BubbleNip.rightBottom, - color: Color(0xffd9fdd3), - borderWidth: 1, - elevation: 1, - margin: BubbleEdges.only(top: 15, right: 10, left: 50), - alignment: Alignment.topRight, - ); + static BubbleStyle getStyleSelf(bool seamless) { + return BubbleStyle( + nip: BubbleNip.rightBottom, + color: seamless ? Colors.transparent : const Color(0xffd9fdd3), + borderWidth: seamless ? 0 : 1, + elevation: seamless ? 0 : 1, + margin: const BubbleEdges.only(top: 15, right: 10, left: 50), + alignment: Alignment.topRight, + ); + } final ScrollController _listController = ScrollController(); final TextEditingController _textBoxController = TextEditingController(); @@ -78,9 +82,9 @@ class _ChatViewState extends State { BubbleStyle currentStyle; if(element.messageType == GetRoomResponseObjectMessageType.comment) { if(element.actorId == widget.selfId) { - currentStyle = styleSelf; + currentStyle = getStyleSelf(element.messageParameters?.containsKey("file") ?? false); } else { - currentStyle = styleOther; + currentStyle = getStyleOther(element.messageParameters?.containsKey("file") ?? false); } } else { currentStyle = styleSystem; @@ -95,7 +99,7 @@ class _ChatViewState extends State { child: Container( constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width * 0.9, - minWidth: _textSize(element.actorDisplayName, _actorTextStyle).width, + minWidth: showActorDisplayName ? _textSize(element.actorDisplayName, _actorTextStyle).width : 30, ), child: Stack( children: [