GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): appearance APIs before app start, replaceable Android handlers, explicit systemAppearanceChanged() by triniwiz · Pull Request #11537 · NativeScript/NativeScript

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
  • You have signed the CLA.
  • All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application.
  • Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md.

What is the current behavior?

  • On Android, Application.systemAppearance(), orientation() and layoutDirection() throw until Application.run() has initialized the module, because they read the configuration from Application.android.context. A theme module imported by the app's entry cannot read the appearance.
  • Utils.android.setDarkModeHandler() keeps the first handler it is given and ignores later ones. setStatusBarColor() and setNavigationBarColor() never change a color: they assign with ??= onto settings that always start with default colors. All three store the settings under the current activity rather than the one passed in, so refreshEdgeToEdge() on that activity loses them.
  • Application.systemAppearanceChanged(rootView, appearance) does nothing while setAutoSystemAppearanceChanged(false) is in effect, so an app that turned automatic changes off to choose its own appearance has to turn them back on around each call.

What is the new behavior?

  • The Android trait getters read the configuration from the native application when the context is not set yet. The app's code runs from the native application's onCreate, so it exists by then.
  • The setters replace the handler and the colors they are given, keep the colors they are not given, and store the settings under the activity passed in.
  • autoSystemAppearanceChanged gates only the automatic path, where the system's appearance changes. The event still fires there. An explicit systemAppearanceChanged() call applies the classes.

Tests: application/system-appearance.spec.ts (4) and utils/edge-to-edge.android.spec.ts (3).

Verified with all of these core PRs merged together (#11527–#11537): apps/automated passes on the iOS 26.4 simulator (1830 OK, 0 failed) and on an Android API 36 emulator (1692 OK; the one failure is the network-dependent IMAGE-CACHE.test_ImageCache_ValidUrl timeout, which also passes on reruns).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
triniwiz added 2 commits October 15, 2026 08:25
@triniwiz
fix(android): read app traits before the app has started
1a701b9
Application.systemAppearance(), orientation() and layoutDirection() threw
on Android until Application.run() had initialized the module, because
they read the configuration from Application.android.context, which is
only set then. Code that reads the appearance while it loads, such as a
theme module imported by the app's entry, could not use them.

They now read the configuration from the native application when the
context is not set yet. The app's code runs from the native application's
onCreate, so it exists by then.
@triniwiz
fix(android): let setDarkModeHandler and bar color setters replace va…
f98fc5b
…lues

Utils.android.setDarkModeHandler() kept the first handler it was given
and ignored later ones, and setStatusBarColor() and
setNavigationBarColor() never changed a color at all: they assigned with
`??=` onto settings that always start with default colors. All three also
stored the settings under the current activity rather than the one passed
in, so refreshEdgeToEdge() on that activity lost them.

The setters now replace the handler and the colors they are given, keep
the colors they are not, and store the settings under the activity they
were given.
This was referenced Oct 15, 2026
fix(core): css var() fallbacks, order-independent custom properties, and no crash on unresolvable ones #11527
Merged
fix(core): keyframes without a 0% or 100% keyframe animate from and to the view's own values #11528
Merged
fix(core): boolean properties and class substring operators in attribute selectors #11529
Open
feat(core): range syntax and rem/em lengths in media queries #11530
Open
feat(core): structural pseudo-classes and :root #11531
Open
feat(core): CSS Color 4 and 5 color functions #11532
Merged
feat(core): rem lengths #11533
Merged
fix(core): resolve var() in css animations and keyframes per view #11534
Merged
fix(core): keep a gesture's recognizer when its listener is swapped #11535
Open
fix(core): make background: none clear the background color #11536
Merged
@nx-cloud

nx-cloud Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4316bbf

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 39s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-15 20:42:35 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11537
npm i https://pkg.pr.new/@nativescript/vite@11537
npm i https://pkg.pr.new/@nativescript/webpack@11537

commit: 4316bbf

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@triniwiz
fix(core): apply systemAppearanceChanged() while automatic changes ar…
447ce6c
…e off

Application.systemAppearanceChanged(rootView, appearance) did nothing
while setAutoSystemAppearanceChanged(false) was in effect, so an app that
turned off automatic changes to choose its own appearance had to turn
them back on around each call.

The flag now gates only the automatic path, where the system's appearance
changes; the event still fires there. An explicit call to
systemAppearanceChanged() applies the classes.
@triniwiz
triniwiz force-pushed the fix/appearance-apis branch from ea689c9 to 447ce6c Compare October 15, 2026 13:27
@triniwiz
chore(core): drop comments
4316bbf
NathanWalker
NathanWalker approved these changes Oct 23, 2026
View reviewed changes
@triniwiz
triniwiz merged commit 26f5032 into main Oct 24, 2026
9 of 10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@triniwiz
triniwiz deleted the fix/appearance-apis branch October 24, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@NathanWalker NathanWalker NathanWalker approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@triniwiz @NathanWalker
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.