Skip to content

Commit

Permalink
Fix html loading and add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
lotusprey committed May 7, 2024
1 parent 8ccdb3f commit 78f84d3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
10 changes: 10 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/67.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- AniList Markdown is supported almost fully
- AniList links in markdown text are opened within the app
- More markdown quick access buttons in the composition sheet
- Collection previews can be filtered like full collections
- User/Discover reviews can be filtered by media type
- You can long-press to copy a media description
- Redesigned media overview tab and other elements
- Fixed bugs around deep link opening
- Image popups are also cached
- Other fixes and improvements
37 changes: 13 additions & 24 deletions lib/common/widgets/html_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ class HtmlContent extends StatelessWidget {
if (source != null) showPopUp(context, ImageDialog(source));
},
factoryBuilder: () => _CustomWidgetFactory(),
onLoadingBuilder: (_, __, ___) => renderMode != RenderMode.sliverList
? const Center(child: Loader())
: const SliverToBoxAdapter(child: Center(child: Loader())),
onErrorBuilder: (_, element, err) => renderMode != RenderMode.sliverList
? _errorBuilder(context, element.localName, err)
: SliverToBoxAdapter(
child: _errorBuilder(context, element.localName, err),
onLoadingBuilder: (_, __, ___) => const Center(child: Loader()),
onErrorBuilder: (_, element, err) => Center(
child: IconButton(
tooltip: 'Error',
icon: const Icon(Icons.close_outlined),
onPressed: () => showPopUp(
context,
ConfirmationDialog(
title: 'Failed to load element ${element.localName}',
content: err.toString(),
),
),
),
),
customStylesBuilder: (element) {
return switch (element.localName) {
'br' => const {'line-height': '15px'},
Expand Down Expand Up @@ -128,23 +134,6 @@ class HtmlContent extends StatelessWidget {
},
);
}

Widget _errorBuilder(
BuildContext context,
String? elementName,
dynamic err,
) =>
IconButton(
tooltip: 'Error',
icon: const Icon(Icons.close_outlined),
onPressed: () => showPopUp(
context,
ConfirmationDialog(
title: 'Failed to load element $elementName',
content: err.toString(),
),
),
);
}

final _routeMatchers = {
Expand Down

0 comments on commit 78f84d3

Please sign in to comment.