diff --git a/lib/page/ViewHistoryPage.dart b/lib/page/ViewHistoryPage.dart index 8cb6b16..dd50343 100644 --- a/lib/page/ViewHistoryPage.dart +++ b/lib/page/ViewHistoryPage.dart @@ -171,13 +171,13 @@ class ViewHistoryState extends State{ title: Text(S.of(context).viewHistory), automaticallyImplyLeading: true, trailingActions: [ - PlatformIconButton( + IconButton( onPressed: () { VibrationUtils.vibrateWithClickIfPossible(); _showDeleteAllDialog(context); }, //label: S.of(context).clearAllViewHistories, - icon: Icon(PlatformIcons(context).deleteSolid), + icon: Icon(AppPlatformIcons(context).deleteSolid, size: isCupertino(context)? 24: null,), ) ], ), diff --git a/lib/utility/AppPlatformIcons.dart b/lib/utility/AppPlatformIcons.dart index 09139a8..6afcd1a 100644 --- a/lib/utility/AppPlatformIcons.dart +++ b/lib/utility/AppPlatformIcons.dart @@ -164,4 +164,6 @@ class AppPlatformIcons{ IconData get advertisementExemptSolid => isMaterial(context)? Icons.card_giftcard : CupertinoIcons.minus_slash_plus; IconData get advertisementExemptCheckSolid => isMaterial(context)? Icons.verified : CupertinoIcons.checkmark_seal_fill; + + IconData get deleteSolid => isMaterial(context)? Icons.delete_forever : CupertinoIcons.delete_left_fill; } \ No newline at end of file diff --git a/lib/utility/UserPreferencesUtils.dart b/lib/utility/UserPreferencesUtils.dart index 448c621..4c68d0d 100644 --- a/lib/utility/UserPreferencesUtils.dart +++ b/lib/utility/UserPreferencesUtils.dart @@ -490,7 +490,6 @@ class UserPreferencesUtils{ SharedPreferences prefs = await SharedPreferences.getInstance(); String dynamicVariantString = "totalSpot"; switch (dynamicVariant){ - case DynamicSchemeVariant.tonalSpot:{ dynamicVariantString = "totalSpot"; break; @@ -551,7 +550,7 @@ class UserPreferencesUtils{ case "rainbow" : return DynamicSchemeVariant.rainbow; case "fruitSalad" : return DynamicSchemeVariant.fruitSalad; default: - return DynamicSchemeVariant.fidelity; + return DynamicSchemeVariant.tonalSpot; } } diff --git a/lib/widget/DiscuzNotificationAppbarIconWidget.dart b/lib/widget/DiscuzNotificationAppbarIconWidget.dart index bfe74a7..ea6d628 100644 --- a/lib/widget/DiscuzNotificationAppbarIconWidget.dart +++ b/lib/widget/DiscuzNotificationAppbarIconWidget.dart @@ -25,7 +25,7 @@ class DiscuzNotificationAppbarIconWidget extends StatelessWidget{ icon: Badge.count( count: discuzNotification.noticeCount.newprompt + discuzNotification.noticeCount.newmypost, alignment: AlignmentDirectional.topEnd, - child: Icon(AppPlatformIcons(context).notificationSolid), + child: Icon(AppPlatformIcons(context).notificationSolid, size: isCupertino(context)? 18 : 24,), ), onPressed: () async { // go to notification diff --git a/lib/widget/ForumThreadWidget.dart b/lib/widget/ForumThreadWidget.dart index abbfab2..4742664 100644 --- a/lib/widget/ForumThreadWidget.dart +++ b/lib/widget/ForumThreadWidget.dart @@ -507,7 +507,7 @@ class ForumThreadState extends State{ text: shortReply.author, style: TextStyle( fontWeight: FontWeight.bold, - color: Theme.of(context).colorScheme.secondary, + color: Theme.of(context).colorScheme.onSecondaryContainer, )), TextSpan(text: ': '), TextSpan( diff --git a/lib/widget/PostWidget.dart b/lib/widget/PostWidget.dart index 202bfa8..fa610e3 100644 --- a/lib/widget/PostWidget.dart +++ b/lib/widget/PostWidget.dart @@ -1,4 +1,6 @@ +import 'dart:developer'; + import 'package:dio/dio.dart'; import 'package:discuz_flutter/JsonResult/ViewThreadResult.dart'; import 'package:discuz_flutter/client/MobileApiClient.dart'; @@ -277,7 +279,7 @@ class PostState extends State { Widget getPostContent(BuildContext context, bool compactParagraph) { String _html = _post.message; - + log("Original HTML ${_html}"); if (this.isFontStyleIgnored()) { // regex @@ -290,16 +292,30 @@ class PostState extends State { _html = PostTextUtils.decodePostMessage(_html); } + if(compactParagraph){ + _html = _html.replaceAll(RegExp("[\r\n]+"), ""); _html = _html - .replaceAll(RegExp(r"[()]+", multiLine: true), "
") + .replaceAll(RegExp(r"()+", multiLine: true), "
") //.replaceAll(RegExp(r"\s+$"), "") //.replaceAll(RegExp(r"[()]+$"), "") ; - _html = _html.replaceAll(RegExp(r"(
)+$"), ""); + + _html = _html.replaceAllMapped(RegExp(""), (match){ + print("match! ${match.group(0)} ${match.end} ${_html.length}"); + if(_html.length - match.end < 3){ + return ""; + } + else{ + return "
"; + } + }); + + // _html = _html.replaceAll(RegExp(r"$"), ""); _html = _html.replaceAll(RegExp(r"\s+$"), ""); } + log("AFTER HTML ${_html}"); return Column( @@ -329,6 +345,7 @@ class PostState extends State { ), if (_post.attachmentMapper.isNotEmpty) ListView.builder( + padding: EdgeInsets.zero, itemBuilder: (context, index) { Attachment attachment = _post.getAttachmentList()[index]; return AttachmentWidget(_discuz, attachment); @@ -344,7 +361,7 @@ class PostState extends State { padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.0)), - color: Theme.of(context).disabledColor.withOpacity(0.04), + color: Theme.of(context).colorScheme.primaryContainer.withOpacity(0.1), // boxShadow: [ // if(isMaterial(context)) // BoxShadow(