hmos-multidevice-avoid-areas

Implements HarmonyOS safe-area, cutout, immersive, and keyboard avoidance adaptation across devices.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? HarmonyOS apps must handle system bars, display cutouts, immersive full-screen layouts, and soft keyboard overlap without hardcoding sizes, and this Skill routes those problems to the correct avoidance strategy with concrete API guidance. ## Core Features & Use Cases - Scene-based routing: Classifies requests into four scenarios (avoid-area detection, safe-area expansion, immersive full-screen, keyboard avoidance) across REQ, DEV, FIX, and VAL phases with a decision tree. - Reference knowledge base: Ships six reference documents covering AvoidAreaType APIs, expandSafeArea usage, immersive layout patterns, keyboard handling, 12 bug-fix cases, and complete development scenario implementations. - HDS component recommendations: Suggests HDS UI Design Kit components (HdsNavigation, HdsTabs, hdsMaterial) as built-in alternatives to manual avoidance code when applicable. - Use Case: When a user reports that a foldable device's title bar overlaps the status bar after unfolding, the Skill routes to the FIX phase, identifies the missing avoidAreaChange listener, and provides the corrected implementation. ## Quick Start Ask the assistant to fix a HarmonyOS page where the bottom content is covered by the navigation indicator in full-screen mode.

Frequently Asked Questions about hmos-multidevice-avoid-areas

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

FAQPage Schema
How do I handle status bar overlap in a HarmonyOS full-screen app?

Call setWindowLayoutFullScreen(true), then use getWindowAvoidArea with TYPE_SYSTEM to get the status bar height and apply it as top padding. Register an avoidAreaChange listener so the padding updates when the device folds or rotates.

How to prevent the soft keyboard from covering input fields in ArkUI?

Set KeyboardAvoidMode.RESIZE via setKeyboardAvoidMode after loadContent so the window shrinks when the keyboard appears. For long forms, wrap inputs in a Scroll or List and scroll to the focused field using avoidAreaChange keyboard height callbacks.

What is the difference between expandSafeArea and getWindowAvoidArea in HarmonyOS?

expandSafeArea extends a component's background into system, cutout, or keyboard regions automatically, suiting simple background extension. getWindowAvoidArea returns exact region rectangles for manual padding calculations when precise content positioning is required.

Why does getWindowAvoidArea return zero or stale values on foldable devices?

Calling it inside windowSizeChange or display change callbacks reads values before the system UI finishes updating. Use the dedicated avoidAreaChange listener instead, whose callback data is guaranteed current, and call it after the window is created.

Can HDS components replace manual safe-area handling in HarmonyOS?

Yes, HdsNavigation with enableComponentSafeArea handles title bar safe areas automatically, and hdsMaterial provides immersive effects without manual code. Note hdsMaterial requires version 6.1.0(23) and only supports phones and tablets.

When should cutout avoidance take priority over immersive layout handling?

When UI elements are obscured by a display cutout, route to cutout handling first even if full-screen APIs are in use. Four-direction cutout detection via TYPE_CUTOUT ensures content stays clear regardless of device orientation.