Skip to content

Commit 584755d

Browse files
authored
fix(android): prevent splash screen from being shown during navigation (#10999)
1 parent dbc6456 commit 584755d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/core/application/application.android.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { androidGetForegroundActivity, androidGetStartActivity, androidSetForegr
4545
import { getImageFetcher, getNativeApp, getRootView, initImageCache, setA11yUpdatePropertiesCallback, setApplicationPropertiesCallback, setAppMainEntry, setNativeApp, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
4646
import { getNativeScriptGlobals } from '../globals/global-utils';
4747
import type { AndroidApplication as IAndroidApplication } from './application';
48+
import { enableEdgeToEdge } from '../utils/native-helper-for-android';
4849
import lazy from '../utils/lazy';
4950

5051
declare class NativeScriptLifecycleCallbacks extends android.app.Application.ActivityLifecycleCallbacks {}
@@ -66,6 +67,9 @@ function initNativeScriptLifecycleCallbacks() {
6667
// console.log('NativeScriptLifecycleCallbacks onActivityCreated');
6768
this.setThemeOnLaunch(activity);
6869

70+
// Make sure to call this after setThemeOnLaunch, otherwise it'll cause issues with window decoration
71+
enableEdgeToEdge(activity);
72+
6973
if (!Application.android.startActivity) {
7074
Application.android.setStartActivity(activity);
7175
}

packages/core/ui/frame/activity.android.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import '../../globals';
22
import { setActivityCallbacks } from '.';
33
import { Application } from '../../application';
44
import { isEmbedded } from '../embedding';
5-
import { enableEdgeToEdge } from '../../utils/native-helper-for-android';
65
const EMPTY_FN = () => {};
76
declare const com: any;
87

@@ -22,7 +21,7 @@ if (!isEmbedded()) {
2221
// Set isNativeScriptActivity in onCreate.
2322
// The JS constructor might not be called because the activity is created from Android.
2423
this.isNativeScriptActivity = true;
25-
enableEdgeToEdge(this);
24+
2625
if (!this._callbacks) {
2726
setActivityCallbacks(this);
2827
}
@@ -79,7 +78,7 @@ if (!isEmbedded()) {
7978
// Set isNativeScriptActivity in onCreate.
8079
// The JS constructor might not be called because the activity is created from Android.
8180
activity.isNativeScriptActivity = true;
82-
enableEdgeToEdge(this);
81+
8382
if (!activity._callbacks) {
8483
setActivityCallbacks(activity);
8584
}

0 commit comments

Comments
 (0)