Skip to content

feat(player): add opt-in flat cinema layout with 3 dp seekbar - #164

Open
Aryan447 wants to merge 2 commits into
mainfrom
feat/player-cinema-layout
Open

Aryan447 wants to merge 2 commits into
mainfrom
feat/player-cinema-layout

Conversation

@Aryan447

@Aryan447 Aryan447 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Introduces an opt-in Cinema Layout (PlayerLayout.CINEMA, default GLASS_PILL) selectable in Settings → Appearance → Player Layout.
  • Flat and gesture-first: eliminates pill containers in favor of borderless glyphs over dual directional top and bottom scrim gradients (boosted for AMOLED).
  • Pins an edge-to-edge 3 dp visual seekbar to the absolute bottom of the display with an expanded 36 dp touch target, preserving chapter cuts and lean seek cache bands without refactoring track/gap drawing.
  • Displays single-line title top-left, right-aligned compact monospace timecode above the seekbar (with tap-to-invert support), and a 2.5-second auto-hide timeout with tap-to-show toggle.
  • Enables natural RTL mirroring via LocalLayoutDirection in Cinema mode while preserving strict LTR locking in Glass Pill.
  • Completely respects existing per-region control sets (topLeftControls, topRightControls, bottomLeftControls, bottomRightControls, portraitBottomControls) and the Control Layout Editor.

Before / After

Metric / Feature Glass Pill (Default) Cinema Layout (Opt-in)
Container style Translucent rounded pills with borders Flat glyphs on directional scrim
Seekbar height & position 4 dp / 16 dp floating with horizontal margins 3 dp edge-to-edge pinned to bottom
Timecode Flanking timers inside seekbar row Compact monospace timecode right-aligned
Auto-hide timeout User pref (default 3 s) 2.5 s
RTL layout Locked LTR RTL mirrored

How measured

Unmeasured; structural player layout and UI styling behind an opt-in preference.

Verification

  • git diff --check passed cleanly.
  • Design proposal delivered in cinema_layout_design_proposal.md.
  • Unit tests added in PlayerLayoutTest.kt.
  • User-visible text registered in res/values/strings.xml and SearchablePreference.kt.
  • CHANGELOG.md updated under Unreleased (Added).
  • Tested commit message with .opencode/skills/commit-messages/scripts/check-commit-msg.sh.
  • Local Gradle build skipped per policy (ANDROID_HOME unset); verified via GitHub Actions CI.

Risks

None; opt-in preference defaulting to GLASS_PILL (current layout unchanged).

Summary by Sourcery

Add an opt-in Cinema player layout while preserving the existing Glass Pill experience and customizable controls.

New Features:

  • Add an opt-in Cinema player layout with flat controls, directional scrims, RTL mirroring, compact timecode, and a bottom-pinned edge-to-edge seekbar.
  • Expose player layout selection in Appearance settings with Glass Pill remaining the default.

Enhancements:

  • Preserve existing player control customizations and seekbar chapter/cache indicators across both layout styles.

Documentation:

  • Document the Cinema player layout in the unreleased changelog.

Tests:

  • Add unit coverage for the available player layouts and default selection.

Introduce the Cinema player layout (PlayerLayout.CINEMA) behind an opt-in preference under Settings -> Appearance -> Player Layout, defaulting to GLASS_PILL.

Cinema mode features borderless glyphs over dual directional scrim gradients, an edge-to-edge 3 dp seekbar pinned to the bottom of the screen with expanded touch targets, single-line title top-left, compact monospace timecode right-aligned above the seekbar, 2.5-second auto-hide timeout, and full RTL start/end mirroring while preserving per-region button arrangements from the Control Layout Editor.

Verified
- git diff --check clean
- Unit tests added in PlayerLayoutTest
- Local build skipped due to missing local Android SDK (relying on CI)
@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Sorry @Aryan447, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 12 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T05:51:05.200019Z 064a74d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces a persisted, opt-in Cinema player layout alongside the unchanged Glass Pill default. The implementation branches the existing Compose player controls and seekbar at the layout boundary, adding scrims, RTL mirroring, Cinema-specific placement and auto-hide behavior, an edge-to-edge 3 dp seekbar with a 36 dp touch region, and compact tappable timecode while reusing existing control sets, seeking gestures, chapter rendering, and cache bands.

Sequence diagram for Cinema player layout rendering

