Skip to content

feat(Android, Stack v5): header background color customization - #4522

Open
kligarski wants to merge 4 commits into
@kligarski/stack-v5-android-header-marginsfrom
@kligarski/stack-v5-android-header-background
Open

feat(Android, Stack v5): header background color customization#4522
kligarski wants to merge 4 commits into
@kligarski/stack-v5-android-header-marginsfrom
@kligarski/stack-v5-android-header-background

Conversation

@kligarski

@kligarski kligarski commented Aug 19, 2026

Copy link
Copy Markdown
Member

Description

Adds support for modifying the background color of the header in regular and collapsed/lifted state.

Closes https://github.com/software-mansion/react-native-screens-labs/issues/907.
Closes https://github.com/software-mansion/react-native-screens-labs/issues/906.

Changes

  • add backgroundColor property that maps to appBarLayout.background
  • add scrolledBackgroundColor property:
    • for small header it maps to appBarLayout.liftOnScrollColor and requires liftOnScroll to be enabled
    • for medium/large header it maps to collapsingToolbarLayout.contentScrimColor and removes appBarLayout.liftOnScrollColor
  • handle runtime changes for small header when app bar is lifted

Before & after - visual documentation

4522.mp4

Test plan

Run test-stack-header-background-android SFT.

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

Stack created with GitHub Stacks CLIGive Feedback 💬

@kligarski
kligarski requested a balanced review from Copilot August 19, 2026 12:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Android stack header background customization by exposing backgroundColor and scrolledBackgroundColor through the JS/TS types and wiring them into the native Android header implementation, plus a manual test scenario to validate the visual behavior.

Changes:

  • Exposed backgroundColor / scrolledBackgroundColor in Fabric/native props and public Android header config types.
  • Added Android native plumbing (config provider props, invalidation flags, view manager setters) and applied colors in the header applicator.
  • Added a new single-feature manual test scenario for validating background/scrim/lift behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/fabric/stack/StackHeaderConfigAndroidNativeComponent.ts Adds new native prop types for background colors.
src/components/stack/header/StackHeaderConfig.android.types.ts Documents and exposes new Android header color props.
apps/src/tests/single-feature-tests/stack-v5/test-stack-header-background-android/scenario.md Manual QA steps for verifying color behavior and transitions.
apps/src/tests/single-feature-tests/stack-v5/test-stack-header-background-android/scenario-description.ts Registers the scenario metadata.
apps/src/tests/single-feature-tests/stack-v5/test-stack-header-background-android/index.tsx Implements the interactive test screen for the new props.
apps/src/tests/single-feature-tests/stack-v5/index.ts Adds the new scenario to the scenario group exports/registry.
android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderInvalidationFlags.kt Adds invalidation flag for background color changes.
android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfigurationProviding.kt Adds background color fields to the configuration provider contract.
android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfigViewManager.kt Wires new props from RN to the view.
android/src/main/java/com/swmansion/rnscreens/stack/header/config/StackHeaderConfig.kt Stores new props and invalidates appropriately.
android/src/main/java/com/swmansion/rnscreens/stack/header/StackHeaderCoordinatorLayout.kt Applies background colors when invalidated.
android/src/main/java/com/swmansion/rnscreens/stack/header/StackHeaderApplicator.kt Implements application of background/scrim/lift colors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/fabric/stack/StackHeaderConfigAndroidNativeComponent.ts
Comment thread src/components/stack/header/StackHeaderConfig.android.types.ts
Comment thread src/components/stack/header/StackHeaderConfig.android.types.ts
@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch from fa79061 to b542077 Compare August 20, 2026 08:14
@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch from b542077 to a9e82a8 Compare August 20, 2026 14:04
@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch 2 times, most recently from 0fae836 to cb98a1a Compare August 21, 2026 12:21
@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch from cb98a1a to 3b930c1 Compare August 21, 2026 14:37
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d07de3ee-34dd-47cf-a92f-cc316616e02f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch from 3b930c1 to bd2eaec Compare August 21, 2026 14:43
@kligarski
kligarski force-pushed the @kligarski/stack-v5-android-header-background branch from bd2eaec to 5056b2b Compare August 21, 2026 14:44
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