Skip to content

Commit

Permalink
chore: ui tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Dec 19, 2023
1 parent bdfdc93 commit 6818a61
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 20 deletions.
9 changes: 5 additions & 4 deletions lib/packages/miniplayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ class _MiniPlayerParentState extends State<MiniPlayerParent> with SingleTickerPr
Positioned.fill(
child: AnimatedBuilder(
animation: widget.animation,
child: const Wallpaper(gradient: false, particleOpacity: .3),
builder: (context, child) {
if (widget.animation.value > 0.01) {
return NamidaOpacity(
opacity: widget.animation.value.clamp(0.0, 1.0),
child: const Wallpaper(gradient: false, particleOpacity: .3),
child: child!,
);
} else {
return const SizedBox();
Expand Down Expand Up @@ -2349,16 +2350,15 @@ class LyricsWrapper extends StatelessWidget {

@override
Widget build(BuildContext context) {
// if (cp == 0.0) return child;

final childFinal = enableChildBorderRadius
? ClipRRect(
key: Key("${(6.0 + 10.0 * cp).multipliedRadius}"),
borderRadius: BorderRadius.circular((6.0 + 10.0 * cp).multipliedRadius),
child: child,
)
: child;

if (cp == 0.0) return childFinal;

return Obx(
() => AnimatedSwitcher(
key: Key(track.path),
Expand All @@ -2375,6 +2375,7 @@ class LyricsWrapper extends StatelessWidget {
)
: Lyrics.inst.currentLyricsText.value != ''
? Stack(
key: const Key('child_2'),
alignment: Alignment.center,
children: [
childFinal,
Expand Down
15 changes: 8 additions & 7 deletions lib/ui/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -874,18 +874,19 @@ class _MixesCardState extends State<_MixesCard> {
Positioned(
top: 12.0,
left: 0.0,
child: ClipRect(
child: Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: context.theme.colorScheme.background.withAlpha(50),
),
child: NamidaBgBlur(
blur: 2.0,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: context.theme.cardColor.withAlpha(50),
),
child: Padding(
padding: const EdgeInsets.all(2.0),
child: NamidaIconButton(
icon: Broken.arrow_left_2,
iconColor: context.theme.cardColor.withAlpha(160),
iconColor: context.theme.colorScheme.onBackground.withAlpha(160),
onPressed: NamidaNavigator.inst.closeDialog,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/artwork.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class _ArtworkWidgetState extends State<ArtworkWidget> {
width: realWidthAndHeight,
height: realWidthAndHeight,
frameBuilder: ((context, child, frame, wasSynchronouslyLoaded) {
if (wasSynchronouslyLoaded) return child;
if (wasSynchronouslyLoaded || bytes?.isNotEmpty == true) return child;
return AnimatedSwitcher(
duration: Duration(milliseconds: widget.fadeMilliSeconds),
child: frame != null ? child : const SizedBox(),
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/widgets/custom_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2021,9 +2021,10 @@ class _FadeDismissibleState extends State<FadeDismissible> {
direction: widget.direction,
child: ValueListenableBuilder(
valueListenable: fadeOpacity,
child: widget.child,
builder: (context, value, child) => NamidaOpacity(
opacity: 1 - fadeOpacity.value,
child: widget.child,
child: child!,
),
),
);
Expand Down
1 change: 1 addition & 0 deletions lib/youtube/pages/yt_channels_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ class _YoutubeChannelsPageState extends State<YoutubeChannelsPage> {
),
),
),
const SizedBox(width: 4.0),
NamidaButton(
text: lang.IMPORT,
onPressed: _onSubscriptionFileImportTap,
Expand Down
12 changes: 6 additions & 6 deletions lib/youtube/widgets/yt_comment_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ class YTCommentCardCompact extends StatelessWidget {
const SizedBox(height: 2.0),
NamidaDummyContainer(
width: context.width * 0.5,
height: 12.0,
borderRadius: 6.0,
height: 8.0,
borderRadius: 4.0,
shimmerEnabled: author == null,
child: Row(
children: [
Expand Down Expand Up @@ -303,13 +303,13 @@ class YTCommentCardCompact extends StatelessWidget {
? Column(
children: [
...List.filled(
3,
2,
const Padding(
padding: EdgeInsets.only(top: 2.0),
child: NamidaDummyContainer(
width: null,
height: 12.0,
borderRadius: 4.0,
height: 8.0,
borderRadius: 3.0,
shimmerEnabled: true,
child: null,
),
Expand All @@ -336,7 +336,7 @@ class YTCommentCardCompact extends StatelessWidget {
const SizedBox(width: 4.0),
NamidaDummyContainer(
width: 18.0,
height: 8.0,
height: 6.0,
borderRadius: 4.0,
shimmerEnabled: likeCount == null,
child: Text(
Expand Down
2 changes: 1 addition & 1 deletion lib/youtube/widgets/yt_video_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class YoutubeVideoCard extends StatelessWidget {
shimmerEnabled: video == null,
title: video?.name ?? '',
subtitle: [
if (videoViewCount != null) "${videoViewCount.formatDecimalShort()} ${videoViewCount == 0 ? lang.VIEW : lang.VIEWS}",
if (videoViewCount != null && videoViewCount >= 0) "${videoViewCount.formatDecimalShort()} ${videoViewCount == 0 ? lang.VIEW : lang.VIEWS}",
if (video?.textualUploadDate != null) video?.textualUploadDate,
].join(' - '),
thirdLineText: video?.uploaderName ?? '',
Expand Down
1 change: 1 addition & 0 deletions lib/youtube/youtube_miniplayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ class YoutubeMiniPlayer extends StatelessWidget {
baseIcon: Broken.refresh,
secondaryIcon: Broken.global,
iconSize: 20.0,
secondaryIconSize: 12.0,
)
: Icon(
Broken.refresh,
Expand Down

0 comments on commit 6818a61

Please sign in to comment.