sequenceDiagram
    actor User
    User->>Settings: Select PlayerLayout.CINEMA
    Settings->>AppearancePreferences: playerLayout.set
    PlayerControls->>AppearancePreferences: collectAsState
    PlayerControls->>PlayerControls: Apply Cinema layout
    PlayerControls->>SeekbarWithTimers: Render edge-to-edge seekbar
    SeekbarWithTimers->>StandardSeekbar: Render 3 dp visual track
    PlayerControls->>CompactTimecode: Render tappable timecode
    PlayerControls->>PlayerControls: Use LocalLayoutDirection.current
    PlayerControls->>PlayerControls: Hide controls after 2500 ms
Loading

File-Level Changes

Change Details Files
Added a persisted, opt-in player layout setting with Cinema as a new selectable mode while retaining Glass Pill as the default.
  • Defined the PlayerLayout enum and preference with a Glass Pill default.
  • Added Appearance settings UI, searchable preference metadata, localized labels, and changelog documentation.
  • Added unit coverage for the available layout values and default.
app/src/main/java/app/aryan447/mpvium/preferences/AppearancePreferences.kt
app/src/main/java/app/aryan447/mpvium/preferences/PlayerLayout.kt
app/src/main/java/app/aryan447/mpvium/ui/preferences/PlayerControlsPreferencesScreen.kt
app/src/main/java/app/aryan447/mpvium/ui/preferences/SearchablePreference.kt
app/src/main/res/values/strings.xml
app/src/test/java/app/aryan447/mpvium/preferences/PlayerLayoutTest.kt
CHANGELOG.md
Implemented Cinema-specific player composition, styling, positioning, timeout behavior, and RTL handling without changing the existing Glass Pill path.
  • Applied directional top and bottom scrims, borderless control behavior, single-line titles, and Cinema-specific control anchoring.
  • Used the current layout direction for Cinema and forced LTR for Glass Pill.
  • Added a fixed 2.5-second Cinema auto-hide timeout while preserving locked-control and Glass Pill timing behavior.
  • Preserved the existing per-region control collections and editor-driven arrangements.
app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt
Added the Cinema seekbar and timecode presentation while retaining the shared seeking and cache/chapter rendering logic.
  • Pinned a 3 dp visual rail edge-to-edge at the bottom inside a 36 dp touch target.
  • Forced Cinema to the standard thin seekbar appearance with a transient scrub thumb while retaining Glass Pill seekbar styles.
  • Added compact monospace position/duration timecode with tap-to-invert behavior.
  • Kept the shared gesture overlay, chapter cuts, lean seek cache bands, and existing Glass Pill timer layout.
app/src/main/java/app/aryan447/mpvium/ui/player/controls/components/Seekbar.kt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 064a74d92f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

val clickEvent = LocalPlayerButtonsClickEvent.current
val interactionSource = remember { MutableInteractionSource() }
val currentText = Utils.prettyTime(position.toInt(), false)
val totalText = Utils.prettyTime(duration.toInt(), isInverted)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the remaining duration in the Cinema timecode

When duration inversion is enabled, this formats the full duration as the inverted value, so the timecode shows the negative total runtime instead of the remaining time. The existing timer computes position - duration before formatting; use that value here as well.

Useful? React with 👍 / 👎.

}
CompositionLocalProvider(
LocalLayoutDirection provides LayoutDirection.Ltr,
LocalLayoutDirection provides layoutDirection,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep navigation-bar insets physical when enabling RTL

On an RTL device with a side navigation-bar inset and “Show navigation bar with controls” enabled, the existing inset branches calculate physical left/right padding in LTR, then apply those values as start/end under this RTL provider. This swaps the inset sides, so controls and the seekbar can overlap the navigation bar or reserve space on the wrong edge; resolve the padding for the active layout direction.

AGENTS.md reference: AGENTS.md:L110-L115

Useful? React with 👍 / 👎.

…ontrols

Fix three compile errors in Seekbar.kt and PlayerControlsPreferencesScreen.kt:
- Pass slotModifier to trackContent to resolve RowScope.weight in row container
- Hoist stringResource for layout labels outside non-composable labelOf lambda
- Add missing spacing import in PlayerControlsPreferencesScreen

Verified
- git diff --check clean
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying mpvium with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b149bd
Status: ✅  Deploy successful!
Preview URL: https://28172621.mpvium.pages.dev
Branch Preview URL: https://feat-player-cinema-layout.mpvium.pages.dev

View logs

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

This branch has not been deployed

No deployments
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.

1 participant