feat(android): tap-to-toggle HUD visibility (A1)
On Android, a short tap on the empty game area (not on a card) toggles the HUD band, info column, and action bar between Visible and Hidden. Layout recomputes with band_h=0 when hidden so cards fill the full screen. Any modal open restores the HUD to Visible automatically. - hud_plugin: HudVisibility resource, HudBand/HudColumn/HudActionBar markers, apply_hud_visibility (fires synthetic WindowResized), restore_hud_on_modal, and Android-only toggle_hud_on_tap + HudTapTracker (15 px slop, skips card taps via DragState.is_idle()) - layout: compute_layout gains hud_visible: bool; passes band_h=0.0 when hidden; all callers updated - input_plugin: TouchDragSet (AfterStartDrag / BeforeEndDrag) public system-set anchors for cross-plugin ordering - table_plugin: setup_table + on_window_resized read HudVisibility and pass hud_visible to compute_layout - Desktop behaviour is unchanged (HudVisibility always Visible, tap system is #[cfg(target_os = "android")] gated) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -604,7 +604,7 @@ mod tests {
|
||||
use crate::layout::compute_layout;
|
||||
|
||||
let game = GameState::new(42, DrawMode::DrawOne);
|
||||
let layout = compute_layout(Vec2::new(1280.0, 800.0), 0.0, 0.0);
|
||||
let layout = compute_layout(Vec2::new(1280.0, 800.0), 0.0, 0.0, true);
|
||||
// A cursor far off-screen should never hit anything.
|
||||
assert!(!cursor_over_draggable(Vec2::new(-9999.0, -9999.0), &game, &layout));
|
||||
}
|
||||
@@ -624,7 +624,7 @@ mod tests {
|
||||
let mut app = App::new();
|
||||
app.add_plugins(MinimalPlugins)
|
||||
.insert_resource(GameStateResource(game))
|
||||
.insert_resource(LayoutResource(compute_layout(Vec2::new(1280.0, 800.0), 0.0, 0.0)))
|
||||
.insert_resource(LayoutResource(compute_layout(Vec2::new(1280.0, 800.0), 0.0, 0.0, true)))
|
||||
.insert_resource(DragState::default())
|
||||
.add_systems(Update, update_drop_target_overlays);
|
||||
app
|
||||
|
||||
Reference in New Issue
Block a user