Skip to content
Validating Split-Screen Content Overflow in HarmonyOS 7.0 Parallel Vision
Mobile Development 23 min read

Validating Split-Screen Content Overflow in HarmonyOS 7.0 Parallel Vision

This article details an experimental methodology for validating split-screen content overflow in HarmonyOS 7.0 Parallel Vision, testing four configuration switches, three layout implementations, and systematic verification across window sizes, drag ratios, and font scaling to ensure content remains accessible.

51CTO HarmonyOS Developer Community
51CTO HarmonyOS Developer Community
51CTO HarmonyOS Developer Community

Introduction

The previous article established three split-column strategies for the "Weekend Exhibition" app: fixed equal width, fixed right width, and three-level user-draggable ratios. This article examines how pages actually use the allocated space. The system giving the right page more width does not guarantee that tables inside will automatically adopt the correct width.

The scenario remains the same: from the Old Object Design Exhibition entering the Nanan Design Museum. Left pane verifies exhibition info, right pane reads transport routes, then opens the East Gate diagram. The exhibition is still ex-001, the venue venue-001. Page relationships are unchanged; changes occur inside each page.

If a ticket-price table directly uses window width, in split-column state the table may extend beyond its page. A quick fix is dividing by two, but when the user drags to 1:2 that calculation loses its basis: the two sides do not receive equal space.

The author prefers to first clarify what a given number represents before deciding how to adjust it. Window width, page width, content width after padding — all can be represented by a single number; once only the variable name width remains, the distinctions between them easily disappear.

This article tests a hypothesis: organizing content based on the available space of its owning page, rather than whole-window or half-window assumptions, can more stably handle ratio changes. The long exhibition name "Old Object Design Exhibition: Design Observation from Daily Objects to Living Spaces" is reused, plus long table headers and fixed-width images, to surface problems hidden in equal-width layouts.

Capability Analysis

Huawei's Parallel Vision provides two relevant configurations. Understanding them requires keeping three distinct observation objects in mind:

Observation Objects

Window Size — Read via windowRect, windowSizeChange. Question: What does the window interface return under current configuration?

Page Size — Read via NavDestination size and page container measurement. Question: How much space did this page actually receive?

Drawable Area — Read via WindowProperties.drawableRect. Question: Which caliber does the current drawable area reading adopt?

Inside the page the content area can be further subdivided. A table belongs to the content area; the page's outer frame width cannot be handed directly to the table and then have left/right padding added on top. Divider lines, page boundaries, and content boundaries must also be observed separately. enableReducedContainerSize defaults to off. When enabled, during Parallel Vision split-column, related lpx, horizontal breakpoints, window width, and screen width calculations use a reduced scale. The documentation phrasing is "calculated according to right page size", and this capability takes effect across the entire application.

This affects how we understand the left page. If a reading is calculated by the right page, we cannot treat it as the left page's true width just because the call occurs in left-page code. Call location and return-value semantics must be verified separately. drawableRectHook is supported from API 26/26.0.0, also default off. It controls the page-level container capability of WindowProperties.drawableRect; when enabled the description is also "calculated according to right page size". The virtual container is a companion capability; we cannot mark both configurations as first provided in HarmonyOS 7 just because this article discusses HarmonyOS 7.

The official equal-width example also mentions "half of original size". This matches the default 1:1 scenario but is insufficient as a general formula. Once in unequal-width layout, both page sizes must be recorded independently; especially, a single right-side caliber must not cover both sides.

Two more boundaries: exiting Parallel Vision split-column (e.g., entering a full-screen page) automatically disables the virtual container capability; when configuring window split-screen support for Parallel Vision, screen width uses original size for calculation. The latter is left for the next article; this article stays in a non-system-split environment.

For page observation, the official docs list navDestinationUpdate and onNavDestinationSizeChange() among the pathways. The app continues to use Navigation. Window listening and page listening each carry observation duties: the window not growing does not mean the two internal pages have not reallocated space.

Solution Design

The experiment continues from C3-fixed-12 in part ③. It keeps shopping mode, WeekendExhibitionsNav, navBar, and MeetupNoteEdit transition page declarations, with both wide and square windows using fixed 1:2. This ratio is chosen to expose left/right differences, not because it is the product's optimal default.

First, the layout implementation is fixed; only the size switches change.

Build ID Matrix

C4-R0-H0 : enableReducedContainerSize =false, drawableRectHook =false

C4-R1-H0 : enableReducedContainerSize =true, drawableRectHook =false

