Skip to content

Enhance lyrics sheet with animations and add a keep-screen-on toggle#2040

Merged
theovilardo merged 4 commits into
PixelPlayerHQ:masterfrom
Amonoman:master
May 18, 2026
Merged

Enhance lyrics sheet with animations and add a keep-screen-on toggle#2040
theovilardo merged 4 commits into
PixelPlayerHQ:masterfrom
Amonoman:master

Conversation

@Amonoman

@Amonoman Amonoman commented May 18, 2026

Copy link
Copy Markdown
Contributor

Enhances the lyrics sheet with smooth, performance-optimized word highlight animations and a persistent "Keep screen on" toggle.


Key Features

Word-Level Highlights

  • Visual Pop: Active words smoothly spring to a 1.10f scale, while unhighlighted words dim to 0.55f alpha for better readability.
  • Zero Reflow: Animations run inside graphicsLayer to skip the layout pass, ensuring stable, high-performance rendering.
  • Fluid Motion: Uses a low-stiffness, medium-bouncy spring matching the core UI physics.

Keep Screen On Toggle

  • Persistent Setting: Added a switch in LyricsMoreBottomSheet backed by DataStore.
  • Lifecycle Aware: Automatically releases the window flag when the sheet is dismissed or backgrounded (ON_STOP).
  • Hardware Friendly: Listens for ACTION_SCREEN_OFF to automatically reset the preference if the user locks the device manually.

Amonoman and others added 4 commits May 18, 2026 16:28
… pattern

Previously the lyrics sheet only applied a translationY of 8 % on back
gesture progress. Full-screen destinations across the rest of the app
(and Android's own predictive back spec) also shrink and fade the surface
so the screen behind is revealed naturally.

- scaleX/Y: 1f → 0.92f
- translationY: 0 → 8 % of height  (unchanged)
- alpha: 1f → 0.72f

All three are read inside graphicsLayer (draw phase) via the existing
backProgressProvider lambda — zero recomposition per gesture frame,
consistent with the SheetVisualState pattern.
…mation

When animated lyrics is enabled, the active word now springs up to 1.15×
scale on highlight and neighbouring words dim to 55 % alpha, making the
active word read clearly without relying on colour contrast alone.

Both values are driven by animateFloatAsState with the same
StiffnessVeryLow / DampingRatioMediumBouncy spring already used for the
colour transition, so the whole word feels like a single cohesive motion.
Scale and alpha are applied inside graphicsLayer on the visible Text only —
the invisible bold spacer Text is unaffected, so layout never changes and
there is zero reflow per animation frame.

When useAnimatedLyrics is off both animations resolve to their identity
values (scale = 1f, alpha = 1f) and are effectively no-ops, keeping the
plain mode unchanged.

feat(lyrics): add keep-screen-on toggle to lyrics sheet

- Toggle persisted to DataStore under "keep_screen_on_lyrics" key
- Sets FLAG_KEEP_SCREEN_ON via view.keepScreenOn (no permissions required)
- Registers BroadcastReceiver for ACTION_SCREEN_OFF to auto-reset the
  flag when the screen is turned off by power button or OEM sleep gesture
- Flag and receiver are scoped to LyricsSheet composition lifetime
- New "Keep screen on" switch added to LyricsMoreBottomSheet Controls group
feat(lyrics): add keep-screen-on toggle and improve animations
@Amonoman Amonoman changed the title Enhance lyrics sheet with animations and keep-screen-on toggle Enhance lyrics sheet with animations and add a keep-screen-on toggle May 18, 2026
@theovilardo theovilardo merged commit a95aec7 into PixelPlayerHQ:master May 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants