NumberOverlay is a SceneGraph Group component that appears when the viewer presses number keys on the remote. It accumulates up to three digits and emits the complete number after a 2-second idle period, allowing the app to tune directly to the entered channel.
Interface fields
Written by
NumberOverlay when digit entry times out (2 seconds after the last keypress). Contains the accumulated digit string (e.g. "12" or "125"). The parent screen observes this field to initiate channel tuning.Font size
The digit display usesfont:LargeBoldSystemFont. The design constant FONT_NUMBER = 72 (from AppConstants) documents the intended point size for this label.
How number entry works
Digit received
The parent screen calls
AddDigit(d) on the NumberOverlay node, passing a single digit string. The component appends the digit to the internal m.digits buffer (maximum 3 digits; the buffer resets when the limit is reached).Overlay shown
opacity is set to 1 and the lblDigits label is updated immediately. The viewer sees the accumulating number in the centre of the screen.Commit timer restarted
The 2-second
commitTimer is stopped and restarted on every AddDigit call. This gives the viewer a full 2 seconds from the last digit press to add another digit.Commit fires
When
commitTimer fires, OnCommit copies m.digits to m.top.numberCommitted, clears the display, and hides the overlay (opacity = 0).Clear function can be called at any time to reset the buffer, hide the overlay, and stop the timer without committing.
XML component definition
Layout
The overlay is centred within the safe area.ApplyResponsiveLayout uses GTV_GetLayoutContext to scale the 300 × 180 px design box to the actual display resolution. A left-edge accent bar (numAccent, 6 px wide, 0x2D57C1FF) provides a visual indicator matching the app’s primary colour.
The digit buffer resets to empty when a fourth digit is pressed, allowing the viewer to start a new sequence without needing to navigate away. This means pressing
1, 2, 3, 4 results in "4" being committed, not "1234".