Skip to content

Commit

Permalink
chore: few tweaks/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Feb 27, 2024
1 parent 15ec081 commit a5aed68
Show file tree
Hide file tree
Showing 4 changed files with 541 additions and 539 deletions.
23 changes: 4 additions & 19 deletions lib/packages/lyrics_lrc_parsed_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,21 @@ import 'package:namida/controller/player_controller.dart';
import 'package:namida/controller/settings_controller.dart';
import 'package:namida/core/extensions.dart';
import 'package:namida/core/icon_fonts/broken_icons.dart';
import 'package:namida/packages/miniplayer.dart';
import 'package:namida/packages/miniplayer_base.dart';
import 'package:namida/ui/widgets/custom_widgets.dart';

class LyricsLRCParsedView extends StatefulWidget {
final double cp;
final Lrc? lrc;
final Widget videoOrImage;
final bool isFullScreenView;
final Duration totalDuration;

const LyricsLRCParsedView({
super.key,
required this.cp,
required this.lrc,
required this.videoOrImage,
this.isFullScreenView = false,
required this.totalDuration,
});

@override
Expand All @@ -42,7 +40,6 @@ class LyricsLRCParsedViewState extends State<LyricsLRCParsedView> {
builder: (context) {
return LyricsLRCParsedView(
key: Lyrics.inst.lrcViewKeyFullscreen,
totalDuration: widget.totalDuration,
cp: widget.cp,
lrc: currentLRC,
videoOrImage: const SizedBox(),
Expand Down Expand Up @@ -89,7 +86,8 @@ class LyricsLRCParsedViewState extends State<LyricsLRCParsedView> {
seconds: int.parse(parts[1]),
milliseconds: int.parse("${parts[2]}0"), // aditional 0 to convert to millis
);
cal = widget.totalDuration.inMicroseconds / lyricsDuration.inMicroseconds;
final totalDur = Player.inst.currentItemDuration ?? Player.inst.nowPlayingTrack.duration.seconds;
cal = totalDur.inMicroseconds / lyricsDuration.inMicroseconds;
} catch (_) {}
}

Expand Down Expand Up @@ -346,20 +344,7 @@ class LyricsLRCParsedViewState extends State<LyricsLRCParsedView> {
if (fullscreen) {
Navigator.of(context).pop();
} else {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return LyricsLRCParsedView(
key: Lyrics.inst.lrcViewKeyFullscreen,
totalDuration: widget.totalDuration,
cp: widget.cp,
lrc: currentLRC,
videoOrImage: const SizedBox(),
isFullScreenView: true,
);
},
),
);
enterFullScreen();
}
},
),
Expand Down
6 changes: 5 additions & 1 deletion lib/packages/mp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class NamidaYTMiniplayerState extends State<NamidaYTMiniplayer> with SingleTicke

@override
Widget build(BuildContext context) {
_padding = MediaQuery.paddingOf(context);
final padding = MediaQuery.paddingOf(context);
if (padding != _padding) {
_padding = padding;
animateToState(_wasExpanded);
}
return AnimatedBuilderMulti(
animation: controller,
builder: (context, children) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/inner_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class NamidaInnerDrawerState extends State<NamidaInnerDrawer> with SingleTickerP
children[1],
Positioned.fill(
child: TapDetector(
onTap: controller.value != controller.upperBound ? null : _closeDrawer,
onTap: controller.value == controller.lowerBound ? null : _closeDrawer,
child: IgnorePointer(
ignoring: controller.value != controller.upperBound,
ignoring: controller.value == controller.lowerBound,
child: ColoredBox(
color: Colors.black.withOpacity(controller.value),
),
Expand Down
Loading

0 comments on commit a5aed68

Please sign in to comment.