hmos-multidevice-fold-state

Adapt HarmonyOS apps to foldable device states, hover mode, crease avoidance, and fold continuity.

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill hmos-multidevice-fold-state-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hmos-multidevice-fold-state
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/harmonyos/solutions/HMOS-technologies/multi-device/hmos-multidevice-fold-state
Command: npx skills add https://github.com/IsKenKenYa/skills --skill hmos-multidevice-fold-state-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Foldable HarmonyOS devices introduce layout and state challenges that standard responsive design cannot handle: hover-mode split screens, content falling into the crease region, orientation flapping, and lost scroll/input/playback state after folding or unfolding. This Skill provides a phase-based (REQ/DEV/FIX/VAL) workflow with scene routing to design, implement, fix, and verify fold-state adaptation correctly. ## Core Features & Use Cases - Scene-based routing: Four P0 scenes cover hover-mode split-screen and multi-form-factor mapping (FOLD-01), crease-region avoidance (FOLD-02), fold/unfold continuity for scroll, input, image, and video state (FOLD-03), and fold-related bug remediation (FOLD-04). - Concrete implementation guidance: References detail FoldStatus/foldDisplayMode detection via @ohos.display, FolderStack vs FoldSplitContainer selection, crease coordinate mapping with direction scoring, delayed orientation scheduling, and video continuity via snapshot-restore with onPrepared plus timer fallback. - Multi-form-factor support: Covers tri-fold F/M/G form mapping, inner/outer screen ratio differences (e.g. Pura X 1:1 outer screen), and small-square-screen immersive browsing. - Use Case: A video app shows a black screen in hover mode because the crease band was miscalculated. The skill routes to FOLD-04, applies the thickness-clamping and axis-detection fixes from the bug-fix case library, and defines the verification evidence required. ## Quick Start Ask the agent to adapt my HarmonyOS page for foldable hover mode with crease avoidance and continuous video playback across fold and unfold.

Frequently Asked Questions about hmos-multidevice-fold-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement hover mode split-screen layout in HarmonyOS?

Use FolderStack with upperItems for video-style layered layouts or FoldSplitContainer for fixed two-pane splits; both avoid the crease automatically. For custom trigger conditions or rotation strategies, listen to foldStatusChange and compute the split from getCurrentFoldCreaseRegion.

How to detect fold status changes in HarmonyOS ArkTS?

Register display.on('foldStatusChange') and display.on('foldDisplayModeChange') from @ohos.display, and read initial state with display.getFoldStatus(). Pair every registration with display.off in aboutToDisappear to avoid listener leaks.

FolderStack vs FoldSplitContainer: which should I use for foldable layouts?

FolderStack is a stack-based container suited to one large surface plus floating controls, like video playback. FoldSplitContainer gives strictly separated primary and secondary regions with configurable ratios, suited to independent panes like game screen plus controls.

Why does my HarmonyOS app show a black screen in hover mode?

Black screens in hover mode usually come from crease-band miscalculation where the avoidance area covers the main content. Clamp crease thickness to 35% of the screen dimension, ensure orientation and partitioning use the same axis conclusion, and verify both partitions have positive area.

How do I keep video playback progress when folding and unfolding?

Snapshot playback position and play/pause state in the foldStatusChange callback before layout switches, then restore via dual channels: the onPrepared callback plus a fallback timer. Set autoPlay conditionally so it does not override the restored paused state.

Should I use foldStatus or window size breakpoints for responsive layout?

Use window size breakpoints via window.on('windowSizeChange') for general layout continuity, since fold status does not change in split-screen or floating-window scenarios. Reserve foldStatus listeners for fold-specific features like hover mode and camera preview.