Skip to content

Commit

Permalink
[*] improve ui
Browse files Browse the repository at this point in the history
  • Loading branch information
heng30 committed May 31, 2024
1 parent c3c692b commit 6d921fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ run-linux:
build-rust:
cd ./rust && cargo build

build-apk: build-apk-all build-apk-arm build-apk-arm64 build-apk-x64
build-apk: remove-old-apk build-apk-all build-apk-arm build-apk-arm64 build-apk-x64

build-apk-all: make-release-dir
- rm build/release/musicbox-${version}.apk
Expand All @@ -47,6 +47,9 @@ build-apk-x64: make-release-dir
make-release-dir:
mkdir -p ./build/release

remove-old-apk:
-rm -f ./build/release/*

clean:
rm -rf ./flutter_jank_metrics_*.json
rm -rf ./rust/target
Expand Down
2 changes: 0 additions & 2 deletions lib/models/lyric_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class SongLyricController extends GetxController {

String? downloadDir;

bool isInitShowAdjustLyricSpeedOverlay = false;

SongLyricController() {
if (!kReleaseMode) {
fakeLyricList();
Expand Down
13 changes: 7 additions & 6 deletions lib/pages/song.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class _SongPageState extends State<SongPage> {
final currentSongIndex = Get.arguments["currentSongIndex"];

final isShowAdjustLyricSpeedOverlay = false.obs;
bool isInitShowAdjustLyricSpeedOverlay = false;
OverlayEntry? overlayEntry;

@override
void initState() {
Expand Down Expand Up @@ -88,7 +90,7 @@ class _SongPageState extends State<SongPage> {

void showAdjustLyricSpeedOverlay(BuildContext context, Song song) {
OverlayState overlayState = Overlay.of(context);
OverlayEntry overlayEntry = OverlayEntry(
overlayEntry = OverlayEntry(
builder: (context) => Positioned(
top: 50,
left: (Get.width - 200) / 2,
Expand All @@ -109,7 +111,7 @@ class _SongPageState extends State<SongPage> {
),
),
);
overlayState.insert(overlayEntry);
overlayState.insert(overlayEntry!);
}

Widget buildAdjustLyricSpeed(BuildContext context, Song song) {
Expand Down Expand Up @@ -515,10 +517,8 @@ class _SongPageState extends State<SongPage> {
isShowAdjustLyricSpeedOverlay.value =
!isShowAdjustLyricSpeedOverlay.value;

if (!songLyricController
.isInitShowAdjustLyricSpeedOverlay) {
songLyricController.isInitShowAdjustLyricSpeedOverlay =
true;
if (!isInitShowAdjustLyricSpeedOverlay) {
isInitShowAdjustLyricSpeedOverlay = true;
showAdjustLyricSpeedOverlay(
context,
playlistController
Expand Down Expand Up @@ -547,6 +547,7 @@ class _SongPageState extends State<SongPage> {
onPopInvoked: (didPop) {
if (didPop) return;
isShowAdjustLyricSpeedOverlay.value = false;
overlayEntry?.remove();
Get.back();
},
);
Expand Down

0 comments on commit 6d921fc

Please sign in to comment.