Skip to content

iOS: route status-bar taps into CN1 pointer handling#4707

Merged
liannacasper merged 1 commit intomasterfrom
codex/fix-ios-status-bar-scroll-behavior
Apr 6, 2026
Merged

iOS: route status-bar taps into CN1 pointer handling#4707
liannacasper merged 1 commit intomasterfrom
codex/fix-ios-status-bar-scroll-behavior

Conversation

@liannacasper
Copy link
Copy Markdown
Collaborator

Motivation

  • iOS handles status-bar taps at the native level which can prevent Codename One pointer events from reaching the existing status-bar component logic, so status-bar taps should be routed into the CN1 pointer pipeline.
  • Provide a native-side hook that converts the OS status-bar tap into the existing CN1 press/release callbacks so Java-side createStatusBar() logic can trigger scroll-to-top.

Description

  • Added UIScrollViewDelegate conformance to CodenameOne_GLViewController to receive the system status-bar tap callback via scrollViewShouldScrollToTop:.
  • Introduced an invisible UIScrollView named cn1StatusBarTapProxy installed from viewDidLoad that has scrollsToTop = YES and is sized to the view so the system will invoke the delegate on a status-bar tap.
  • Implemented scrollViewShouldScrollToTop: to synthesize a top-edge pointer press/release by calling pointerPressedC(...) and pointerReleasedC(...) with coordinates at the top center, and then reset the proxy content offset to avoid visible scrolling.
  • Set autoresizing and interaction properties for the proxy and added cleanup in dealloc (respecting non-ARC release conventions) so it survives rotations/layout and doesn't leak.

Testing

  • Attempted the fast smoke helper ./scripts/fast-core-unit-smoke.sh following repository guidance to validate core unit tests, but the script failed in this environment because the Java 8 toolchain was not available (JAVA_HOME not configured to a Java 8 runtime), so no tests executed.
  • No other automated tests were run in this environment; runtime validation is recommended on an iOS device/simulator with Java 8 present for the helper script to run.

Codex Task

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 6, 2026

Compared 35 screenshots: 35 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 83 seconds

Detailed Performance Metrics

Metric Duration
Simulator Boot 1000 ms
Simulator Boot (Run) 0 ms
App Install 2000 ms
App Launch 3000 ms
Test Execution 137000 ms

@liannacasper liannacasper merged commit 91f1977 into master Apr 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tapping a button in the StatusBar does not work on iOS device (iPhone Xr)

2 participants