mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(android): edge-to-edge expose helper enableEdgeToEdge
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
10
packages/core/utils/native-helper.d.ts
vendored
10
packages/core/utils/native-helper.d.ts
vendored
@@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user