feat(lyrics): keep the screen awake while viewing lyrics

This commit is contained in:
zarzet committed 2026-09-30 20:21:21 +07:00
1 parent a1cec6de51
commit 8aa8d598d8
14 files changed
+276

No files matched your search

+10
View File
@@ -42,6 +42,7 @@ import 'package:spotiflac_android/widgets/lyric_supplement_transition.dart';
import 'package:spotiflac_android/widgets/audio_quality_badges.dart';
import 'package:spotiflac_android/widgets/audio_output_button.dart';
import 'package:spotiflac_android/widgets/lyric_gap_indicator.dart';
import 'package:spotiflac_android/widgets/lyrics_screen_awake.dart';
import 'package:spotiflac_android/widgets/player_artwork.dart';
import 'package:spotiflac_android/widgets/player_queue_dismissible.dart';
import 'package:spotiflac_android/widgets/player_track_swipe.dart';
@@ -549,6 +550,15 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
@override
Widget build(BuildContext context) {
return LyricsScreenAwake(
visible:
_currentPage == 1 &&
ref.watch(currentMediaItemProvider).value != null,
child: _buildPlayer(context),
);
}
Widget _buildPlayer(BuildContext context) {
final mornye = context.isMornye;
final colorScheme = mornye
? MornyeTheme.fromContext(
@@ -34,6 +34,15 @@ class LyricsSettingsPage extends ConsumerWidget {
SliverToBoxAdapter(
child: SettingsGroup(
children: [
SettingsSwitchItem(
icon: Icons.light_mode_outlined,
title: context.l10n.lyricsKeepScreenOn,
subtitle: context.l10n.lyricsKeepScreenOnSubtitle,
value: settings.keepScreenOnLyrics,
onChanged: (value) => ref
.read(settingsProvider.notifier)
.setKeepScreenOnLyrics(value),
),
SettingsSwitchItem(
icon: Icons.subtitles_outlined,
title: context.l10n.optionsEmbedLyrics,
@@ -307,6 +307,12 @@ class SettingsSearchCatalog {
),
],
lyrics = [
SettingsSearchEntry(
icon: Icons.light_mode_outlined,
title: l10n.lyricsKeepScreenOn,
subtitle: l10n.lyricsKeepScreenOnSubtitle,
keywords: const ['screen timeout', 'awake', 'sleep', 'layar'],
),
SettingsSearchEntry(
icon: Icons.subtitles_outlined,
title: l10n.optionsEmbedLyrics,