feat(android): edge-to-edge expose helper enableEdgeToEdge

This commit is contained in:
Nathan Walker
2025-09-02 09:25:10 -07:00
parent 84e9190f87
commit 2fcc5372d5
3 changed files with 13 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import '../../globals';
import { setActivityCallbacks } from '.'; import { setActivityCallbacks } from '.';
import { Application } from '../../application'; import { Application } from '../../application';
import { isEmbedded } from '../embedding'; import { isEmbedded } from '../embedding';
import { enableEdgeToEdge } from '../../utils/android'; import { enableEdgeToEdge } from '../../utils/native-helper-for-android';
const EMPTY_FN = () => {}; const EMPTY_FN = () => {};
declare const com: any; declare const com: any;

View File

@@ -1,7 +1,7 @@
import { platformCheck } from './platform-check'; import { platformCheck } from './platform-check';
// importing this helper as a separate file avoids "android" symbol clash with the global android object // importing this helper as a separate file avoids "android" symbol clash with the global android object
import { resources, collections, getWindow, getApplication, getCurrentActivity, getApplicationContext, getResources, getPackageName, getInputMethodManager, showSoftInput, dismissSoftInput, setStatusBarColor, setNavigationBarColor, setDarkModeHandler } from './native-helper-for-android'; import { resources, collections, getWindow, getApplication, getCurrentActivity, getApplicationContext, getResources, getPackageName, getInputMethodManager, showSoftInput, dismissSoftInput, setStatusBarColor, setNavigationBarColor, setDarkModeHandler, enableEdgeToEdge } from './native-helper-for-android';
export { dataSerialize, dataDeserialize } from './native-helper-for-android'; export { dataSerialize, dataDeserialize } from './native-helper-for-android';
export { getWindow } from './native-helper-for-android'; export { getWindow } from './native-helper-for-android';
@@ -21,6 +21,7 @@ export const android = {
setStatusBarColor, setStatusBarColor,
setNavigationBarColor, setNavigationBarColor,
setDarkModeHandler, setDarkModeHandler,
enableEdgeToEdge,
}; };
/** /**

View File

@@ -110,6 +110,16 @@ export const android: {
setStatusBarColor: (lightColor: Color | null = null, darkColor: Color | null = null) => void; setStatusBarColor: (lightColor: Color | null = null, darkColor: Color | null = null) => void;
setNavigationBarColor: (lightColor: Color | null = null, darkColor: Color | null = null) => void; setNavigationBarColor: (lightColor: Color | null = null, darkColor: Color | null = null) => void;
setDarkModeHandler: (handler: (bar: 'status' | 'navigation', resources: android.content.res.Resources) => boolean) => void; setDarkModeHandler: (handler: (bar: 'status' | 'navigation', resources: android.content.res.Resources) => boolean) => void;
enableEdgeToEdge: (
activity: androidx.appcompat.app.AppCompatActivity,
options?: {
statusBarLightColor?: Color;
statusBarDarkColor?: Color;
navigationBarLightColor?: Color;
navigationBarDarkColor?: Color;
handleDarkMode?: (bar: 'status' | 'navigation', resources: android.content.res.Resources) => boolean;
},
) => void;
}; };
/** /**