From 25ccbd0158937923e59ee5f4eef62f5038cba539 Mon Sep 17 00:00:00 2001 From: otsmr Date: Tue, 20 May 2025 16:50:23 +0200 Subject: [PATCH] fix #177 --- lib/src/views/chats/media_viewer_view.dart | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/src/views/chats/media_viewer_view.dart b/lib/src/views/chats/media_viewer_view.dart index 97a10d9..232da23 100644 --- a/lib/src/views/chats/media_viewer_view.dart +++ b/lib/src/views/chats/media_viewer_view.dart @@ -8,6 +8,7 @@ import 'package:logging/logging.dart'; import 'package:lottie/lottie.dart'; import 'package:no_screenshot/no_screenshot.dart'; import 'package:twonly/globals.dart'; +import 'package:twonly/src/database/daos/contacts_dao.dart'; import 'package:twonly/src/views/camera/share_image_editor_view.dart'; import 'package:twonly/src/views/components/animate_icon.dart'; import 'package:twonly/src/views/components/media_view_sizing.dart'; @@ -553,6 +554,26 @@ class _MediaViewerViewState extends State { ], ), ), + if (showSendTextMessageInput) + Positioned( + top: 20, + left: 0, + right: 0, + child: Text( + getContactDisplayName(widget.contact), + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + shadows: [ + Shadow( + color: const Color.fromARGB(122, 0, 0, 0), + blurRadius: 5.0, + ) + ], + ), + ), + ), if (showSendTextMessageInput) Positioned( bottom: 0, @@ -614,6 +635,7 @@ class _MediaViewerViewState extends State { if (allMediaFiles.isNotEmpty) ReactionButtons( show: showShortReactions, + textInputFocused: showSendTextMessageInput, userId: widget.contact.userId, responseToMessageId: allMediaFiles.first.messageOtherId!, hide: () { @@ -634,11 +656,13 @@ class ReactionButtons extends StatefulWidget { const ReactionButtons( {super.key, required this.show, + required this.textInputFocused, required this.userId, required this.responseToMessageId, required this.hide}); final bool show; + final bool textInputFocused; final int userId; final int responseToMessageId; final Function() hide; @@ -675,7 +699,7 @@ class _ReactionButtonsState extends State { return AnimatedPositioned( duration: Duration(milliseconds: 200), // Animation duration - bottom: widget.show ? 80 : 60, + bottom: widget.show ? (widget.textInputFocused ? 50 : 80) : 60, left: widget.show ? 0 : 150, right: widget.show ? 0 : 150, curve: Curves.linearToEaseOut,