C4-R0-H1 : enableReducedContainerSize =false, drawableRectHook =true

C4-R1-H1 : enableReducedContainerSize =true, drawableRectHook =true

Adjacent pairs change only one switch at a time. All four groups undergo SDK configuration verification first, then runtime checks. Configuration rejection and configuration running without expected effect must leave different records.

Then, with the switch combination fixed, three layout implementations are compared:

A1 : directly uses window-read width

A2 : divides it by two

B : lets content accept parent container constraints, using the owning content area's measurement only when calculation is necessary

The first two locate erroneous assumptions; B is the implementation direction to retain.

This order seems tedious but gives differences a clear source. If virtual container is enabled, layout swapped, and font shrunk all at once, even if the picture improves, we cannot explain which change caused it.

Copy, font scaling, padding, and initial scroll position stay consistent. Nanan Design Museum remains open Tue–Sun 10:00–18:00, closed Monday; transport remains Metro Line 2 Nanan Station Exit A, ~8 min walk, enter via East Gate. Increasing description length must not incidentally change these facts.

The previously reserved VenuePlan is used in this article to observe sizes before/after full-screen. All groups place it in fullScreenPages, read-only display of a self-drawn venue map. The full-screen page role stays unchanged; ordinary-page vs full-screen page business round-trip comparison remains for part ⑥.

Core Functionality

Configuration remains in the entry module's easy_go.json, referenced via easyGo: "$profile:easy_go". Below is the C4-R1-H1 configuration; the other three groups only modify the two booleans.

{
  "common": {
    "displayModeOptions": {
      "wideWindowMode": "navigationSplit",
      "squareWindowMode": "navigationSplit",
      "navigationSplitOptions": {
        "homeNavigationId": "WeekendExhibitionsNav",
        "homePage": "navBar",
        "mode": 0,
        "transPages": ["MeetupNoteEdit"],
        "fullScreenPages": ["VenuePlan"],
        "wideSplit": { "ratio": "1 | 2", "isDraggable": false },
        "squareSplit": { "ratio": "1 | 2", "isDraggable": false },
        "disableDivider": false,
        "splitDividerColor": {
          "light": "#FF708090",
          "dark": "#FFA8B4BF"
        },
        "enableReducedContainerSize": true,
        "drawableRectHook": true
      }
    }
  }
}

No system split-screen switch is added, nor is the routing scheme changed. Static configuration is switched via build; page internals only handle layout and data.

Next, logging. A record with only width and height is hard to debug, so the app defines its own size sample structure:

interface SizeSample {
  runId: string;
  stepId: string;
  pageName: string;
  pageInstanceId: string;
  exhibitionId: string;
  venueId: string;
  source: string;
  sequence: number;
  sampledAt: number;
  rawWidth: number;
  rawHeight: number;
  rawUnit: 'px' | 'vp';
  widthVp: number;
  heightVp: number;
  conversionContext: string;
}
runId

correlates build, layout scheme, ratio, copy, and device records. source distinguishes window reading, page measurement, and content-area measurement. Unit is confirmed at collection entry; you cannot see a number and uniformly convert to pixels — converting an already-vp value again introduces new error.

Page instance identification is equally necessary. The same VenueGuide can appear in different browsing sessions; same page name does not mean same observation. After an instance exits, old subscriptions must not continue overwriting the current page's records.

Window side observes size events via windowSizeChange; page side observes via Navigation's corresponding interfaces. During integration, each SDK's signature, unit, and registration location must be checked item by item, and subscriptions/unsubscriptions managed in pairs. Page hide and instance destroy must be distinguished to avoid re-registering on every back navigation.

Logs are appended separately by event. If inside a page callback you read window properties again, that read must keep its own timestamp. Two values appearing in the same code block does not mean they belong to the same atomic state, let alone dictate system callback order.

The layout itself should depend as little as possible on these reads. The ArkUI content component below lets long text accept parent container width; measurement fields are for observation only, not driving component width.

@Component
struct VenueTextBlock {
  @Prop heading: string = '';
  @Prop body: string = '';
  private measuredWidthVp: number = 0;

  build() {
    Column({ space: 8 }) {
      Text(this.heading)
        .fontSize(20)
        .width('100%')
      Text(this.body)
        .fontSize(16)
        .width('100%')
    }
    .width('100%')
    .alignItems(HorizontalAlign.Start)
    .onSizeChange((_oldSize, newSize) => {
      this.measuredWidthVp = newSize.width;
    })
  }
}

