From ad52f2e0c8b2ed4328b93f1d67519c0277693abe Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 7 Jul 2022 13:40:23 -0700 Subject: [PATCH] Fixup Padding and add message about no replies --- lib/l10n/intl_cy.arb | 4 +++- lib/l10n/intl_da.arb | 4 +++- lib/l10n/intl_de.arb | 4 +++- lib/l10n/intl_el.arb | 4 +++- lib/l10n/intl_en.arb | 4 +++- lib/l10n/intl_es.arb | 4 +++- lib/l10n/intl_fr.arb | 4 +++- lib/l10n/intl_it.arb | 4 +++- lib/l10n/intl_lb.arb | 4 +++- lib/l10n/intl_no.arb | 4 +++- lib/l10n/intl_pl.arb | 4 +++- lib/l10n/intl_pt.arb | 4 +++- lib/l10n/intl_ro.arb | 4 +++- lib/l10n/intl_ru.arb | 4 +++- lib/widgets/messagerow.dart | 23 +++++++++++++++-------- 15 files changed, 57 insertions(+), 22 deletions(-) diff --git a/lib/l10n/intl_cy.arb b/lib/l10n/intl_cy.arb index 4e58d39c..0a8fd661 100644 --- a/lib/l10n/intl_cy.arb +++ b/lib/l10n/intl_cy.arb @@ -1,6 +1,8 @@ { "@@locale": "cy", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_da.arb b/lib/l10n/intl_da.arb index a3200930..46d534be 100644 --- a/lib/l10n/intl_da.arb +++ b/lib/l10n/intl_da.arb @@ -1,6 +1,8 @@ { "@@locale": "da", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index 6a51c81f..f9b8b4de 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -1,6 +1,8 @@ { "@@locale": "de", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_el.arb b/lib/l10n/intl_el.arb index 842c0254..a27e7fda 100644 --- a/lib/l10n/intl_el.arb +++ b/lib/l10n/intl_el.arb @@ -1,6 +1,8 @@ { "@@locale": "el", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 9c44e787..70281e8d 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -1,6 +1,8 @@ { "@@locale": "en", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index fd08919b..55886a19 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -1,6 +1,8 @@ { "@@locale": "es", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 14d62509..fd6aee80 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -1,6 +1,8 @@ { "@@locale": "fr", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_it.arb b/lib/l10n/intl_it.arb index c8250f9b..ccef6c6c 100644 --- a/lib/l10n/intl_it.arb +++ b/lib/l10n/intl_it.arb @@ -1,6 +1,8 @@ { "@@locale": "it", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_lb.arb b/lib/l10n/intl_lb.arb index bee2b7e6..d296b51a 100644 --- a/lib/l10n/intl_lb.arb +++ b/lib/l10n/intl_lb.arb @@ -1,6 +1,8 @@ { "@@locale": "lb", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_no.arb b/lib/l10n/intl_no.arb index d13492a7..2849c2f9 100644 --- a/lib/l10n/intl_no.arb +++ b/lib/l10n/intl_no.arb @@ -1,6 +1,8 @@ { "@@locale": "no", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index b85854fe..6d599fdc 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -1,6 +1,8 @@ { "@@locale": "pl", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_pt.arb b/lib/l10n/intl_pt.arb index c5e363b3..2abeecf1 100644 --- a/lib/l10n/intl_pt.arb +++ b/lib/l10n/intl_pt.arb @@ -1,6 +1,8 @@ { "@@locale": "pt", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_ro.arb b/lib/l10n/intl_ro.arb index fb756dfa..322bf13c 100644 --- a/lib/l10n/intl_ro.arb +++ b/lib/l10n/intl_ro.arb @@ -1,6 +1,8 @@ { "@@locale": "ro", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index d0a225d1..ad92d5c3 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -1,6 +1,8 @@ { "@@locale": "ru", - "@@last_modified": "2022-07-07T21:07:20+02:00", + "@@last_modified": "2022-07-07T22:32:20+02:00", + "fileDownloadUnavailable": "This file appears unavailable for download. The sender may have disabled downloads for this file.", + "messageNoReplies": "There are no replies to this message.", "headingReplies": "Replies", "viewReplies": "View replies to this message", "restartFileShare": "Start Sharing File", diff --git a/lib/widgets/messagerow.dart b/lib/widgets/messagerow.dart index 540cf54d..6ff631cb 100644 --- a/lib/widgets/messagerow.dart +++ b/lib/widgets/messagerow.dart @@ -111,7 +111,7 @@ class MessageRowState extends State with SingleTickerProviderStateMi tooltip: AppLocalizations.of(context)!.viewReplies, splashRadius: Material.defaultSplashRadius / 2, onPressed: () { - modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, settings, pis, cis, borderColor, cache, messageID); + modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, AppLocalizations.of(context)!.messageNoReplies, settings, pis, cis, borderColor, cache, messageID); }, icon: Icon(Icons.message_rounded, color: Provider.of(context).theme.dropShadowColor))); @@ -241,7 +241,7 @@ class MessageRowState extends State with SingleTickerProviderStateMi Provider.of(context, listen: false).selectedIndex = Provider.of(context, listen: false).messageID; }, onLongPress: () async { - modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, settings, pis, cis, borderColor, cache, messageID); + modalShowReplies(context, AppLocalizations.of(context)!.headingReplies, AppLocalizations.of(context)!.messageNoReplies, settings, pis, cis, borderColor, cache, messageID); }, child: Padding( padding: EdgeInsets.all(2), @@ -364,7 +364,8 @@ class MessageRowState extends State with SingleTickerProviderStateMi } } -void modalShowReplies(BuildContext ctx, String replyHeader, Settings settings, ProfileInfoState profile, ContactInfoState cis, Color borderColor, MessageCache cache, int messageID, +void modalShowReplies( + BuildContext ctx, String replyHeader, String noRepliesText, Settings settings, ProfileInfoState profile, ContactInfoState cis, Color borderColor, MessageCache cache, int messageID, {bool showImage = true}) { showModalBottomSheet( context: ctx, @@ -419,7 +420,11 @@ void modalShowReplies(BuildContext ctx, String replyHeader, Settings settings, P color: settings.theme.mainTextColor, ))); - withHeader.insert(2, Padding(padding: EdgeInsets.fromLTRB(10.0, 10.0, 2.0, 15.0), child: Text(replyHeader, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)))); + if (replies.isNotEmpty) { + withHeader.insert(2, Padding(padding: EdgeInsets.fromLTRB(10.0, 10.0, 2.0, 15.0), child: Text(replyHeader, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)))); + } else { + withHeader.insert(2, Padding(padding: EdgeInsets.fromLTRB(10.0, 10.0, 2.0, 15.0), child: Center(child: Text(noRepliesText, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold))))); + } return Scrollbar( isAlwaysShown: true, @@ -429,10 +434,12 @@ void modalShowReplies(BuildContext ctx, String replyHeader, Settings settings, P constraints: BoxConstraints( minHeight: viewportConstraints.maxHeight, ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: withHeader, - )))); + child: Padding( + padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: withHeader, + ))))); }); }); }