You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Active development happens in the worktree at `/home/coder/trmnl-nook-sleep` on branch `feature/tap-menu-sleep`. The main checkout is at `/home/coder/trmnl-nook-simple-touch`.
87
+
Active development happens in the worktree at `/home/coder/trmnl-nook-showcase` on branch `feature/showcase-mode`. The main checkout is at `/home/coder/trmnl-nook-simple-touch`.
88
88
89
-
> **CRITICAL for agents:** The devcontainer mounts `/home/coder/trmnl-nook-sleep` as `/workspace`.
90
-
> All source edits MUST be made to files under `/home/coder/trmnl-nook-sleep/` (the worktree).
91
-
> Editing `/home/coder/trmnl-nook-simple-touch/` (the main checkout) has NO effect on builds.
89
+
> **CRITICAL for agents:** The devcontainer mounts `/home/coder/trmnl-nook` as `/workspace`.
90
+
> All source edits MUST be made to files under the active worktree (e.g. `/home/coder/trmnl-nook-showcase/`).
91
+
> Editing the main checkout directly has NO effect on builds.
The physical screen is **800px wide × 600px tall** (landscape, hardware mounted sideways). `RotateLayout` applies a 90° rotation to all UI content so it renders correctly.
A point at child coordinates `(cx, cy)` maps to physical coordinates:
109
+
```
110
+
physical_x = 800 - cy
111
+
physical_y = cx
112
+
```
113
+
114
+
-**child-X axis → physical-Y axis** (vertical on screen)
115
+
-**child-Y axis → physical-X axis** (horizontal on screen, inverted)
116
+
117
+
### Root child dimensions
118
+
119
+
`RotateLayout.onMeasure` swaps width/height specs for 90°, so the `root` FrameLayout child thinks it is **800px wide × 600px tall** even though it visually renders as 600px wide × 800px tall on the physical screen.
120
+
121
+
|`root` field | Value | Physical meaning |
122
+
|---|---|---|
123
+
|`root.getWidth()`| 800 | physical height |
124
+
|`root.getHeight()`| 600 | physical width |
125
+
126
+
### Menu bar layout rules
127
+
128
+
The menu is a **HORIZONTAL**`LinearLayout` inside `root`.
129
+
130
+
-**Width**: fixed value less than 800 (currently `480`) with `Gravity.CENTER` — gives a floating centred bar. Do **not** use `MATCH_PARENT` (that gives 800px = full physical height). Do **not** use 600 (that is `root.getHeight()` = physical width).
131
+
-**Height**: `WRAP_CONTENT` (~40px)
132
+
-**Buttons**: `new LinearLayout.LayoutParams(0, 40, 1.0f)` — `width=0, weight=1` distributes evenly across child-X (= physical-Y); `height=40` sets bar thickness in child-Y (= physical-X).
133
+
-`Button.setMinWidth(0)` + `Button.setMinimumWidth(0)` are **required** — Android's Button has a built-in minimum width that breaks weight distribution without them.
134
+
135
+
### Re-show clipping fix
136
+
137
+
After `menuLayout.setVisibility(GONE)` → `VISIBLE`, Android may skip re-measuring since params haven't changed. `requestLayout()` alone is unreliable. The fix: call `setLayoutParams()` with the desired params **every time the menu is shown** — this forces a re-measure and correct `Gravity.CENTER` positioning.
138
+
139
+
### `dispatchDraw` canvas state
140
+
141
+
`RotateLayout.dispatchDraw` must call `canvas.save()` / `canvas.restoreToCount()` around the transform. Without it the canvas state leaks to subsequent draw passes, causing right-side EPD ghosting.
0 commit comments