This component sits inside the existing page content area, with the outer layer responsible for padding and vertical scrolling. onSizeChange reports size in vp; this content-component measurement still cannot replace NavDestination outer-frame measurement. Percentage width also requires the parent container to have correct constraints; checking boundaries along the layout tree remains necessary work.

The ticket-price table follows the same principle: headers may wrap, column widths constrained by content area; when horizontal viewing is needed, an explicit scroll entry is provided. The venue map keeps its aspect ratio; the East Gate and legend in the map must remain recognizable. Shrinking font or hiding a column cannot serve as evidence of content completeness.

From VenueGuide opening VenuePlan, wait for the corresponding page to become visible and obtain a new size record. On return, re-observe both pages; do not reuse cached full-screen width, nor actively push a new detail to "restore" the scene. Here full-screen means exiting the app-internal split-column, not occupying the device screen.

Verification

First check build configuration and compilation, then check on-device page rendering. Each round records device, full OS version, SDK/API, window condition, actual split-column state, font scaling, and configuration and copy versions. Screenshots must be traceable to corresponding logs, not stand alone as conclusions.

Fixed ratios first cover 1:1, 1:2, 2:1, then use part ③'s C3-drag branch. With drag enabled, fixed ratio becomes invalid; initial expectation remains 1:1; drag process and three snap positions after release are recorded separately. Switching fixed-ratio builds and dragging the divider are two distinct operations; they cannot be spliced into one continuous trajectory.

For each size-switch group execute the same process, then fix configuration and incrementally add font scaling. Pay special attention to the left side: right-side caliber readings may look reasonable while the left-side long exhibition name or table has already lost sufficient space.

Check Items

Four switch groups — Observe sources and differences of window, page, drawableRect. Result: Pending.

A1/A2/B — Observe whether long exhibition name, table headers, and legend are fully accessible. Result: Pending.

Three fixed ratios — Observe actual left/right sizes, content area and divider occupancy. Result: Pending.

Drag and snap — Observe intermediate changes, post-release sizes, and old caches. Result: Pending.

Full-screen round-trip — Observe re-measurement and layout on enter and return. Result: Pending.

Font scaling — Observe wrapping, table content, action buttons. Result: Pending.

Narrow window and split-column off — Observe single-page browse, edit, and return. Result: Pending.

Before statistics, "truncation" must be defined. Normal wrapping is not truncation; content below the first screen but reachable via conventional scroll cannot be directly counted as failure. What must be recorded are required-read content or controls that are clipped by the boundary and cannot be fully accessed.

The author records three states per element: directly visible, reachable after action, unreachable. This preserves first-screen differences without misreporting normal scrolling as layout defects. Table headers, transport entrance sentence, East Gate legend, and back button should have stable element identifiers for cross-configuration comparison.

Notes still follow previous rules. Each test case starts at 14:00/East Gate gather, edits to 14:30/Meet at East Gate; on save success return, cancel and system back discard draft. Size correct but save button unreachable still counts as failure. Invalid identity parameters should still show a prompt and allow return, not mask the problem by falling back to the first exhibition.

The table above retains pending status; concrete conclusions will be filled by records from the corresponding environments. Continuous full-screen round-trips must also check for duplicate subscriptions and stale instance logs, avoiding a case where a static screenshot passes once but the second open reuses old sizes.

Conclusion

Troubleshooting page overflow first requires giving every size a clear identity. Knowing which interface it comes from, which page it belongs to, and what unit it uses enables judging whether it fits the current calculation. Simply changing whole-window width to half-window width still retains a dependency on layout ratio.

The four switch groups, three layout implementations, and observation fields organized in this article provide a verifiable path for such judgment. The official "calculated according to right page size" and the "half" in the equal-width example each have their applicable context; the actual space gained by left and right pages must be observed independently.

Implementation-wise, prefer letting content accept parent container constraints, leaving explicit size calculation only where it is truly needed. Acceptance continues to ask whether the user can read the information, see the entrance, save notes, and return. Correct measurement and task completion must be checked together.

The next article will reuse this layout and business conventions, turning to runtime determination under system split-screen: when the window form changes, when can we still split columns, and when should we fall back to single page. The page-internal size records will also become the basis for distinguishing window problems from layout problems.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ArkUIHarmonyOS 7.0content overflow validationdrawableRectHookenableReducedContainerSizelayout testingonNavDestinationSizeChangeParallel Visionsplit-screen layoutwindowSizeChange
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.