dispatchKeyEvent() intercepts DPAD/media keys and re-dispatches real
KeyEvents into the WebView per the design spec's mapping table:
- DPAD center / Play-Pause -> Space
- DPAD Left/Right tap -> Arrow (5s seek); held -> Shift+Arrow (30s
seek), throttled to ~1 event/200ms since Android's own key-repeat
rate would otherwise flood the room's sync socket
- DPAD Up/Down + media Prev/Next -> P/N (title change, not
ArrowUp/Down - those are explicit no-ops in the website's TV mode
since volume is TV/AVR-controlled)
- Back: room list -> no-op; in a room + fullscreen -> Escape
(browser exits fullscreen natively); in a room + not fullscreen ->
navigate to /tv (native WebView navigation, not a website reaction)
- Menu (KEYCODE_MENU) deliberately NOT intercepted - passed through
unchanged, matching the already-confirmed-working raw-browser test
Fullscreen state comes from WebChromeClient.onShowCustomView/
onHideCustomView (needed for HTML5 video fullscreen support anyway).
Current-page tracking comes from WebViewClient.onPageFinished.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHgWjmEJXsJEi1EVAoTp4K
The plan assumed Android Studio's bundled JBR (JDK 25) would work
for Gradle 8.7 - it doesn't (crashes at startup). Task 1's actual
build used a separately-installed Temurin 21 instead, scoped
per-command to this project only. Updating the remaining tasks'
commands to match what was actually verified working.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHgWjmEJXsJEi1EVAoTp4K
Gradle wrapper pinned to 8.7, AGP 8.5.2, compileSdk 34/minSdk 21/
targetSdk 34 - the tested combination from the original app.
MainActivity is a placeholder that just loads BuildConfig.WEBSITE_URL
(the new /tv room-list route); the real key-mapping logic is a
separate follow-up commit.
Note for future builds on this machine: Android Studio's bundled JBR
is JDK 25, which Gradle 8.7 cannot run on at all (crashes at startup
with a bare version-string error). Built and verified with a
separately-installed Temurin JDK 21 instead
(C:\Users\GGB\jdks\jdk-21.0.12.1+1) - set JAVA_HOME to that for any
Gradle command in this repo, not the Android Studio JBR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHgWjmEJXsJEi1EVAoTp4K
Rebuilds the deleted WebView-shell Android app, now pointed at the
kwaba-sync website's server-side TV mode instead of the desktop
site. Key changes from the original: room selection via a new
website /tv room-list route instead of a baked-in room ID, and the
Menu-button-to-popup mapping is already confirmed working on real
hardware ahead of any app code existing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHgWjmEJXsJEi1EVAoTp4K