Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-2113: Fix text message overlaps time stamp in message bubble #2127

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/config/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ abstract class AppConfig {
static double bubbleSizeFactor = 1;
static double fontSizeFactor = 1;

static const double messagePadding = 16.0;

static String sampleValue = 'sampleValue';

///`REGISTRATION_URL`: Registration URL for public platform, sample is `https://example.com`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:math';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat/events/message/message_style.dart';
import 'package:fluffychat/pages/chat/events/message_time_style.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/event_extension.dart';
Expand Down Expand Up @@ -93,8 +94,7 @@ mixin MessageContentBuilderMixin {
Event event,
double maxWidth,
) {
const double leftMessagePadding = 8.0;
final double messageMaxWidth = maxWidth - leftMessagePadding;
final double messageMaxWidth = maxWidth - AppConfig.messagePadding;
return TextPainter(
textScaler: MediaQuery.of(context).textScaler,
text: TextSpan(
Expand Down Expand Up @@ -162,7 +162,7 @@ mixin MessageContentBuilderMixin {
double maxWidth,
) {
const spaceMessageAndTime = 4.0;
const paddingMessage = 16.0;
const paddingMessage = AppConfig.messagePadding;

final paintedMessageText = _paintMessageText(
context,
Expand Down