@oh-expo/expo-splash-screen
v55.0.25-harmony.0
Published
expo-splash-screen 的 HarmonyOS 适配包(ExpoModule + rootViewComponents,expo-modules-core 体系)
Maintainers
Readme
@oh-expo/expo-splash-screen
让
expo-splash-screen(启动屏控制)在 HarmonyOS / OpenHarmony 上运行的适配包。
通过 expo-modules-core 体系提供 ExpoSplashScreenModule 原生模块 +
ExpoSplashScreenView rootViewComponents(模块名 ExpoSplashScreen),
接口收口自 [email protected] 权威 d.ts。
支持基线
| 项 | 值 |
| --- | --- |
| 适配目标 | [email protected] |
| 运行时底座 | @expo-harmony/[email protected](本地 HAR) |
| 鸿蒙 SDK | API 26(SDK 26.0.0 锚定,@kit.ArkUI UIContext/DrawableDescriptor + @kit.LocalizationKit resourceManager) |
| 权限 | 无 |
实现面
preventAutoHideAsync/setOptions(duration, fade)/hide/hideAsync+ 内部_internal_*方法;生命周期钩子onContentAppeared/onWindowStageSetup/onPrepareForReload驱动隐藏决策;- 集成形态:ExpoSplashScreenModule(模块)+ ExpoSplashScreenView(rootViewComponents, attachSplashScreenView 订阅渲染状态);
- 渲染资源:
expo_splash_screen_background/expo_splash_screen/expo_splash_screen_resize_mode/expo_splash_screen_image_width(宿主资源,缺失时降级仅背景);淡出动画ui.animateTo+ 看门狗定时器兜底。
快速开始
安装 npm 包(peer 依赖
expo-splash-screen原包与 expo-modules-core 自动安装):npm install @oh-expo/expo-splash-screen拷贝 HAR 到宿主并声明 ohpm 依赖:
cp node_modules/@oh-expo/expo-splash-screen/local-hars/expo_splash_screen.har harmony/local-hars/// harmony/oh-package.json5 { "dependencies": { "@oh-expo/expo-splash-screen": "file:local-hars/expo_splash_screen.har" } }JS 侧使用(对外契约由原包提供,含 rootViewComponents 注册):
import * as SplashScreen from 'expo-splash-screen';
构建与校验
pnpm har:prepare # hvigorw assembleHar → local-hars/expo_splash_screen.har
pnpm har:prepack # 发布前校验(必需文件 / scope / -harmony.N 版本 / HAR 产物)状态与来源
- ⚠️ 实现已落盘并经 assembleHar / 宿主接入编译验证(真机功能验证 ⏳);
- 接口契约锚定
[email protected]权威 d.ts,规格见主仓docs/adaptations/expo-splash-screen.md与acceptance/ledger.md(S4 前置门口径)。
