Compare commits

...
28 Commits
Author SHA1 Message Date
waoziandClaude Opus 5.5 f0529e8234 Save Diary entries without a waiting-to-save note
Diary 1.1.5 still saves shortly after typing stops, but no longer shows
"Waiting to save…" below the entry. Photo and read errors still show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 00:50:33 -03:00
waoziandClaude Opus 5.5 6712e5db0c List the Diary keyboard, Apps window and Lumi fixes in 2.1.26
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 00:40:57 -03:00
waoziandClaude Opus 5.5 2b3d10148e Open Lumi without freezing the practice window
A long chat is measured across frames behind a loading bar, and rows keep
heights measured for the same content after a sync moves them. Account
access is read once per pass instead of per row, and Lumi 1.3.3 prepares
command suggestions only while you type.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 00:40:57 -03:00
waoziandClaude Opus 5.5 dda2d2e894 Keep the minimized practice window over the Apps screen
Apps is a Kryon overlay above the page, so the window is now drawn inside
its panel, above the apps, where its buttons keep working.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 00:40:57 -03:00
waoziandClaude Opus 5.5 475476ebfc Show the Android keyboard for Diary and other Kryon text fields
Kryon now reports any focused editable TextField or TextArea, so the
Android host shows the keyboard for the Diary entry without listing
every input. Kryon is updated to that change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 00:40:57 -03:00
waoziandClaude Opus 5.5 c5482abf97 Let people turn off picture-in-picture in Settings
Playback on Android gets a Picture-in-picture toggle, on by default. Off,
a running practice no longer floats over other apps on its own and the
small window's detach button is hidden. The choice is saved, imported
from backups and translated for every locale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 22:21:52 -03:00
waoziandClaude Opus 5.5 fab864ea17 Exchange sync on one thread at a time around picture-in-picture
Picture-in-picture keeps frames running while the activity is paused, so
the background practice timer and the frame both polled the same pending
sync. One applied the response while the other released it, which crashed
Inbe on a Pixel 3a when leaving the app during a practice. The frame and
the timer now take a pump lock and skip the exchange while the other
holds it. The session window test also waits for the app's first state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 22:21:51 -03:00
waoziandClaude Opus 5.5 25e703aeda Preview the practice itself in its taller minimized window
The minimized window opens at 220 by 320 units. Wim Hof shows its band
and breath count in the breathing circle, Meditation its time left and
Patterns its phase, as on the practice screens, drawn with Kryon boxes
and text so they stay above the page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 22:02:40 -03:00
waozi 7b18c1d8be Preserve live Android practices through floating-window transitions 2026-10-09 20:16:59 -03:00
waozi 5d090d0e4e Restore meditation music downloads from the Inbe website 2026-10-09 19:06:37 -03:00
waozi e77b982aa0 Add detached desktop practice windows and Android picture-in-picture 2026-10-09 16:15:05 -03:00
waoziandClaude Opus 5.5 ab3919c04b Show each minimized practice live in a resizable window
Minimizing a practice returns to the page it was started from instead
of the first pinned app, which was usually Lumi. Lumi was then drawn
cold on the minimize frame (about 56 ms on desktop, several times that
on a phone), which made the switch stutter; the start page is already
drawn. Lumi is still used when the practice was started from its chat.

The window is taller and shows the practice's own live picture above its
name and status: the Wim Hof circle breathing at its real size range,
the meditation circle, the pattern's growing circle and the moving Sun
Salutation figure. Each practice draws this through a draw_window hook,
and Sun Salutation now advances in the window like the others. The
circle is solid, so it is clearly visible on every theme. A corner
handle resizes the window; elapsed time carries between frames so a
minimized practice keeps the real clock's pace.

The window test covers all four practices: each returns to its page,
draws its picture and keeps moving until maximize returns to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 15:54:42 -03:00
waoziandClaude Opus 5.5 45309a5b6c Refresh the Play screenshots from the current app
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 15:04:19 -03:00
waoziandClaude Opus 5.5 7930aa9914 Test that a hosted Practice child keeps its own navigation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 12:04:46 -03:00
waoziandClaude Opus 5.5 6eb166e377 Move the dropped lake-bob and dusk-braid proposals to the attic
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 12:04:46 -03:00
waoziandClaude Opus 5.5 7c6d5a128d Note the small practice window and sync fixes for 2.1.25
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 12:03:24 -03:00
waoziandClaude Opus 5.5 98c2c6ef6f Run the minimized practice window like a small player
The practice window is larger and shows the live breathing circle, with
a maximize button beside the X. The X asks to end the practice right over
the open app, and ending it keeps that app open; the prompt belongs to
the running practice, so it is no longer cleared off its own screen.
Breath cues keep playing while the practice runs in the window. Practice
opens its home while a practice is minimized, and Start or any other
start returns to the running practice instead of starting another.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 12:02:32 -03:00
waoziandClaude Opus 5.5 6c5da2dee3 Keep visible practices free of frame-thread sync and request work
On Android and the web a sync runs on the frame thread, and every one
stopped the breathing circle for about 0.3 s on a Pixel 3a while a
practice was running. A practice on screen, also in its small window,
now holds back starting a sync and finishing one that began before it;
Lumi and package requests, which use the frame thread everywhere, wait
too. Scheduled work runs when the practice ends. In the background
nothing is drawn, so background practice sync continues.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:25:31 -03:00
waoziandClaude Opus 5.5 33874fd8cb Keep two release screenshot checks steady on CI
The zoom test could read the app database before its tables existed on
a slow runner. CI's tesseract 5.3.4 read one letter of the large
"Material" value wrong at 250% although the pixels are complete; one-word
labels now accept a single misread letter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 10:53:31 -03:00
waozi 1f36722f3c Use pinned Android foreign declaration syntax 2026-10-09 10:48:30 -03:00
waozi 06b21c4d67 Keep WHM animation smooth and reduce per-frame sync work 2026-10-09 10:41:28 -03:00
waoziandClaude Opus 5.5 06d1c49694 Check the reminder menu stays open through its Kryon node
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 10:00:23 -03:00
waoziandClaude Opus 5.5 bbe4f08d85 Prepare 2.1.24
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 09:52:38 -03:00
waoziandClaude Opus 5.5 73deeeaca4 Let Kryon dropdowns keep their own menu state
Kryon now keeps a dropdown's open menu, highlight and scroll on its
retained node, so the screens pass only the selected value and read
changed and selected_index. The stored menu results in the app and
settings state, and the code that shifted or reset them, are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 09:52:13 -03:00
waozi 1007f934f9 Verify Pixel focus through its native launcher alias 2026-10-09 09:44:19 -03:00
waoziandClaude Opus 5.5 a4138169aa Link the session screen into the frame pacing test
Also check that a practice in its small window keeps the full rate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 09:42:49 -03:00
waoziandClaude Opus 5.5 677be34dbb Keep practice animation smooth while sharing it across devices
On Android and the web each sync runs on the frame thread. A running
practice published its live state and started a sync every two seconds,
and read the shared record four times a second, which made the breathing
circle stutter on phones signed in to an account. It now republishes
every ten seconds (phase, round and pause changes still publish at
once), reads the record only after stored data changes, and other
devices count the shared clock on between snapshots. Lumi Telegram polls
every ten seconds during a practice, and a practice in its small window
keeps the full frame rate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 09:35:35 -03:00
waoziandClaude Opus 5.5 e54c7fdca6 Make Customize menus open and keep the chosen breathing animation
The breathing animation, background music and leaderboard practice
dropdowns never kept their open state, so their menus closed again in
the next frame and nothing could be chosen. They now keep it like the
other dropdowns. A Wim Hof session also reset the animation to Linear
when it started; it now keeps In / Out. Customize treats an imported
music track as installed when its file is there, offering Test instead
of "not installed" and a download meant for the built-in tracks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 09:35:35 -03:00
152 changed files with 3844 additions and 662 deletions

No files matched your search

+29
View File
@@ -1,4 +1,33 @@
# Changelog
## [2.1.26] - 2026-10-09
### Added
- Detach a running practice into its own resizable desktop window.
- Keep the practice visible over other Android apps with picture-in-picture, which you can turn off in Settings.
### Changed
- The minimized practice window is taller and shows the breath count, time left or phase.
- Diary saves quietly, without a "Waiting to save" note.
### Fixed
- Show the keyboard in Diary on Android.
- Keep the practice window over Apps.
- Open Lumi without freezing the practice window.
## [2.1.25] - 2026-10-09
### Changed
- Minimized practices show their live circle or figure in a resizable window and return to the page you started them from.
### Fixed
- Stop syncing from pausing the breathing circle while you practice.
- Keep breath sounds playing while a practice is minimized.
- Animate the Wim Hof breathing circle smoothly, including its Customize preview.
- Keep Wim Hof timing accurate when the frame rate varies.
- Skip repeated account checks on unchanged animation frames.
## [2.1.24] - 2026-10-09
### Fixed
- Open the breathing animation, background music and other menus reliably again.
- Use the In / Out breathing animation you choose in Wim Hof sessions.
- Offer Test for your own imported music instead of "Audio not installed".
- Keep the breathing circle smooth on phones signed in to an account.
## [2.1.23] - 2026-10-09
### Added
- Customize KSS in Appearance with live preview, per-app styles, an inspector, undo, and reset to defaults.
+5
View File
@@ -423,6 +423,11 @@ session-window-ui-test: $(TARGET)
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
python3 tests/session_window_ui_test.py $(abspath $(TARGET))
.PHONY: whm-frame-performance-test
whm-frame-performance-test: $(TARGET)
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
python3 tests/whm_frame_performance_test.py $(abspath $(TARGET))
$(CELL_BUNDLES) $(INBE_BUNDLE) $(INBE_FULL_BUNDLE) &: $(CELL_SOURCES) $(CELL_RESOURCES) ziran.lock apps/versions.json scripts/check-package-versions.py scripts/generate-package-versions.py scripts/prepare-package-assets.py scripts/animation_inventory.py scripts/build-cells.sh src/practices/sun_salutation/sun_salutation_assets.zi src/practices/sun_salutation/sun_salutation_inventory.zi $(IMAGE_FILES) $(SOUND_FILES) $(FONT_FILES) $(STYLE_FILES) $(LOCALE_FILES) $(ZIRAN_BIN)
sh scripts/build-cells.sh $(ZIRAN_BIN)
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## [1.1.5] - 2026-10-10
### Changed
- Save your writing quietly, without a "Waiting to save…" note below the entry.
## [1.1.4] - 2026-10-08
- Keep date limits working when Diary updates on existing Inbe installations.
+2 -2
View File
@@ -206,8 +206,8 @@ DiaryView :: (message: DiaryMessage, observed: DiaryUiFrame, today: Date) -> Dia
frame.clipboard_text = edited.clipboard_text
}
if frame.photo_error || state.load_error || !state.saved {
status := ifx frame.photo_error then "diary_photo_error" else ifx state.load_error then "diary_read_error" else "diary_save_pending"
if frame.photo_error || state.load_error {
status := ifx frame.photo_error then "diary_photo_error" else "diary_read_error"
Text(frame.session, TextProps.{.bounds = Rectangle.{left,
area.bounds.y + area.bounds.height + cast(float32)Scale(12), width, cast(float32)Scale(40)},
.text = DiaryLocaleHost(status), .font = frame.font})
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## [1.3.3] - 2026-10-10
### Fixed
- Open the chat without a pause by preparing command suggestions only while you type.
## [1.3.2] - 2026-10-07
### Changed
- Load earlier chat messages automatically as you scroll up, preserving your reading position.
+17 -4
View File
@@ -65,6 +65,10 @@ draft_intent: LumiAction;
draft_intent_title_count: s32;
candidate_revision: s64 = -1;
candidate_actions: [20]LumiAction;
// Suggestion commands read for the current command set, in order.
candidate_ready: s32;
// Reading a command takes many text matches, so typing reads one per frame.
LUMI_CANDIDATES_PER_FRAME :: 1
// Interpretation depends on the draft and translated command set. Cursor
// blinking, scrolling and unchanged frames reuse the result, while sending
@@ -371,14 +375,23 @@ LumiView :: (message: LumiMessage, commands: LumiCommands, revision: s64) -> Lum
suggestion_count += 1
}
}
// Suggestions are offered only for typed text, so their commands are read
// once typing starts and opening Lumi never waits for them.
if revision != candidate_revision {
for index: cast(s32)0..cast(s32)19 {
candidate_actions[index] = LumiIntent(candidates[index], commands)
}
candidate_revision = revision
candidate_ready = 0
}
if typed.count > 0 {
prepared: s32 = 0
while candidate_ready < 20 && prepared < LUMI_CANDIDATES_PER_FRAME {
candidate_actions[candidate_ready] = LumiIntent(candidates[candidate_ready], commands)
candidate_ready += 1
prepared += 1
}
}
for index: cast(s32)0..cast(s32)19 {
if typed.count == 0 || frame.choosing_diary || action.kind == LUMI_COMPLETE_HABIT || suggestion_count >= limit {
if typed.count == 0 || frame.choosing_diary || action.kind == LUMI_COMPLETE_HABIT || suggestion_count >= limit ||
index >= candidate_ready {
break
}
candidate_action := candidate_actions[index]
+4 -4
View File
@@ -28,14 +28,14 @@
},
"diary": {
"id": "inbe.diary",
"version": "1.1.4",
"sequence": 6,
"version": "1.1.5",
"sequence": 7,
"bundled": true
},
"lumi": {
"id": "inbe.lumi",
"version": "1.3.2",
"sequence": 9,
"version": "1.3.3",
"sequence": 10,
"bundled": true
}
}
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

@@ -0,0 +1,30 @@
{
"model": "google/gemini-3.1-flash-image",
"elapsed_seconds": 22.35,
"dimensions": [
2048,
2048
],
"usage": {
"prompt_tokens": 5181,
"completion_tokens": 1680,
"total_tokens": 6861,
"cost": 0.1033905,
"is_byok": false,
"prompt_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0,
"audio_tokens": 0,
"video_tokens": 0
},
"cost_details": {
"upstream_inference_cost": 0.1033905,
"upstream_inference_prompt_cost": 0.0025905,
"upstream_inference_completions_cost": 0.1008
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"image_tokens": 1680
}
}
}
@@ -0,0 +1,26 @@
{
"model": "google/gemini-3.1-flash-image",
"prompt": "Use case: precise-object-edit\nAsset type: detached torso-only garment for a paper-doll animation rig.\nInput images: Image 1 is the new character's painted parts and defines the EXACT palette and matte illustration style. Image 2 is the exact torso-only shape/orientation guide; image 3 is the Inner Breeze banner style reference.\nPrimary request: Paint ONLY the separate TORSO clothing piece for this character: The adult MALE counterpart of the sunrise ponytail woman: a grown man with the same warm light peach skin, dark honey-brown hair in a very short tied-back low ponytail (the entire tail fits inside the head tile, hair fully off the face and neck), slightly thicker straight brows, small soft brown eyes and a calm quiet expression. Natural adult male proportions with slightly broader shoulders, flatter chest and a hint of an adult jaw. A plain muted lake-teal long-sleeve exercise top with a round neckline, olive-sage leggings, bare feet. No hood, no ribbon, no beard.\nComposition: Right-facing profile garment, centered on pure white with ample margin. Match the torso outline and geometry in image 2: shoulder joint is at the upper LEFT, chest at upper RIGHT, waist and hem below. This is the vest-shaped body panel of the exercise shirt, NOT a complete shirt with hanging arms. The arm is supplied by a different animation asset. Keep the softly outlined round shoulder attachment area on the upper left, but NO sleeve extending downward. Keep the bottom hem covering the hips.\nStyle: Match image 1's clothing paint exactly, muted color with soft gouache texture and quiet warm contour lines.\nConstraints: Only torso garment fabric may be visible. ZERO SKIN, ZERO NECK, ZERO HEAD, ZERO ARMS, ZERO SLEEVES EXTENDING FROM THE BODY, ZERO HANDS, ZERO PANTS, ZERO LEGS. No hood, no ribbon, no red bow. Do not include the head or any other pieces from image 1. Stop at the neckline and shirt hem. Use a plain small round neck opening. Preserve the shirt color from image 1. No labels, text, grid or ground shadow. One isolated torso clothing panel only, flat side profile as in image 2.\n",
"usage": {
"prompt_tokens": 3825,
"completion_tokens": 1680,
"total_tokens": 5505,
"cost": 0.1027125,
"is_byok": false,
"prompt_tokens_details": {
"cached_tokens": 0,
"cache_write_tokens": 0,
"audio_tokens": 0,
"video_tokens": 0
},
"cost_details": {
"upstream_inference_cost": 0.1027125,
"upstream_inference_prompt_cost": 0.0019125,
"upstream_inference_completions_cost": 0.1008
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"image_tokens": 1680
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

@@ -0,0 +1,570 @@
{
"about": "Pose timeline, rig, camera and painted-part key points for scripts/render-sun-salutation-girl.py. Positions are rig units (x right, y down, the floor at y = ground); angles are degrees, 0 = right, 90 = down. Part key points are fractions of each part image's trimmed box.",
"output": {
"width": 1536,
"height": 1024,
"fps": 30,
"detail": 1.6
},
"camera": {
"designWidth": 1536,
"designHeight": 1024,
"centerX": 780,
"groundY": 925,
"scale": 1.75,
"rigX": 630
},
"ground": 435,
"bones": {
"torso": 110,
"upperArm": 64,
"forearm": 64,
"thigh": 96,
"shin": 96,
"farOffset": [
-5,
-1
]
},
"timing": {
"hold": 1.5,
"transition": 2.0,
"breath": 0.15
},
"reach": {
"leg": 191.5,
"arm": 127.5
},
"names": [
"Mountain / prayer pose",
"Upward salute",
"Standing forward fold",
"Half lift",
"High plank",
"Low plank",
"Upward-facing dog",
"Downward-facing dog",
"Half lift",
"Standing forward fold",
"Upward salute",
"Mountain / prayer pose"
],
"sequence": [
"mountain",
"salute",
"fold",
"lift",
"plank",
"low",
"upDog",
"downDog",
"lift",
"fold",
"salute",
"mountain"
],
"poses": {
"mountain": {
"hip": [
626,
226
],
"spine": -90,
"gaze": -90,
"ankles": [
630,
417
],
"wrists": [
691,
128
],
"upright": 1
},
"salute": {
"hip": [
626,
226
],
"spine": -90,
"gaze": -98,
"ankles": [
630,
417
],
"wrists": [
626,
-11
],
"upright": 1
},
"fold": {
"hip": [
626,
226
],
"spine": 60,
"gaze": 30,
"ankles": [
630,
417
],
"wrists": [
662,
425
],
"palm": 1
},
"lift": {
"hip": [
626,
226
],
"spine": 1,
"gaze": -75,
"ankles": [
630,
417
],
"wrists": [
643,
332
]
},
"plank": {
"hip": [
622,
329
],
"spine": -19,
"gaze": -80,
"ankles": [
441,
391
],
"wrists": [
727,
421
],
"foot": 0.8,
"palm": 1
},
"low": {
"hip": [
631,
374
],
"spine": -5,
"gaze": -80,
"ankles": [
441,
391
],
"wrists": [
727,
421
],
"foot": 0.8,
"palm": 1
},
"upDog": {
"hip": [
644,
369
],
"spine": -44,
"gaze": -100,
"ankles": [
460,
413
],
"wrists": [
727,
421
],
"palm": 1,
"instep": 1
},
"downDog": {
"hip": [
550,
262
],
"spine": 42,
"gaze": 20,
"ankles": [
420,
404
],
"wrists": [
727,
421
],
"foot": 0.3,
"palm": 1
},
"plant": {
"hip": [
629,
277
],
"spine": 44,
"gaze": -65,
"ankles": [
630,
417
],
"wrists": [
727,
421
],
"palm": 1
},
"stepBack": {
"about": "Low (runner's) lunge: front knee stacked over the front ankle, back foot already in plank.",
"hip": [
537.5,
304
],
"spine": 15,
"gaze": -65,
"ankles": [
630,
417
],
"farAnkle": [
441,
391
],
"wrists": [
727,
421
],
"palm": 1
},
"stepForward": {
"about": "Low lunge out of down dog: front knee over the front ankle, back foot still where down dog left it.",
"hip": [
537.5,
304
],
"spine": 15,
"gaze": -65,
"ankles": [
630,
417
],
"farAnkle": [
420,
404
],
"wrists": [
727,
421
],
"palm": 1
},
"returnCrouch": {
"hip": [
629,
285
],
"spine": 36,
"gaze": -65,
"ankles": [
630,
417
],
"wrists": [
727,
421
],
"palm": 1
}
},
"stepping": {
"about": "Transitions that step one foot at a time, as stops through which the move passes; step indices count from 0.",
"3": [
"lift",
"plant",
"stepBack",
"plank"
],
"7": [
"downDog",
"stepForward",
"returnCrouch",
"lift"
],
"lift": 34
},
"swanDive": {
"about": "Upward salute to forward fold (step 1) and back up (step 9): straight arms stay in line with the spine, then sweep down to the floor.",
"steps": [
1,
9
],
"lowerFrom": 0.45,
"straightReach": 127,
"palmFrom": 0.8
},
"feet": {
"pointToes": 0.5,
"restingRadius": 12
},
"head": {
"lift": 0.6,
"liftMin": -42,
"liftMax": 10
},
"hair": {
"about": "Roots are fractions of the head's reference box, under the lower edge of the back hair.",
"roots": [
[
0.25,
0.75
],
[
0.23,
0.89
]
],
"width": 1.0,
"segment": 13,
"count": 11,
"damping": 0.86,
"gravity": 5000,
"substeps": 8
},
"parts": {
"leg": {
"about": "Above the hip the painting (the seat) follows the pelvis and bends into the thigh over rootBand units; the hip turns within half a circle of rootTurn degrees, so it folds forward.",
"file": "leg.png",
"root": [
0.52,
0.07
],
"tip": [
0.55,
0.93
],
"width": 0.86,
"fade": 0.955,
"top": [
0.03,
0.012
],
"band": 14,
"rootBand": 10,
"rootTurn": -90,
"seat": {
"depth": 0.2,
"center": 8,
"span": 32
}
},
"arm": {
"file": "arm.png",
"root": [
0.5,
0.08
],
"tip": [
0.62,
0.955
],
"width": 0.78,
"fade": 0.975,
"band": 10
},
"torso": {
"about": "hem: its back and front corners; above the line through them the leggings are hidden behind her back, out to cover units. flare: the top widens from from[0] to from[1] units up the spine, more at the back as sin(spine) goes through hangFrom (upside down).",
"file": "torso.png",
"hip": [
0.44,
0.97
],
"shoulder": [
0.23,
0.23
],
"width": 0.8,
"neck": [
0.62,
0.05
],
"hem": [
[
0.335,
0.935
],
[
0.905,
0.958
]
],
"cover": 150,
"mesh": [
8,
32
],
"flare": {
"from": [
45,
5
],
"back": 0.12,
"front": 0.04,
"hang": 0.18,
"hangFrom": [
0.1,
0.9
]
}
},
"head": {
"file": "head.png",
"pivot": [
0.66,
0.985
],
"height": 71.43
},
"longHair": {
"file": "long-hair.png"
},
"handUpright": {
"file": "hand-upright.png",
"pivot": [
0.52,
0.985
],
"height": 38
},
"handFlat": {
"file": "hand-flat.png",
"pivot": [
0.05,
0.32
],
"width": 46
},
"footFlat": {
"file": "foot-flat.png",
"pivot": [
0.21,
0.35
],
"toe": [
0.99,
0.8
],
"heel": [
0.03,
0.84
],
"width": 50,
"cut": [
"top",
0.27
]
},
"footTucked": {
"file": "foot-tucked.png",
"pivot": [
0.37,
0.12
],
"height": 50,
"cut": [
"top",
0.07
]
},
"footInstep": {
"file": "foot-instep.png",
"pivot": [
0.9,
0.45
],
"toe": [
0.012,
0.95
],
"heel": [
0.72,
0.04
],
"width": 54,
"turn": -11.46,
"cut": [
"right",
0.93
]
}
},
"sprites": {
"about": "The app's frames (--sprites): each step's transition at fps, then settle seconds of its hold, rendered on theme at scale of the design size, trimmed, and quantized to colors.",
"theme": "clear",
"scale": 0.55,
"fps": 30,
"settle": 0.5,
"colors": 256,
"directory": "assets/practices/sunsalutation/girl",
"table": "src/practices/sun_salutation/sun_salutation_frames.zi"
},
"themes": {
"light": {
"background": [
244,
239,
222
],
"shadow": [
76,
82,
55,
0.2
],
"far": [
50,
65,
49,
0.13
]
},
"dark": {
"background": [
22,
24,
40
],
"shadow": [
0,
0,
0,
0.4
],
"far": [
0,
0,
20,
0.35
]
},
"clear": {
"shadow": [
20,
16,
40,
0.28
],
"far": [
30,
20,
50,
0.2
]
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ android {
minSdk 21
targetSdk 36
testInstrumentationRunner "android.test.InstrumentationTestRunner"
versionCode 160
versionName "2.1.23"
versionCode 163
versionName "2.1.26"
manifestPlaceholders = [
inbeAppLabel: "Inner Breeze",
inbeUsesCleartextTraffic: "false"
+2 -1
View File
@@ -26,9 +26,10 @@
android:usesCleartextTraffic="${inbeUsesCleartextTraffic}">
<activity
android:name="xyz.waozi.inbe.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|uiMode"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:supportsPictureInPicture="true"
android:theme="@style/InbeTheme"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing"
android:windowLayoutInDisplayCutoutMode="never">
@@ -5,6 +5,8 @@ import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.NativeActivity;
import android.app.AppOpsManager;
import android.app.PictureInPictureParams;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.pm.ActivityInfo;
@@ -27,6 +29,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;
import android.util.Rational;
import android.webkit.MimeTypeMap;
import android.view.DisplayCutout;
import android.view.KeyEvent;
@@ -56,6 +59,107 @@ public class MainActivity extends NativeActivity {
private long startupStarted;
private TextInputView textInputView;
private boolean textInputVisible;
private volatile int pictureWindowState;
private volatile boolean pictureWindowEnabled;
private boolean pictureWindowEntering;
private boolean activityStopped;
private int pictureWindowGeneration;
// Called by the native frame thread. A volatile snapshot avoids changing
// practice state from Android's UI callbacks.
public int pictureWindowState() {
return pictureWindowState;
}
private boolean supportsPictureWindow() {
return Build.VERSION.SDK_INT >= 26 && getPackageManager().hasSystemFeature(
PackageManager.FEATURE_PICTURE_IN_PICTURE);
}
private boolean allowsPictureWindow() {
if (!supportsPictureWindow()) {
return false;
}
AppOpsManager operations = (AppOpsManager)getSystemService(APP_OPS_SERVICE);
return operations != null && operations.checkOpNoThrow(
AppOpsManager.OPSTR_PICTURE_IN_PICTURE, android.os.Process.myUid(),
getPackageName()) == AppOpsManager.MODE_ALLOWED;
}
private void refreshPictureWindowState() {
pictureWindowGeneration = (pictureWindowGeneration + 1) & 0x1fffffff;
pictureWindowState = (pictureWindowGeneration << 2) | (supportsPictureWindow() ? 1 : 0)
| (Build.VERSION.SDK_INT >= 26 && isInPictureInPictureMode()
&& !activityStopped ? 2 : 0);
}
private PictureInPictureParams pictureWindowParams() {
PictureInPictureParams.Builder params = new PictureInPictureParams.Builder()
.setAspectRatio(new Rational(4, 5));
if (Build.VERSION.SDK_INT >= 31) {
params.setAutoEnterEnabled(pictureWindowEnabled && allowsPictureWindow());
}
return params.build();
}
public void updatePictureWindow(boolean enabled, boolean requested) {
if (enabled == pictureWindowEnabled && !requested) {
return;
}
pictureWindowEnabled = enabled;
runOnUiThread(() -> {
if (!supportsPictureWindow() || isFinishing() || isDestroyed()) {
return;
}
setPictureInPictureParams(pictureWindowParams());
if (requested && enabled) {
enterPictureWindow(true);
}
});
}
private void enterPictureWindow(boolean explicit) {
if (!supportsPictureWindow() || !pictureWindowEnabled ||
isInPictureInPictureMode() || isFinishing()) {
return;
}
if (!allowsPictureWindow()) {
if (explicit) {
Intent settings = new Intent("android.settings.PICTURE_IN_PICTURE_SETTINGS",
Uri.parse("package:" + getPackageName()));
if (settings.resolveActivity(getPackageManager()) != null) {
startActivity(settings);
}
}
return;
}
pictureWindowEntering = true;
try {
if (!enterPictureInPictureMode(pictureWindowParams())) {
pictureWindowEntering = false;
}
} catch (IllegalStateException | IllegalArgumentException error) {
pictureWindowEntering = false;
Log.w(TAG, "Picture-in-picture is unavailable", error);
}
}
@Override
protected void onUserLeaveHint() {
super.onUserLeaveHint();
if (Build.VERSION.SDK_INT >= 26 && Build.VERSION.SDK_INT < 31) {
enterPictureWindow(false);
}
}
@Override
public void onPictureInPictureModeChanged(boolean visible, Configuration configuration) {
super.onPictureInPictureModeChanged(visible, configuration);
pictureWindowEntering = false;
refreshPictureWindowState();
requestInsetRefresh();
syncLifecycleState("onPictureInPictureModeChanged");
}
private void showStartup() {
startupView = new FrameLayout(this);
@@ -1106,14 +1210,16 @@ public class MainActivity extends NativeActivity {
private void syncLifecycleState(String reason) {
boolean indicatorVisible = SessionForegroundService.hasVisibleIndicator(this);
backgroundExecutionActive = nativeSyncLifecycleState(activityPaused, indicatorVisible) != 0;
boolean pictureVisible = pictureWindowEntering || (pictureWindowState & 2) != 0;
backgroundExecutionActive = nativeSyncLifecycleState(
activityPaused && !pictureVisible, indicatorVisible) != 0;
Log.d(TAG, reason + ": activityPaused=" + activityPaused
+ " indicatorVisible=" + indicatorVisible
+ " windowFocused=" + windowFocused
+ " backgroundActive=" + backgroundExecutionActive);
if (activityPaused && !backgroundExecutionActive) {
if (activityPaused && !pictureVisible && !backgroundExecutionActive) {
stopService(new Intent(this, SessionForegroundService.class));
}
}
@@ -1126,11 +1232,33 @@ public class MainActivity extends NativeActivity {
syncLifecycleState("onPause");
}
@Override
protected void onStart() {
super.onStart();
activityStopped = false;
refreshPictureWindowState();
syncLifecycleState("onStart");
}
@Override
protected void onStop() {
super.onStop();
activityStopped = true;
pictureWindowEntering = false;
refreshPictureWindowState();
syncLifecycleState("onStop");
}
@Override
protected void onResume() {
super.onResume();
NotificationPresence.setActivityVisible(true);
activityPaused = false;
pictureWindowEntering = false;
refreshPictureWindowState();
if (supportsPictureWindow()) {
setPictureInPictureParams(pictureWindowParams());
}
configureSystemBars();
nativeInvalidateGraphicsResources();
requestInsetRefresh();
@@ -0,0 +1,6 @@
Fixed
---
- Open the breathing animation, background music and other menus reliably again.
- Use the In / Out breathing animation you choose in Wim Hof sessions.
- Offer Test for your own imported music instead of "Audio not installed".
- Keep the breathing circle smooth on phones signed in to an account.
@@ -0,0 +1,10 @@
Changed
---
- Minimized practices show their live circle or figure in a resizable window and return to the page you started them from.
Fixed
---
- Stop syncing from pausing the breathing circle while you practice.
- Keep breath sounds playing while a practice is minimized.
- Animate the Wim Hof breathing circle smoothly, including its Customize preview.
- Keep Wim Hof timing accurate when the frame rate varies.
- Skip repeated account checks on unchanged animation frames.
@@ -0,0 +1,13 @@
Added
---
- Detach a running practice into its own resizable desktop window.
- Keep the practice visible over other Android apps with picture-in-picture, which you can turn off in Settings.
Changed
---
- The minimized practice window is taller and shows the breath count, time left or phase.
- Diary saves quietly, without a "Waiting to save" note.
Fixed
---
- Show the keyboard in Diary on Android.
- Keep the practice window over Apps.
- Open Lumi without freezing the practice window.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 155 KiB

@@ -1,6 +1,6 @@
{
"capture_sha256": "a4278c4b52f6a1dd0f6bf199dc83a493100a86fc32733973106fec31d2160849",
"source_sha256": "627d81fe891bcfd612f63e89ca92095f1ba73b2aafa17e6e381d93efedd91189",
"capture_sha256": "f3bf3808405370b43ebfd7f5107464890e6bf71b618d4dbb8735057bff7a8289",
"source_sha256": "b1f18cc8a6aced931a5c7ce99f5d5bfa39a53a6fe994de8d213684cce31337bb",
"files": [
{
"file": "phoneScreenshots/01-apps.png",
@@ -22,13 +22,13 @@
},
{
"file": "phoneScreenshots/04-sun-salutation.png",
"sha256": "ed70eb5adbe78096c9de64e7074bafb7eaa86060c9f4cf5add64ab73f048c266",
"sha256": "9871a22d3ab8b87178fa9bb6c2490f9ec21f872d0b2050fb96599879df3b27db",
"width": 1080,
"height": 1920
},
{
"file": "phoneScreenshots/05-habits.png",
"sha256": "7d4c57e9b44d76098463c077e576eef37cb53ec35f8a146f3dc981300dc13e40",
"sha256": "694e71e47be1a0019241a5af7badaedaf4afc37bb067ce38590a37e589dc93d7",
"width": 1080,
"height": 1920
},
@@ -40,13 +40,13 @@
},
{
"file": "phoneScreenshots/07-diary.png",
"sha256": "111bd29c939d3769935e0deef6abf08640034d306aac534f05c1ab86a9692de4",
"sha256": "66ee21c25c5b2539231159cc30e94a840154c03701edfb40966ea5d9dd8e8a97",
"width": 1080,
"height": 1920
},
{
"file": "phoneScreenshots/08-appearance.png",
"sha256": "dd5971e69d39014df3cfa82f4d9791bc6305ca84d3da2e067b4ba2736ea7290c",
"sha256": "506a6b657df0a8609dc961d93f6e96eef47711d150f76037ed03070bea027577",
"width": 1080,
"height": 1920
},
@@ -70,13 +70,13 @@
},
{
"file": "sevenInchScreenshots/04-sun-salutation.png",
"sha256": "af74b4fe19d638447a2d3e4412af41cede6ad8d0f4f619239a5084ea4450ae68",
"sha256": "93c138d184dce4e132fbbf5effee3dc541ad6479fe6bb9fa69639217f627c041",
"width": 1920,
"height": 1080
},
{
"file": "sevenInchScreenshots/05-habits.png",
"sha256": "884cae695a4b39ce3b6279ab61d28adcacc50c0b2a6778b7cf2444d59fbffde0",
"sha256": "a5f57dc86d09abbddf67a554be1ef181f58ed6f6d120db572b00e1533ed4dc1b",
"width": 1920,
"height": 1080
},
@@ -88,13 +88,13 @@
},
{
"file": "sevenInchScreenshots/07-diary.png",
"sha256": "88aff68b18ba1af54b4b7128e283b2fa327b7f1619307b86a0783c8f79fa582b",
"sha256": "6b0ffc1264b9995c8b432e122cc150b6c683fc13db6138757936aa9f63d8ce6f",
"width": 1920,
"height": 1080
},
{
"file": "sevenInchScreenshots/08-appearance.png",
"sha256": "5df14c3f024bce5a39f52c4452765d3e3d5f6ec4e085f7dca75dc496f9da7440",
"sha256": "c412ef444a0ec165c12d78011491930b3b2cdd91c4909fae831af30638c29a2c",
"width": 1920,
"height": 1080
},
@@ -118,13 +118,13 @@
},
{
"file": "tenInchScreenshots/04-sun-salutation.png",
"sha256": "3768b26622dda6db827723f32459b503b0b84f10cc1af705e3310cce805633ea",
"sha256": "a5a189f55ab7286ab5cce88895b533c0e68f19cd17a3fd21218d4a045f6388fc",
"width": 2560,
"height": 1440
},
{
"file": "tenInchScreenshots/05-habits.png",
"sha256": "3c91d86bbfd4229883adc552bf43466244f83326e8cc7e11edd7e2a2df0d9c1d",
"sha256": "706c6e5696db2c1439cc4905cb4275de121ddb64f1feb5555dbb7cbeab08db5e",
"width": 2560,
"height": 1440
},
@@ -136,13 +136,13 @@
},
{
"file": "tenInchScreenshots/07-diary.png",
"sha256": "844bdd536ae229ff830ac389790796a7e872b472028dd362ffea4114e27a12f8",
"sha256": "2faf9c9246cb2cc5c279adfa776b52fd726c25087eb462ceda975c4ea12455d7",
"width": 2560,
"height": 1440
},
{
"file": "tenInchScreenshots/08-appearance.png",
"sha256": "3f1f5fcdac2a211f94bb6b04fd646931d7705e6c3b36df521eec7babcd47fdc8",
"sha256": "35e0a0d3912dfd2c7d14a0ed5177aa5e18d819ca5cab987d287fdab2c7a541d8",
"width": 2560,
"height": 1440
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 223 KiB

+20 -3
View File
@@ -406,6 +406,9 @@ Nádech / výdech
[progressive_start_speed_editor_title]
Pocatecni rychlost
---
[picture_in_picture_label]
Obraz v obraze
---
[play_in_background_label]
Přehrávat na pozadí
---
@@ -2161,9 +2164,6 @@ Dnes
[diary_read_error]
Záznam nelze přečíst. Soubor byl zachován.
---
[diary_save_pending]
Čeká na uložení…
---
[diary_insert_time]
Vložit čas
---
@@ -2183,6 +2183,9 @@ Odebrat fotku
Fotku se nepodařilo přiložit. Vyberte obrázek do 16 MiB.
---
---
[lumi_loading]
Načítání chatu…
---
[lumi_greeting]
Ahoj, jsem Lumi! Jak ti dnes mohu pomoci?
---
@@ -2629,6 +2632,12 @@ Pomoz mi přizpůsobit KSS pro
[session_minimize_button]
Minimalizovat
---
[session_maximize_button]
Maximalizovat
---
[session_resize_button]
Změnit velikost
---
[activity_remote_running]
Probíhá na jiném zařízení
@@ -2645,3 +2654,11 @@ Poslední známé cvičení · čekání na aktualizace
[activity_control_pending]
Čekání na zařízení, kde cvičení probíhá
---
[session_detach_button]
Oddělit okno cvičení
---
[session_attach_button]
Vrátit okno do aplikace
---
+20 -3
View File
@@ -406,6 +406,9 @@ Ein / Aus
[progressive_start_speed_editor_title]
Startgeschwindigkeit
---
[picture_in_picture_label]
Bild-im-Bild
---
[play_in_background_label]
Im Hintergrund abspielen
---
@@ -2161,9 +2164,6 @@ Heute
[diary_read_error]
Dieser Eintrag konnte nicht gelesen werden. Deine Datei bleibt erhalten.
---
[diary_save_pending]
Warten auf Speichern…
---
[diary_insert_time]
Uhrzeit einfügen
---
@@ -2183,6 +2183,9 @@ Foto entfernen
Das Foto konnte nicht angehängt werden. Wähle ein Bild bis 16 MiB.
---
---
[lumi_loading]
Chat wird geladen…
---
[lumi_greeting]
Hallo, ich bin Lumi! Wie kann ich dir heute helfen?
---
@@ -2629,6 +2632,12 @@ Hilf mir, KSS anzupassen für
[session_minimize_button]
Minimieren
---
[session_maximize_button]
Maximieren
---
[session_resize_button]
Größe ändern
---
[activity_remote_running]
Läuft auf einem anderen Gerät
@@ -2645,3 +2654,11 @@ Letzte bekannte Sitzung · warte auf Aktualisierung
[activity_control_pending]
Warte auf das Gerät mit der laufenden Sitzung
---
[session_detach_button]
Übungsfenster ablösen
---
[session_attach_button]
Fenster in die App zurückholen
---
+20 -3
View File
@@ -490,6 +490,9 @@ In / Out
[progressive_start_speed_editor_title]
Start speed
---
[picture_in_picture_label]
Picture-in-picture
---
[play_in_background_label]
Play in background
---
@@ -2160,9 +2163,6 @@ Today
[diary_read_error]
Could not read this entry. Your file has been kept.
---
[diary_save_pending]
Waiting to save…
---
[diary_insert_time]
Insert time
---
@@ -2182,6 +2182,9 @@ Remove photo
Could not attach photo. Choose an image up to 16 MiB.
---
---
[lumi_loading]
Loading your chat…
---
[lumi_greeting]
Hi, I’m Lumi! How can I help you today?
---
@@ -2628,6 +2631,12 @@ Help me customize KSS for
[session_minimize_button]
Minimize
---
[session_maximize_button]
Maximize
---
[session_resize_button]
Resize
---
[activity_remote_running]
Running on another device
@@ -2644,3 +2653,11 @@ Last known session · awaiting updates
[activity_control_pending]
Waiting for the running device
---
[session_detach_button]
Detach practice window
---
[session_attach_button]
Return window to app
---
+20 -3
View File
@@ -415,6 +415,9 @@ Entrada / salida
[progressive_start_speed_editor_title]
Velocidad inicial
---
[picture_in_picture_label]
Imagen en imagen
---
[play_in_background_label]
Reproducir en segundo plano
---
@@ -2161,9 +2164,6 @@ Hoy
[diary_read_error]
No se pudo leer esta entrada. Se ha conservado el archivo.
---
[diary_save_pending]
Esperando para guardar…
---
[diary_insert_time]
Insertar hora
---
@@ -2183,6 +2183,9 @@ Quitar foto
No se pudo adjuntar la foto. Elige una imagen de hasta 16 MiB.
---
---
[lumi_loading]
Cargando tu chat…
---
[lumi_greeting]
¡Hola, soy Lumi! ¿Cómo puedo ayudarte hoy?
---
@@ -2629,6 +2632,12 @@ Ayúdame a personalizar KSS para
[session_minimize_button]
Minimizar
---
[session_maximize_button]
Maximizar
---
[session_resize_button]
Cambiar tamaño
---
[activity_remote_running]
En curso en otro dispositivo
@@ -2645,3 +2654,11 @@ En pausa en otro dispositivo
[activity_control_pending]
Esperando al dispositivo con la sesión en curso
---
[session_detach_button]
Separar la ventana de práctica
---
[session_attach_button]
Devolver la ventana a la aplicación
---
+20 -3
View File
@@ -406,6 +406,9 @@ Inspiration / expiration
[progressive_start_speed_editor_title]
Vitesse de depart
---
[picture_in_picture_label]
Image dans l'image
---
[play_in_background_label]
Lecture en arrière-plan
---
@@ -2161,9 +2164,6 @@ Aujourd’hui
[diary_read_error]
Impossible de lire cette entrée. Votre fichier a été conservé.
---
[diary_save_pending]
En attente d’enregistrement…
---
[diary_insert_time]
Insérer l’heure
---
@@ -2183,6 +2183,9 @@ Retirer la photo
Impossible de joindre la photo. Choisissez une image de 16 Mio maximum.
---
---
[lumi_loading]
Chargement de ta conversation…
---
[lumi_greeting]
Bonjour, je suis Lumi ! Comment puis-je t’aider aujourd’hui ?
---
@@ -2629,6 +2632,12 @@ Aide-moi à personnaliser le KSS pour
[session_minimize_button]
Réduire
---
[session_maximize_button]
Agrandir
---
[session_resize_button]
Redimensionner
---
[activity_remote_running]
En cours sur un autre appareil
@@ -2645,3 +2654,11 @@ Dernière séance connue · en attente de mises à jour
[activity_control_pending]
En attente de l’appareil où la séance est en cours
---
[session_detach_button]
Détacher la fenêtre de pratique
---
[session_attach_button]
Ramener la fenêtre dans l’application
---
+20 -3
View File
@@ -415,6 +415,9 @@ Masuk / keluar
[progressive_start_speed_editor_title]
Kecepatan awal
---
[picture_in_picture_label]
Gambar dalam gambar
---
[play_in_background_label]
Putar di latar belakang
---
@@ -2161,9 +2164,6 @@ Hari ini
[diary_read_error]
Entri ini tidak dapat dibaca. Berkas Anda tetap disimpan.
---
[diary_save_pending]
Menunggu untuk menyimpan…
---
[diary_insert_time]
Sisipkan waktu
---
@@ -2183,6 +2183,9 @@ Hapus foto
Foto tidak dapat dilampirkan. Pilih gambar hingga 16 MiB.
---
---
[lumi_loading]
Memuat obrolanmu…
---
[lumi_greeting]
Halo, aku Lumi! Apa yang bisa kubantu hari ini?
---
@@ -2629,6 +2632,12 @@ Bantu saya menyesuaikan KSS untuk
[session_minimize_button]
Perkecil
---
[session_maximize_button]
Perbesar
---
[session_resize_button]
Ubah ukuran
---
[activity_remote_running]
Berjalan di perangkat lain
@@ -2645,3 +2654,11 @@ Sesi terakhir yang diketahui · menunggu pembaruan
[activity_control_pending]
Menunggu perangkat yang menjalankan sesi
---
[session_detach_button]
Pisahkan jendela latihan
---
[session_attach_button]
Kembalikan jendela ke aplikasi
---
+20 -3
View File
@@ -439,6 +439,9 @@ Dentro / fuori
[progressive_start_speed_editor_title]
Velocità iniziale
---
[picture_in_picture_label]
Picture in picture
---
[play_in_background_label]
Riproduci in background
---
@@ -2161,9 +2164,6 @@ Oggi
[diary_read_error]
Impossibile leggere questa voce. Il file è stato conservato.
---
[diary_save_pending]
In attesa di salvataggio…
---
[diary_insert_time]
Inserisci l’ora
---
@@ -2183,6 +2183,9 @@ Rimuovi foto
Impossibile allegare la foto. Scegli un’immagine fino a 16 MiB.
---
---
[lumi_loading]
Caricamento della chat…
---
[lumi_greeting]
Ciao, sono Lumi! Come posso aiutarti oggi?
---
@@ -2629,6 +2632,12 @@ Aiutami a personalizzare il KSS per
[session_minimize_button]
Riduci a icona
---
[session_maximize_button]
Ingrandisci
---
[session_resize_button]
Ridimensiona
---
[activity_remote_running]
In corso su un altro dispositivo
@@ -2645,3 +2654,11 @@ Ultima sessione nota · in attesa di aggiornamenti
[activity_control_pending]
In attesa del dispositivo con la sessione in corso
---
[session_detach_button]
Stacca la finestra della pratica
---
[session_attach_button]
Riporta la finestra nell’app
---
+20 -3
View File
@@ -406,6 +406,9 @@ OK
[progressive_start_speed_editor_title]
開始速度
---
[picture_in_picture_label]
ピクチャー・イン・ピクチャー
---
[play_in_background_label]
バックグラウンド再生
---
@@ -2163,9 +2166,6 @@ Inner Breezeは無料のオープンソースです。役に立ったら、少
[diary_read_error]
この日記を読み込めませんでした。ファイルは保持されています。
---
[diary_save_pending]
保存を待っています…
---
[diary_insert_time]
時刻を挿入
---
@@ -2185,6 +2185,9 @@ Inner Breezeは無料のオープンソースです。役に立ったら、少
写真を添付できませんでした。16 MiB以下の画像を選んでください。
---
---
[lumi_loading]
チャットを読み込んでいます…
---
[lumi_greeting]
こんにちは、Lumiです!今日はどんなお手伝いをしましょうか?
---
@@ -2631,6 +2634,12 @@ Lumiに相談
[session_minimize_button]
最小化
---
[session_maximize_button]
最大化
---
[session_resize_button]
サイズ変更
---
[activity_remote_running]
別のデバイスで実行中
@@ -2647,3 +2656,11 @@ Lumiに相談
[activity_control_pending]
実行中のデバイスからの応答を待っています
---
[session_detach_button]
練習ウィンドウを切り離す
---
[session_attach_button]
ウィンドウをアプリに戻す
---
+20 -3
View File
@@ -439,6 +439,9 @@ Trocador
[progressive_start_speed_editor_title]
시작 속도
---
[picture_in_picture_label]
PIP 모드
---
[play_in_background_label]
백그라운드 재생
---
@@ -2161,9 +2164,6 @@ Inner Breeze는 무료 오픈 소스입니다. 도움이 되셨다면 작은 후
[diary_read_error]
이 일기를 읽을 수 없습니다. 파일은 보존되었습니다.
---
[diary_save_pending]
저장 대기 중…
---
[diary_insert_time]
시간 삽입
---
@@ -2183,6 +2183,9 @@ Inner Breeze는 무료 오픈 소스입니다. 도움이 되셨다면 작은 후
사진을 첨부할 수 없습니다. 16 MiB 이하의 이미지를 선택하세요.
---
---
[lumi_loading]
채팅을 불러오는 중…
---
[lumi_greeting]
안녕하세요, Lumi예요! 오늘 무엇을 도와드릴까요?
---
@@ -2629,6 +2632,12 @@ Lumi에게 요청
[session_minimize_button]
최소화
---
[session_maximize_button]
최대화
---
[session_resize_button]
크기 조절
---
[activity_remote_running]
다른 기기에서 진행 중
@@ -2645,3 +2654,11 @@ Lumi에게 요청
[activity_control_pending]
세션이 실행 중인 기기의 응답을 기다리는 중
---
[session_detach_button]
연습 창 분리하기
---
[session_attach_button]
창을 앱으로 되돌리기
---
+20 -3
View File
@@ -415,6 +415,9 @@ Entrada / saída
[progressive_start_speed_editor_title]
Velocidade inicial
---
[picture_in_picture_label]
Imagem em imagem
---
[play_in_background_label]
Executar em segundo plano
---
@@ -2161,9 +2164,6 @@ Hoje
[diary_read_error]
Não foi possível ler esta entrada. O arquivo foi preservado.
---
[diary_save_pending]
Aguardando para salvar…
---
[diary_insert_time]
Inserir horário
---
@@ -2183,6 +2183,9 @@ Remover foto
Não foi possível anexar a foto. Escolha uma imagem de até 16 MiB.
---
---
[lumi_loading]
Carregando sua conversa…
---
[lumi_greeting]
Oi, sou a Lumi! Como posso ajudar você hoje?
---
@@ -2629,6 +2632,12 @@ Ajude-me a personalizar KSS para
[session_minimize_button]
Minimizar
---
[session_maximize_button]
Maximizar
---
[session_resize_button]
Redimensionar
---
[activity_remote_running]
Em andamento em outro dispositivo
@@ -2645,3 +2654,11 @@ Pausado em outro dispositivo
[activity_control_pending]
Aguardando o dispositivo com a sessão em andamento
---
[session_detach_button]
Separar a janela da prática
---
[session_attach_button]
Devolver a janela ao aplicativo
---
+20 -3
View File
@@ -442,6 +442,9 @@ Trocador
[progressive_start_speed_editor_title]
Начальная скорость
---
[picture_in_picture_label]
Картинка в картинке
---
[play_in_background_label]
Воспроизводить в фоне
---
@@ -2161,9 +2164,6 @@ Inner Breeze бесплатное приложение с открытым ис
[diary_read_error]
Не удалось прочитать запись. Ваш файл сохранён.
---
[diary_save_pending]
Ожидание сохранения…
---
[diary_insert_time]
Вставить время
---
@@ -2183,6 +2183,9 @@ Inner Breeze бесплатное приложение с открытым ис
Не удалось прикрепить фото. Выберите изображение размером до 16 МиБ.
---
---
[lumi_loading]
Загрузка чата…
---
[lumi_greeting]
Привет, я Lumi! Чем я могу помочь тебе сегодня?
---
@@ -2629,6 +2632,12 @@ Inner Breeze бесплатное приложение с открытым ис
[session_minimize_button]
Свернуть
---
[session_maximize_button]
Развернуть
---
[session_resize_button]
Изменить размер
---
[activity_remote_running]
Выполняется на другом устройстве
@@ -2645,3 +2654,11 @@ Inner Breeze бесплатное приложение с открытым ис
[activity_control_pending]
Ожидание устройства с текущим сеансом
---
[session_detach_button]
Отделить окно практики
---
[session_attach_button]
Вернуть окно в приложение
---
+20 -3
View File
@@ -406,6 +406,9 @@ Wim Hof 呼吸
[progressive_start_speed_editor_title]
起始速度
---
[picture_in_picture_label]
画中画
---
[play_in_background_label]
后台播放
---
@@ -2161,9 +2164,6 @@ Inner Breeze 免费且开源。如果它对您有帮助,一点小额捐赠将
[diary_read_error]
无法读取这篇日记。文件已保留。
---
[diary_save_pending]
正在等待保存…
---
[diary_insert_time]
插入时间
---
@@ -2183,6 +2183,9 @@ Inner Breeze 免费且开源。如果它对您有帮助,一点小额捐赠将
无法添加照片。请选择不超过16 MiB的图片。
---
---
[lumi_loading]
正在加载聊天…
---
[lumi_greeting]
你好,我是 Lumi!今天有什么可以帮你的吗?
---
@@ -2629,6 +2632,12 @@ Daochi 节点
[session_minimize_button]
最小化
---
[session_maximize_button]
最大化
---
[session_resize_button]
调整大小
---
[activity_remote_running]
正在其他设备上进行
@@ -2645,3 +2654,11 @@ Daochi 节点
[activity_control_pending]
正在等待运行练习的设备
---
[session_detach_button]
弹出练习窗口
---
[session_attach_button]
将窗口移回应用
---
+1 -1
View File
@@ -1,5 +1,5 @@
Package: inbe.waozi
Version: 2.1.23
Version: 2.1.26
Architecture: arm64
Maintainer: Waozi <[email protected]>
Click-Version: 0.4
+1 -1
View File
@@ -28,7 +28,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.1.23" date="2026-10-09"/>
<release version="2.1.26" date="2026-10-09"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "inbe",
"title": "Inner Breeze",
"version": "2.1.23",
"version": "2.1.26",
"architecture": "arm64",
"framework": "ubuntu-sdk-20.04",
"description": "Syncable breathing, meditation, and habit practice app.",
+1 -1
View File
@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Inner Breeze",
"short_name": "Inbe",
"version": "2.1.23",
"version": "2.1.26",
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
"permissions": [
"contextMenus"
+1 -1
View File
@@ -22,7 +22,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.1.23" date="2026-10-09"/>
<release version="2.1.26" date="2026-10-09"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -22,7 +22,7 @@
<binary>inbe</binary>
</provides>
<releases>
<release version="2.1.23" date="2026-10-09"/>
<release version="2.1.26" date="2026-10-09"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
+1 -1
View File
@@ -6,7 +6,7 @@ description: |
meditation, and habit tracking with visual and audio cues, meditation
timers, habit counters, session history, and optional sync.
version: '2.1.23'
version: '2.1.26'
license: BSD-3-Clause
base: core22
confinement: strict
+47 -10
View File
@@ -10,6 +10,7 @@
#import, file "../core/breath_timing.zi";
#import, file "../storage/cell_records.zi";
#import, file "../storage/storage_core.zi";
#import, file "../storage/db.zi";
#import, file "../storage/sync_crypto_random.zi";
#import, file "../storage/sync_crypto.zi";
#import, file "../storage/delegate_store.zi";
@@ -32,6 +33,8 @@ ActivityState :: struct {
local: AccountActivity
remote: AccountActivity
last_poll: float64
last_read: float64
read_revision: s64
last_publish: s64
was_running: bool
last_paused: s32
@@ -42,6 +45,12 @@ ActivityState :: struct {
}
account_activity: ActivityState;
activity_availability_revision: s64 = -1;
activity_availability_delegate_generation: s64 = -1;
activity_availability_checked: float64 = -1.0;
activity_availability: bool;
activity_availability_delegated: bool;
ActivityCurrentTime :: () -> s64 {
return ActivityNow(null)
}
@@ -58,9 +67,27 @@ ActivityRandomID :: (output: []u8, byte_count: s32) -> bool {
}
ActivityAvailable :: () -> bool {
return PreviewMode() == 0 && !DataTemporary() && storage_sync_enabled() != 0 &&
if PreviewMode() != 0 || DataTemporary() {
return false
}
revision := storage_data_revision()
generation := StoredDelegateGeneration()
clock := ActivityFrameTime()
if revision == activity_availability_revision && generation == activity_availability_delegate_generation &&
clock >= activity_availability_checked && clock - activity_availability_checked < 0.25 {
// Delegate expiry and identity checks remain live even when the
// owner's unchanged settings can be reused between frames.
return activity_availability &&
(!activity_availability_delegated || StoredDelegateAvailable() != 0)
}
activity_availability_revision = revision
activity_availability_delegate_generation = generation
activity_availability_checked = clock
activity_availability_delegated = StoredAccountMode() == AccountModeDelegate
activity_availability = storage_sync_enabled() != 0 &&
storage_has_sync_account() != 0 &&
(StoredAccountMode() != AccountModeDelegate || StoredDelegateAvailable() != 0)
(!activity_availability_delegated || StoredDelegateAvailable() != 0)
return activity_availability
}
ActivityInitialize :: () -> bool {
@@ -170,19 +197,29 @@ ActivityApplyControl :: (app: *InnerBreeze, now: s64) -> bool {
ActivityPump :: (app: *InnerBreeze) {
activity_start_check = ActivityCanStart
if app == null || !ActivityInitialize() {
if app == null {
return
}
clock := ActivityFrameTime()
if clock >= account_activity.last_poll && clock - account_activity.last_poll < 0.25 {
return
}
if !ActivityInitialize() {
return
}
state := *account_activity
clock := ActivityFrameTime()
if clock >= state.last_poll && clock - state.last_poll < 0.25 {
return
}
state.last_poll = clock
now := ActivityNow(null)
document := CellRecordRead(ActivityRecordKey)
unused ActivityRead(document, *state.remote)
PackageFree(document)
// Read the shared record only after stored data changed, such as a sync
// applying another device's update, with a slow fallback.
revision := storage_data_revision()
if revision != state.read_revision || clock < state.last_read || clock - state.last_read >= 2.0 {
state.read_revision = revision
state.last_read = clock
document := CellRecordRead(ActivityRecordKey)
unused ActivityRead(document, *state.remote)
PackageFree(document)
}
if ActivityRemoteVisible() &&
TextUntilNul(state.observed_session[:]) != TextUntilNul(state.remote.session_id[:]) {
state.observed_session = state.remote.session_id
+4 -1
View File
@@ -9,7 +9,10 @@
ActivityRecordKey :: "cell.lumi.activity.current"
ActivityControlKey :: "cell.lumi.activity.control"
ActivityFreshSeconds :: 20
ActivityPublishSeconds :: 2
// A running practice republishes at this interval; phase, round and pause
// changes publish at once. On Android and the web each publish starts a sync
// on the frame thread, so a short interval makes the practice stutter.
ActivityPublishSeconds :: 10
AccountActivity :: struct {
session_id: [33]u8
+33 -3
View File
@@ -28,12 +28,36 @@
using AppNavRoute;
// Seconds since the running device shared this snapshot. Snapshots arrive
// every few seconds, so clocks count on between them.
ActivityLiveSeconds :: (value: AccountActivity) -> s32 {
if value.paused != 0 || value.time <= 0 {
return 0
}
offset := ActivityCurrentTime() - value.time
if offset < 0 {
return 0
}
if offset > ActivityFreshSeconds {
offset = ActivityFreshSeconds
}
return cast(s32)offset
}
ActivityCountDown :: (seconds: s32, live: s32) -> s32 {
if seconds <= live {
return 0
}
return seconds - live
}
ActivityStatus :: (value: AccountActivity, output: []u8) -> string {
live := ActivityLiveSeconds(value)
if value.screen == ScreenMeditation {
return session_window_clock(value.remaining, output)
return session_window_clock(ActivityCountDown(value.remaining, live), output)
}
if value.screen == ScreenPatterns {
return session_window_clock(ifx value.duration > 0 then value.remaining else value.elapsed, output)
return session_window_clock(ifx value.duration > 0 then ActivityCountDown(value.remaining, live) else value.elapsed + live, output)
}
if value.screen == ScreenSession {
key := "notification_starting_seconds"
@@ -46,8 +70,14 @@ ActivityStatus :: (value: AccountActivity, output: []u8) -> string {
} else if value.phase == BreathPhaseNext {
key = "session_round_label"
}
count := value.count
if value.phase == BreathPhaseHold {
count += live
} else if value.phase == BreathPhaseStarting {
count = ActivityCountDown(count, live)
}
unused FormatNumberTemplate(LocaleText(key),
ifx value.phase == BreathPhaseNext then value.round else value.count, output)
ifx value.phase == BreathPhaseNext then value.round else count, output)
return TextUntilNul(output)
}
unused FormatNumberTemplate(LocaleText("session_round_label"), value.round, output)
+3 -1
View File
@@ -3,6 +3,7 @@
#import, file "app_types.zi";
#import, file "route_types.zi";
#import, file "frame_activity.zi";
#import, file "session_screen.zi";
#import, file "../platform/environment.zi";
FrameActivitySample :: struct {
@@ -33,7 +34,8 @@ app_update_frame_pacing :: (app: *InnerBreeze,
sample: FrameActivitySample) -> FramePacingDecision {
engaged: bool = false
if app != null {
engaged = PracticeFrameActive(app.breathing.screen) || app.modal.active != 0 || (app.breathing.screen == ScreenStart && app.practice_tab == PRACTICE_TAB_CONFIG) || app.file_dialog_active != 0 || sample.pointer_active || sample.keyboard_active || sample.text_input_active
// A practice running in its small window animates at full rate too.
engaged = PracticeFrameActive(app_session_screen(app)) || app.modal.active != 0 || (app.breathing.screen == ScreenStart && app.practice_tab == PRACTICE_TAB_CONFIG) || app.file_dialog_active != 0 || sample.pointer_active || sample.keyboard_active || sample.text_input_active
// A route fade runs after the tap is released, so its animation
// must continue at the active rate.
engaged = engaged || app.ui.route_transition_pending ||
+2
View File
@@ -174,6 +174,7 @@ app_launcher_draw_card :: (app: *InnerBreeze, route: s32,
#program_export
app_draw_launcher :: (app: *InnerBreeze) {
app.launcher_panel_node = -1
if !app.launcher_open || app.host_feature != 0 { return }
if app.modal.active != 0 {
app_launcher_close(app)
@@ -201,6 +202,7 @@ app_draw_launcher :: (app: *InnerBreeze) {
return
}
if result.panel_node < 0 || !TreePushScope(app.ui.session, result.panel_node) { return }
app.launcher_panel_node = result.panel_node
PaintRoundedFill(app.ui.session, result.panel_node, panel, 0.0, 4,
StyleTokenColor("launcher-canvas"))
margin := AppScale(20)
+8 -1
View File
@@ -4,6 +4,7 @@ c :: #system_library "c";
#import, file "app_types.zi";
#import, file "route_types.zi";
#import, file "modal_rules.zi";
#import, file "session_screen.zi";
#import, file "app.zi";
#import "tree_input";
@@ -59,7 +60,13 @@ app_close_modal :: (app: *InnerBreeze) {
#program_export
app_clear_invalid_screen_local_modal :: (app: *InnerBreeze) {
if app == null || app.modal.active == 0 { return }
if ModalValidOnScreen(app.modal.type, app.breathing.screen,
// The exit prompt belongs to the running practice, which may show in
// its small window while another app is open.
screen := app.breathing.screen
if app.modal.type == cast(ModalType)ModalConfirmExitSession {
screen = app_session_screen(app)
}
if ModalValidOnScreen(app.modal.type, screen,
app.habits.tab == HABIT_TAB_EDIT) { return }
clear_modal_state(app)
}
+26 -5
View File
@@ -7,6 +7,10 @@ c :: #system_library "c";
ProfileGetEnv :: (name: *u8) -> *u8 #foreign c "app_getenv_bytes";
ProfileClock :: () -> float64 #foreign c "app_monotonic_seconds";
ProfileLogInfo :: (line: *u8) #foreign c "app_log_line";
#if #defined(ANDROID_DEBUG) {
android_log :: #system_library "log";
ProfileLogAndroid :: (priority: s32, tag: *u8, line: *u8) -> s32 #foreign android_log "__android_log_write";
}
#scope_export
#program_export
@@ -16,6 +20,9 @@ app_profile_env_enabled :: () -> bool {
return false
}
value: *u8 = ProfileGetEnv(*name[0])
#if #defined(ANDROID_DEBUG) {
if value == null { return true }
}
return value != null && value[0] != cast(u8)0 && value[0] != cast(u8)48
}
@@ -76,7 +83,7 @@ ProfileAppendTwoDecimals :: (output: []u8, used: *s32, number: float64) -> bool
app_profile_report :: (frame_avg: float64, frame_max: float64,
update_avg: float64, update_max: float64,
habits_avg: float64, habits_max: float64,
sync_avg: float64, sync_max: float64) {
sync_avg: float64, sync_max: float64, fps: float64) {
line: [256]u8
used: s32 = 0
if !ProfileAppend(line[:], *used, "PROFILE: frame avg=") ||
@@ -94,17 +101,27 @@ app_profile_report :: (frame_avg: float64, frame_max: float64,
!ProfileAppend(line[:], *used, " sync avg=") ||
!ProfileAppendTwoDecimals(line[:], *used, sync_avg) ||
!ProfileAppend(line[:], *used, " max=") ||
!ProfileAppendTwoDecimals(line[:], *used, sync_max) {
!ProfileAppendTwoDecimals(line[:], *used, sync_max) ||
!ProfileAppend(line[:], *used, " fps=") ||
!ProfileAppendTwoDecimals(line[:], *used, fps) {
return
}
line[used] = cast(u8)0
ProfileLogInfo(*line[0])
#if #defined(ANDROID_DEBUG) {
tag: [16]u8
if CopyCString("InbePerformance", tag[:]) {
unused ProfileLogAndroid(4, *tag[0], *line[0])
}
} else {
ProfileLogInfo(*line[0])
}
}
ProfileStats :: struct {
initialized: s32
enabled: s32
frames: s32
report_started: float64
frame_total: float64
frame_max: float64
update_total: float64
@@ -168,17 +185,21 @@ app_profile_record_sync :: (start: float64) {
#program_export
app_profile_frame_end :: (start: float64) {
if !enabled() || start <= 0.0 { return }
elapsed := (ProfileClock() - start) * 1000.0
now := ProfileClock()
if stats.report_started <= 0.0 { stats.report_started = start }
elapsed := (now - start) * 1000.0
stats.frame_total += elapsed
if elapsed > stats.frame_max { stats.frame_max = elapsed }
stats.frames += 1
if stats.frames < 120 { return }
count := cast(float64)stats.frames
fps: float64 = 0.0
if now > stats.report_started { fps = count / (now - stats.report_started) }
app_profile_report(stats.frame_total / count, stats.frame_max,
stats.update_total / count, stats.update_max,
stats.habits_total / count, stats.habits_max,
stats.sync_total / count, stats.sync_max)
stats.sync_total / count, stats.sync_max, fps)
stats = ProfileStats.{0 }
stats.initialized = 1
stats.enabled = 1
+4
View File
@@ -229,6 +229,8 @@ save_settings :: (app: *InnerBreeze) {
save_setting_int("fullscreen", ifx app.fullscreen_enabled != 0 then 1 else 0)
save_setting_int("on_screen_keyboard",
ifx app.on_screen_keyboard_enabled != 0 then 1 else 0)
save_setting_int("picture_in_picture",
ifx app.picture_in_picture_enabled != 0 then 1 else 0)
save_setting_int("notification_friend_request",
ifx app.notification_friend_request != 0 then 1 else 0)
save_setting_int("notification_habit_reminders",
@@ -479,6 +481,8 @@ app_load_settings :: (app: *InnerBreeze) -> s32 {
load_bool_setting(*app.on_screen_keyboard_enabled,
"on_screen_keyboard", 0)
}
load_bool_setting(*app.picture_in_picture_enabled,
"picture_in_picture", 1)
load_bool_setting(*app.notification_friend_request,
"notification_friend_request", 1)
load_bool_setting(*app.notification_habit_reminders,
+27 -1
View File
@@ -1113,6 +1113,26 @@ app_sync_review_pending :: () -> s32 {
return sync_review_cache
}
sync_queue_cache: SyncStatus;
sync_queue_cache_valid: bool;
sync_queue_cache_revision: s64 = -1;
sync_queue_cache_checked: float64 = -1.0;
// The queue changes with stored data, not the render rate. A bounded
// fallback also picks up metadata changed outside the writing connection.
app_sync_queue_status :: (status: *SyncStatus, now: float64) -> bool {
if status == null { return false }
revision := storage_data_revision()
if revision != sync_queue_cache_revision || now < sync_queue_cache_checked ||
now - sync_queue_cache_checked >= 0.25 {
sync_queue_cache_revision = revision
sync_queue_cache_checked = now
sync_queue_cache_valid = SyncStatusRead(*sync_queue_cache)
}
status.* = sync_queue_cache
return sync_queue_cache_valid
}
app_sync_pump :: (app: *InnerBreeze) {
now: float64
should_sync: s32 = 0
@@ -1131,6 +1151,12 @@ app_sync_pump :: (app: *InnerBreeze) {
app.ui.sync_requested = false
unused app_auto_sync(app)
}
// Here sync runs on the frame thread: a visible practice also waits to
// finish a request that started before it, since applying its records
// takes longer than a frame. Scheduled work runs when it ends.
if SyncOnFrameThread() && app_practice_holds_frame_work(app) {
return
}
now = GetTime()
app_sync_record_input(app, now)
app_collect_finished_sync()
@@ -1160,7 +1186,7 @@ app_sync_pump :: (app: *InnerBreeze) {
should_sync = 1
dirty_due = 1
}
if SyncStatusRead(*sync_status) && sync_status.has_account != 0 && sync_status.enabled != 0 && (sync_status.queued_changes > 0 || sync_status.full_upload_done == 0 || sync_status.repair_pending != 0) && (g_sync.dirty_sync_at <= 0.0 || now >= g_sync.dirty_sync_at) {
if app_sync_queue_status(*sync_status, now) && sync_status.has_account != 0 && sync_status.enabled != 0 && (sync_status.queued_changes > 0 || sync_status.full_upload_done == 0 || sync_status.repair_pending != 0) && (g_sync.dirty_sync_at <= 0.0 || now >= g_sync.dirty_sync_at) {
should_sync = 1
if sync_status.repair_pending != 0 {
repair_due = 1
+22 -11
View File
@@ -297,7 +297,6 @@ HabitEditState :: struct {
counter_target: s32
weekdays: s32
reminder_hour: s32
reminder_menu: DropdownResult
}
SessionResult :: struct {
@@ -321,7 +320,6 @@ AppUiState :: struct {
view_height: s32
desktop_mode: s32
config_scroll: s32
config_route_menus: [APP_BOTTOM_NAV_CONTENT_MAX]DropdownResult
pointer_active: bool
mouse_x: s32
mouse_y: s32
@@ -343,15 +341,6 @@ AppUiState :: struct {
route_transition_texture: Texture2D
route_transition_texture_owned: bool
frame_text: FrameTextStore
locale_settings_menu: DropdownResult
locale_first_run_menu: DropdownResult
orientation_settings_menu: DropdownResult
startup_settings_menu: DropdownResult
close_settings_menu: DropdownResult
break_mode_settings_menu: DropdownResult
sun_salutation_character_menu: DropdownResult
audio_cue_menus: [AUDIO_CUE_COUNT]DropdownResult
reminder_menus: [APP_REMINDER_MAX]DropdownResult
rest_break_requested: bool
sync_requested: bool
}
@@ -362,12 +351,30 @@ SessionWindow :: struct {
// The running practice's session screen while another app is shown.
screen: s32
minimize_requested: bool
detach_requested: bool
restore_requested: bool
close_requested: bool
detached: bool
system_available: bool
system_visible: bool
system_screen: s32
system_generation: s32
system_last_tick: float64
system_elapsed_carry: float64
last_tick: float64
elapsed_carry: float64
// The app page shown before the practice started; minimizing returns
// there.
origin_route: s32
origin_known: bool
placed: bool
position: Vector2
size: Vector2
drag_moved: bool
drag_origin: Vector2
drag_start: Vector2
resize_origin: Vector2
resize_start: Vector2
// Navigation on screen: 0 is hidden, 1 is fully shown.
nav_shown: float32
nav_frame_time: float64
@@ -448,6 +455,8 @@ InnerBreeze :: struct {
device_picker_scroll: s32
fullscreen_enabled: s32
on_screen_keyboard_enabled: s32
// Android floats a running practice over other apps when this is on.
picture_in_picture_enabled: s32
notification_friend_request: s32
notification_habit_reminders: s32
friend_request_last_count: s32
@@ -511,6 +520,8 @@ InnerBreeze :: struct {
launcher_favorites: [LAUNCHER_APP_COUNT]s32
launcher_favorite_count: s32
launcher_open: bool
// The Apps overlay's panel in this frame, or -1 when it is not drawn.
launcher_panel_node: s32
launcher_guide_seen: s32
launcher_guide_step: s32
launcher_scroll: s32
+124 -12
View File
@@ -56,6 +56,8 @@ PackageNow :: () -> s64 #foreign c "now_seconds";
#import, file "app_launcher_state.zi";
#import, file "session_window.zi";
#import, file "session_window_view.zi";
#import, file "../platform/practice_window_host.zi";
#import, file "../platform/android/android_picture_window.zi";
#import, file "account_activity.zi";
#import, file "account_activity_view.zi";
#import "tree_input"
@@ -65,6 +67,7 @@ PackageNow :: () -> s64 #foreign c "now_seconds";
#import, file "../screens/settings/settings_status.zi";
#import, file "app_sync.zi";
#import, file "sync_safety.zi";
#import, file "telegram_account_flow.zi";
#import, file "../platform/telegram_bridge.zi";
#import, file "../storage/delegate_store.zi";
@@ -167,6 +170,8 @@ EndScissorMode :: () #foreign raylib_log "EndScissorMode";
#if #defined(ANDROID_BUILD) {
#import, file "../platform/android/android_wakelock.zi";
#import, file "../platform/android/android_insets.zi";
android_network_pump_begin :: () -> bool #foreign c;
android_network_pump_end :: () #foreign c;
}
#if #defined(PLATFORM_WEB) || #defined(ANDROID_BUILD) {
@@ -1021,7 +1026,7 @@ draw_global_modal :: (app: *InnerBreeze) {
}
updateapp :: (app: *InnerBreeze) {
ActivityPump(app)
app_activity_pump(app)
hover: s32 = 0
center_x: s32 = view_width / 2
frame_view_height: s32 = view_height
@@ -1286,7 +1291,12 @@ updateapp :: (app: *InnerBreeze) {
if launcher_owns_input { unused TreeInputResume(app.ui.session, launcher_input) }
view_height = frame_view_height
app_draw_session_nav(app)
app_session_window_draw(app)
// The Apps screen covers the page, so the practice window is drawn on it
// while it is open.
launcher_covers_page := app.launcher_open
if !launcher_covers_page {
app_session_window_draw(app)
}
ActivityDrawIndicator(app)
app_draw_mini_expand_button(app)
practice_screen_draw_first_run_guide(app)
@@ -1296,22 +1306,62 @@ updateapp :: (app: *InnerBreeze) {
}
app_draw_close_prompt(app)
app_draw_launcher(app)
if launcher_covers_page {
// Apps is an overlay above the page, so the window is drawn inside
// its panel, above the apps. If Apps closed during this frame, the
// window is drawn over the page instead.
inside_launcher := app.launcher_panel_node >= 0 &&
TreePushScope(app.ui.session, app.launcher_panel_node)
app_session_window_draw(app)
if inside_launcher {
unused End(app.ui.session)
}
}
app_flush_deferred_settings(app)
app_observe_direct_route_change(app, frame_route)
app.breathing.frame += 1
}
// Android's existing practice timer owns the same app-state mutex as the
// foreground frame. Exchange live records while background practice continues;
// drawing and result ownership remain on their existing paths.
// Exchanges live activity records and sync. On Android the frame and the
// background practice timer both call this, and around picture-in-picture
// both run at once: only one exchanges at a time, so a finished sync is
// applied and released by one thread only.
app_network_pump :: (app: *InnerBreeze) {
#if #defined(ANDROID_BUILD) {
if !android_network_pump_begin() {
return
}
}
ActivityPump(app)
app_sync_pump(app)
#if #defined(ANDROID_BUILD) {
android_network_pump_end()
}
}
// Exchanges live activity records alone, under the same one-thread rule.
app_activity_pump :: (app: *InnerBreeze) {
#if #defined(ANDROID_BUILD) {
if !android_network_pump_begin() {
return
}
}
ActivityPump(app)
#if #defined(ANDROID_BUILD) {
android_network_pump_end()
}
}
// Android's practice timer exchanges live records while a practice continues
// in the background; drawing and result ownership remain on their existing
// paths.
#program_export
app_activity_background_sync :: (vapp: *void) {
app := cast(*InnerBreeze)vapp
if app == null {
return
}
ActivityPump(app)
app_sync_pump(app)
app_network_pump(app)
}
app_update_draw_last_full_w: s32 = -1;
@@ -1391,6 +1441,22 @@ app_update_draw :: (vapp: *void, viewport: Rectangle) {
if !app_reload_graphics_resources(app) {
return
}
#if #defined(ANDROID_BUILD) {
picture_state := AndroidPictureWindowState()
app.session_window.system_available = (picture_state & 1) != 0 &&
app.picture_in_picture_enabled != 0
app.session_window.system_visible = (picture_state & 2) != 0
generation := picture_state >> 2
if generation != app.session_window.system_generation {
app.session_window.system_generation = generation
app.session_window.system_last_tick = GetTime()
}
if app.session_window.system_visible {
app_draw_android_picture_window(app, viewport)
return
}
app.session_window.system_last_tick = GetTime()
}
full_width = cast(s32)viewport.width
full_height = cast(s32)viewport.height
view_width = full_width
@@ -1513,7 +1579,7 @@ app_update_draw :: (vapp: *void, viewport: Rectangle) {
}
if TelegramAccountFlowOwnsContext() {
TelegramAccountFlowPump(app)
ActivityPump(app)
app_activity_pump(app)
app_profile_frame_end(profile_frame_start)
return
}
@@ -1521,10 +1587,12 @@ app_update_draw :: (vapp: *void, viewport: Rectangle) {
app_profile_record_habits(profile_habits_start)
profile_sync_start = app_profile_now()
settings_sync_account_pump(app)
ActivityPump(app)
app_sync_pump(app)
app_lumi_pump(app)
PackagePump(app.enabled_apps, cast(s32)PackageNow())
app_network_pump(app)
// Lumi and package requests run on the frame thread on every platform.
if !app_practice_holds_frame_work(app) {
app_lumi_pump(app)
PackagePump(app.enabled_apps, cast(s32)PackageNow())
}
if app.app_choices_pending && practice_active(app) == null && app.modal.active == 0 &&
app.breathing.screen != ScreenHabitEdit && app.breathing.screen != ScreenHabitSessionEdit &&
app_diary_save() {
@@ -1550,6 +1618,49 @@ app_update_draw :: (vapp: *void, viewport: Rectangle) {
app_profile_frame_end(profile_frame_start)
}
// Android supplies the floating activity surface. Draw only the live practice,
// with a stable 200-unit layout while the OS moves and resizes it.
app_draw_android_picture_window :: (app: *InnerBreeze, viewport: Rectangle) {
#if #defined(ANDROID_BUILD) {
now := GetTime()
elapsed := now - app.session_window.system_last_tick
app.session_window.system_last_tick = now
// The in-app card must not replay the whole PiP interval on return.
app.session_window.last_tick = now
practice := practice_active(app)
if practice != null {
screen := app.session_window.screen
if screen == ScreenStart {
screen = app.breathing.screen
}
app.session_window.system_screen = screen
if app.backgrounded == 0 && elapsed > 0.0 && practice.advance_elapsed != null {
total := elapsed * 1000.0 + app.session_window.system_elapsed_carry
milliseconds := cast(s32)total
app.session_window.system_elapsed_carry = total - cast(float64)milliseconds
practice.advance_elapsed(app, milliseconds)
}
}
scale := viewport.width / 200.0
bounds := Rectangle.{0.0, 0.0, 200.0, viewport.height / scale}
camera: Camera
camera.zoom = scale
camera.offset = Vector2.{viewport.x, viewport.y}
AppMetricsConfigure(1.0)
DirectDrawFrameBegin(viewport)
DrawRectangleRec(viewport, StyleTokenColor("surface"))
if cast(s32)BeginFrame(app.ui.session, KeyHash("inbe/picture-window"), bounds) == 0 {
BeginMode2D(camera)
app_session_window_picture(app, app.session_window.system_screen, bounds, 0.0)
app_finish_frame(app)
EndMode2D()
}
app_network_pump(app)
}
unused app
unused viewport
}
#program_export
app_destroy :: (vapp: *void) {
app: *InnerBreeze = cast(*InnerBreeze)vapp
@@ -1570,6 +1681,7 @@ app_destroy :: (vapp: *void) {
ClearDelegate()
}
CloseBreakWindows()
ClosePracticeWindow(app)
ReleaseRuntimeAssetDownload(*app.meditation.music_download)
unused app_diary_save()
PackageCancel()
+38 -31
View File
@@ -39,27 +39,31 @@ app_session_window_restore :: (app: *InnerBreeze) -> bool {
return false
}
screen := app.session_window.screen
app.session_window.screen = ScreenStart
if app.launcher_open {
app_launcher_close(app)
}
previous_tab := app.main_tab
app.main_tab = APP_MAIN_TAB_PRACTICE
app_switch_screen(app, screen)
if app.breathing.screen != screen {
app.main_tab = previous_tab
return false
}
app.session_window.screen = ScreenStart
app_block_current_click(app)
return true
}
// Opening Practice returns to the running practice; another app keeps it
// running in its small window. Returns true when the route is handled.
// Practice stays on a practice shown full screen. Any other app, Practice's
// home included, keeps the practice running in its small window; the
// window's maximize button or Start returns to it. Returns true when the
// route is handled.
app_session_window_route :: (app: *InnerBreeze, route: s32) -> bool {
if app == null {
return false
}
if route == APP_NAV_ROUTE_PRACTICE {
if app_is_session_screen(app.breathing.screen) {
return true
}
return app_session_window_restore(app)
if route == APP_NAV_ROUTE_PRACTICE && app_is_session_screen(app.breathing.screen) {
return true
}
unused app_session_window_open(app)
return false
@@ -69,7 +73,7 @@ app_session_window_route :: (app: *InnerBreeze, route: s32) -> bool {
app_session_nav_rail :: (app: *InnerBreeze) -> bool {
placement := app_navigation_placement(app)
return (placement == NAVIGATION_LEFT || placement == NAVIGATION_RIGHT) &&
app.ui.view_height >= AppScale(476)
app.ui.view_height >= AppScale(476)
}
// Slides the navigation toward where it belongs: shown on app pages and
@@ -106,29 +110,38 @@ app_session_nav_update :: (app: *InnerBreeze) {
}
}
// The app a minimized practice gives way to: Lumi when the practice was
// started from it, otherwise the first pinned app that is not Practice.
// Remembers the app page shown while no practice runs, so a practice
// minimizes back to the page it was started from.
app_session_window_note_page :: (app: *InnerBreeze) {
if app == null || app.session_window.screen != ScreenStart ||
app_is_session_screen(app.breathing.screen) {
return
}
route := app_current_nav_route(app)
if route == APP_NAV_ROUTE_NONE {
return
}
app.session_window.origin_route = route
app.session_window.origin_known = true
}
// The app a minimized practice gives way to: the page it was started from,
// which is already drawn, so the switch costs no cold page. Lumi only when
// the practice was started from Lumi's chat.
session_window_return_route :: (app: *InnerBreeze) -> s32 {
if app.lumi_practice != 0 && app_nav_route_available(app, APP_NAV_ROUTE_LUMI) {
return APP_NAV_ROUTE_LUMI
}
for index: cast(s32)0..app.launcher_favorite_count - 1 {
route := app.launcher_favorites[index]
if route != APP_NAV_ROUTE_PRACTICE && app_nav_route_available(app, route) {
return route
}
origin := app.session_window.origin_route
if app.session_window.origin_known && origin != APP_NAV_ROUTE_LUMI &&
app_nav_route_available(app, origin) {
return origin
}
others: [4]s32 = .[APP_NAV_ROUTE_HABITS, APP_NAV_ROUTE_ELIST, APP_NAV_ROUTE_DIARY, APP_NAV_ROUTE_LUMI]
for route: others {
if app_nav_route_available(app, route) {
return route
}
}
return APP_NAV_ROUTE_APPS
return APP_NAV_ROUTE_PRACTICE
}
// The minimize button shrinks the practice into its small window and
// opens another app, or Apps when no other app is installed.
// returns to the page the practice was started from.
app_session_window_take_minimize :: (app: *InnerBreeze) {
if app == null || !app.session_window.minimize_requested {
return
@@ -137,13 +150,7 @@ app_session_window_take_minimize :: (app: *InnerBreeze) {
if !app_session_window_open(app) {
return
}
route := session_window_return_route(app)
if route == APP_NAV_ROUTE_APPS {
app.main_tab = APP_MAIN_TAB_NONE
app_launcher_toggle(app)
return
}
app_apply_nav_route(app, route)
app_apply_nav_route(app, session_window_return_route(app))
}
// Where the navigation sits when fully shown over a practice.
+246 -101
View File
@@ -4,6 +4,9 @@
#import, file "../core/types.zi";
#import, file "session_screen.zi";
#import, file "session_window.zi";
#import, file "app_route_state.zi";
#import, file "modal_rules.zi";
#import, file "app_modal_state.zi";
#import, file "app_nav_state.zi";
#import, file "exercise_types.zi";
#import, file "locale.zi";
@@ -11,7 +14,6 @@
#import, file "text_buffers.zi";
#import, file "draw.zi";
#import, file "../practices/practice_registry.zi";
#import, file "../core/breath_timing.zi";
#import "box_props"
#import "box_widget"
#import "button_props"
@@ -24,6 +26,7 @@
#import "layout"
#import "session"
#import "style"
#import "text_align"
#import "text_props"
#import "text_widget"
#import "tree"
@@ -34,12 +37,28 @@ c :: #system_library "c";
GetTime :: () -> float64 #foreign c;
using ButtonEmphasis;
using ModalType;
using ExerciseType;
using TextAlign;
using TextWrap;
using WidgetKind;
SESSION_WINDOW_CARD_ID :: 7480
SESSION_WINDOW_CLOSE_ID :: 7481
SESSION_WINDOW_MAXIMIZE_ID :: 7482
SESSION_WINDOW_RESIZE_ID :: 7483
SESSION_WINDOW_DETACH_ID :: 7484
// Units: the window's starting and smallest sizes, its inner margin, the
// row holding its buttons, the lines below the picture and the corner that
// resizes it.
SESSION_WINDOW_WIDTH :: 220
SESSION_WINDOW_HEIGHT :: 320
SESSION_WINDOW_MIN_WIDTH :: 160
SESSION_WINDOW_MIN_HEIGHT :: 220
SESSION_WINDOW_PADDING :: 8
SESSION_WINDOW_BUTTON_ROW :: 40
SESSION_WINDOW_TEXT_HEIGHT :: 46
SESSION_WINDOW_GRIP :: 32
session_window_practice :: (screen: s32) -> s32 {
if screen == ScreenMeditation {
@@ -54,22 +73,62 @@ session_window_practice :: (screen: s32) -> s32 {
return cast(s32)EXERCISE_WIM_HOF
}
// Ends the practice from its small window the way leaving its screen does:
// it asks first, with the practice's own choices for the time so far.
// Ends the practice from its small window the way leaving its screen does,
// over the page that is open: it asks first, with the practice's own
// choices for the time so far.
app_session_window_close :: (app: *InnerBreeze) {
if !app_session_window_restore(app) {
if app == null || app.session_window.screen == ScreenStart {
return
}
practice := practice_get(session_window_practice(app.breathing.screen))
if practice != null && practice.request_exit != null {
practice.request_exit(app)
practice := practice_get(session_window_practice(app.session_window.screen))
if practice == null || practice.request_exit == null {
return
}
route := app_current_route(app)
practice.request_exit(app)
// A paused practice ends without asking; the open page stays.
if app.modal.active == 0 {
app.session_window.screen = ScreenStart
app_switch_route(app, route)
}
}
// Draws the running practice's exit prompt over the open page.
session_window_exit_prompt :: (app: *InnerBreeze) -> bool {
if app.modal.active == 0 || app.modal.type != cast(ModalType)ModalConfirmExitSession {
return false
}
practice := practice_get(session_window_practice(app.session_window.screen))
if practice == null || practice.exit_prompt == null {
return false
}
route := app_current_route(app)
// Ending the practice closes its window and keeps the open page.
if practice.exit_prompt(app) == PRACTICE_EXIT_ENDED {
app.session_window.screen = ScreenStart
app_switch_route(app, route)
}
return true
}
// Advances the practice in its small window by the time since the last
// frame. In the background the platform timer advances it instead.
app_session_window_tick :: (app: *InnerBreeze) {
if app == null {
return
}
// Native window input arrives between frames. Apply its practice actions
// inside the main frame, alongside the app's own card controls.
if app.session_window.restore_requested {
app.session_window.restore_requested = false
unused app_session_window_restore(app)
}
if app.session_window.close_requested {
app.session_window.close_requested = false
app_session_window_close(app)
}
app_session_window_take_minimize(app)
app_session_window_note_page(app)
if app == null || app.session_window.screen == ScreenStart {
return
}
@@ -79,7 +138,7 @@ app_session_window_tick :: (app: *InnerBreeze) {
// A finished practice shows its results; a practice shown again by any
// other way leaves its window.
if app.breathing.screen == ScreenResults ||
app.breathing.screen == app.session_window.screen {
app.breathing.screen == app.session_window.screen {
app.session_window.screen = ScreenStart
return
}
@@ -90,12 +149,18 @@ app_session_window_tick :: (app: *InnerBreeze) {
if practice == null || practice.advance_elapsed == null {
return
}
practice.advance_elapsed(app, cast(s32)(elapsed * 1000.0 + 0.5))
// Whole milliseconds advance the practice; the rest carries to the next
// frame, so the practice keeps the real clock's pace.
total := elapsed * 1000.0 + app.session_window.elapsed_carry
milliseconds := cast(s32)total
app.session_window.elapsed_carry = total - cast(float64)milliseconds
practice.advance_elapsed(app, milliseconds)
if app.breathing.screen == ScreenResults {
app.session_window.screen = ScreenStart
}
}
// Minutes and seconds, as practices show their time.
session_window_clock :: (seconds: s32, output: []u8) -> string {
value := seconds
if value < 0 {
@@ -127,123 +192,132 @@ session_window_clock :: (seconds: s32, output: []u8) -> string {
return AppTextFromCString(*output[0], cast(s32)output.count)
}
// What the practice is doing now, as its screen shows it.
session_window_status :: (app: *InnerBreeze, output: []u8) -> string {
screen := app.session_window.screen
if screen == ScreenMeditation {
return session_window_clock(app.meditation.remaining_seconds, output)
}
if screen == ScreenPatterns {
seconds := app.patterns.elapsed_seconds
if app.patterns.duration_minutes > 0 {
seconds = app.patterns.duration_minutes * 60 - app.patterns.elapsed_seconds
}
return session_window_clock(seconds, output)
}
if screen == ScreenSession {
round: [32]u8
unused FormatNumberTemplate(LocaleText("session_round_label"),
app.breathing.round + 1, round[:])
count := BreathDigitsRead(app.breathing.count[:])
number: [16]u8
unused AppFormatS32(count, number[:])
text := AppTextFromCString(*round[0], 32)
value := AppTextFromCString(*number[0], 16)
used: s32 = 0
for byte: text {
if used < cast(s32)output.count - 1 {
output[used] = byte
used += 1
}
}
separator: [5]u8 = .[32, 194, 183, 32, 0]
for index: 0..3 {
if used < cast(s32)output.count - 1 {
output[used] = separator[index]
used += 1
}
}
for byte: value {
if used < cast(s32)output.count - 1 {
output[used] = byte
used += 1
}
}
output[used] = 0
return AppTextFromCString(*output[0], cast(s32)output.count)
}
output[0] = 0
return ""
// The bottom edge the window stays above: the message fields and actions
// along the bottom of the open page.
session_window_floor :: (app: *InnerBreeze) -> float32 {
return cast(float32)(app.ui.view_height - app_content_bottom_reserved(app))
}
session_window_clamp :: (app: *InnerBreeze, width: float32, height: float32) {
// Keeps the window's size between its smallest size and the page.
session_window_fit_size :: (app: *InnerBreeze) {
margin := cast(float32)AppScale(8)
right := cast(float32)app.ui.view_width - width - margin
bottom := cast(float32)(app.ui.view_height - app_content_bottom_reserved(app)) - height - margin
if app.session_window.position.x > right {
app.session_window.position.x = right
window := *app.session_window
widest := cast(float32)app.ui.view_width - margin * 2.0
tallest := session_window_floor(app) - margin * 2.0
narrowest := cast(float32)AppScale(SESSION_WINDOW_MIN_WIDTH)
shortest := cast(float32)AppScale(SESSION_WINDOW_MIN_HEIGHT)
if window.size.x > widest {
window.size.x = widest
}
if app.session_window.position.y > bottom {
app.session_window.position.y = bottom
if window.size.y > tallest {
window.size.y = tallest
}
if app.session_window.position.x < margin {
app.session_window.position.x = margin
if window.size.x < narrowest {
window.size.x = narrowest
}
if app.session_window.position.y < margin {
app.session_window.position.y = margin
if window.size.y < shortest {
window.size.y = shortest
}
}
// The running practice's small window: tap to return, drag to move, and
// the X ends the practice.
// Keeps the whole window on the page.
session_window_clamp :: (app: *InnerBreeze) {
margin := cast(float32)AppScale(8)
window := *app.session_window
right := cast(float32)app.ui.view_width - window.size.x - margin
bottom := session_window_floor(app) - window.size.y - margin
if window.position.x > right {
window.position.x = right
}
if window.position.y > bottom {
window.position.y = bottom
}
if window.position.x < margin {
window.position.x = margin
}
if window.position.y < margin {
window.position.y = margin
}
}
// The corner handle resizes the window from its bottom right while the top
// left stays in place.
session_window_resize :: (app: *InnerBreeze, bounds: Rectangle) {
session := app.ui.session
window := *app.session_window
grip_size := cast(float32)AppScale(SESSION_WINDOW_GRIP)
grip: ButtonProps
grip.id = SESSION_WINDOW_RESIZE_ID
grip.bounds = Rectangle.{bounds.x + bounds.width - grip_size,
bounds.y + bounds.height - grip_size, grip_size, grip_size}
grip.label = LocaleText("session_resize_button")
grip.icon_only = true
grip.icon_shape = "S1.6rr:M19 13L13 19M19 7L7 19"
grip.emphasis = cast(ButtonEmphasis)ButtonEmphasisGhost
grip.class_name = KssClassId(KssMakeName("launcher-muted"))
key := cast(u64)grip.id
previous := TreePrevious(session, TreeCurrentParent(session), key, WidgetKindButton)
drag := TreeTakeDragAt(session, previous)
if drag.started {
window.resize_origin = Vector2.{drag.x, drag.y}
window.resize_start = window.size
}
if drag.active || drag.ended {
window.size = Vector2.{window.resize_start.x + drag.x - window.resize_origin.x,
window.resize_start.y + drag.y - window.resize_origin.y}
session_window_fit_size(app)
session_window_clamp(app)
}
unused Button(session, grip)
node := TreeSubmitted(session, TreeCurrentParent(session), key, WidgetKindButton)
TreeSetDragCapture(session, node, true)
}
// The running practice's small window: tap or maximize to return, drag to
// move, and the X asks to end the practice over the open page.
app_session_window_draw :: (app: *InnerBreeze) {
if app == null || app.session_window.screen == ScreenStart ||
app.launcher_open || app_is_session_screen(app.breathing.screen) ||
!SessionValid(app.ui.session) {
app_is_session_screen(app.breathing.screen) ||
!SessionValid(app.ui.session) {
return
}
if app.session_window.detached {
unused session_window_exit_prompt(app)
return
}
window := *app.session_window
width := cast(float32)AppScale(212)
height := cast(float32)AppScale(64)
// It starts at the top right, clear of page titles and of the message
// fields and actions along the bottom, and stays where it is dragged.
// fields and actions along the bottom, and stays where it is dragged
// and at the size it is given.
if !window.placed {
window.position = Vector2.{cast(float32)app.ui.view_width - width,
window.size = Vector2.{cast(float32)AppScale(SESSION_WINDOW_WIDTH),
cast(float32)AppScale(SESSION_WINDOW_HEIGHT)}
window.position = Vector2.{cast(float32)app.ui.view_width - window.size.x,
cast(float32)AppScale(72)}
window.placed = true
}
session_window_clamp(app, width, height)
session_window_fit_size(app)
session_window_clamp(app)
width := window.size.x
height := window.size.y
bounds := Rectangle.{window.position.x, window.position.y, width, height}
session := app.ui.session
radius := cast(float32)AppScale(16)
radius := cast(float32)AppScale(18)
// The window floats above the page it covers.
shadow := Rectangle.{bounds.x + cast(float32)AppScale(2), bounds.y + cast(float32)AppScale(5),
shadow := Rectangle.{bounds.x + cast(float32)AppScale(2), bounds.y + cast(float32)AppScale(6),
width, height}
PaintRoundedFill(session, -1, shadow, radius, 12, Color.{0, 0, 0, 72})
PaintRoundedFill(session, -1, shadow, radius, 14, Color.{0, 0, 0, 64})
Box(session, BoxProps.{.key = KeyHash("inbe/session-window/card"),
.bounds = bounds, .fill = StyleTokenColor("surface"),
.border = Fade(StyleTokenColor("accent"), 0.7f), .radius = radius})
.border = Fade(StyleTokenColor("accent"), 0.35f), .radius = radius})
app_session_window_picture(app, window.screen, bounds,
cast(float32)AppScale(SESSION_WINDOW_BUTTON_ROW))
name := practice_label(session_window_practice(window.screen))
status_text: [48]u8
status := session_window_status(app, status_text[:])
text_x := bounds.x + cast(float32)AppScale(14)
text_w := width - cast(float32)AppScale(58)
name_y := bounds.y + cast(float32)AppScale(ifx status.count > 0 then 10 else 21)
Text(session, TextProps.{.key = KeyHash("inbe/session-window/name"),
.bounds = Rectangle.{text_x, name_y, text_w, cast(float32)AppScale(20)},
.text = FrameTextHold(*app.ui.frame_text, name), .font = AppScale(14),
.wrap = cast(TextWrap)TextWrapNone})
if status.count > 0 {
Text(session, TextProps.{.key = KeyHash("inbe/session-window/status"),
.bounds = Rectangle.{text_x, bounds.y + cast(float32)AppScale(34),
text_w, cast(float32)AppScale(18)},
.text = FrameTextHold(*app.ui.frame_text, status), .font = AppScale(12),
.wrap = cast(TextWrap)TextWrapNone,
.class_name = KssClassId(KssMakeName("launcher-muted"))})
}
// The whole card returns to the practice and drags the window; the
// close button is submitted after it so its taps stay its own.
// buttons and the corner handle are submitted after it so their taps
// stay their own.
card: ButtonProps
card.id = SESSION_WINDOW_CARD_ID
card.bounds = bounds
@@ -266,29 +340,100 @@ app_session_window_draw :: (app: *InnerBreeze) {
}
if window.drag_moved {
window.position = Vector2.{window.drag_start.x + dx, window.drag_start.y + dy}
session_window_clamp(app, width, height)
session_window_clamp(app)
}
}
tapped := drag.ended && !window.drag_moved && TreeHoveredAt(session, previous)
activated := Button(session, card) != 0 || tapped
node := TreeSubmitted(session, TreeCurrentParent(session), key, WidgetKindButton)
TreeSetDragCapture(session, node, true)
session_window_resize(app, bounds)
button_size := cast(float32)AppScale(36)
if app.session_window.system_available {
detach: ButtonProps
detach.id = SESSION_WINDOW_DETACH_ID
detach.bounds = Rectangle.{bounds.x + width - cast(float32)AppScale(114),
bounds.y + cast(float32)AppScale(2), button_size, button_size}
detach.label = LocaleText("session_detach_button")
detach.icon_only = true
detach.icon_shape = "S1.8rr:M13 4H20V11M20 4L11 13M10 5H4V20H19V14"
detach.emphasis = cast(ButtonEmphasis)ButtonEmphasisGhost
detach.class_name = KssClassId(KssMakeName("launcher-action"))
if Button(session, detach) != 0 {
window.detach_requested = true
return
}
}
// Maximize returns to the practice; the X asks to end it right here.
maximize: ButtonProps
maximize.id = SESSION_WINDOW_MAXIMIZE_ID
maximize.bounds = Rectangle.{bounds.x + width - cast(float32)AppScale(78),
bounds.y + cast(float32)AppScale(2), button_size, button_size}
maximize.label = LocaleText("session_maximize_button")
maximize.icon_only = true
maximize.icon_shape = "S1.8rr:M14 5H19V10M10 19H5V14M19 5L13 11M5 19L11 13"
maximize.emphasis = cast(ButtonEmphasis)ButtonEmphasisGhost
maximize.class_name = KssClassId(KssMakeName("launcher-action"))
close: ButtonProps
close.id = SESSION_WINDOW_CLOSE_ID
close.bounds = Rectangle.{bounds.x + width - cast(float32)AppScale(42),
bounds.y + cast(float32)AppScale(6), cast(float32)AppScale(36),
cast(float32)AppScale(36)}
bounds.y + cast(float32)AppScale(2), button_size, button_size}
close.label = LocaleText("close_button")
close.icon_only = true
close.icon_shape = "S1.8rr:M6 6L18 18M18 6L6 18"
close.emphasis = cast(ButtonEmphasis)ButtonEmphasisGhost
close.class_name = KssClassId(KssMakeName("launcher-action"))
if Button(session, maximize) != 0 {
unused app_session_window_restore(app)
return
}
if Button(session, close) != 0 {
app_session_window_close(app)
return
}
if session_window_exit_prompt(app) {
return
}
if activated && !window.drag_moved {
unused app_session_window_restore(app)
}
}
// Shared content for the in-app card, detached desktop window and Android PiP.
app_session_window_picture :: (app: *InnerBreeze, screen: s32,
bounds: Rectangle, button_row: float32) {
session := app.ui.session
width := bounds.width
height := bounds.height
padding := cast(float32)AppScale(SESSION_WINDOW_PADDING)
text_height := cast(float32)AppScale(SESSION_WINDOW_TEXT_HEIGHT)
picture := Rectangle.{bounds.x + padding, bounds.y + button_row,
width - padding * 2.0, height - button_row - text_height - padding}
practice := practice_get(session_window_practice(screen))
status_text: [64]u8
status_text[0] = 0
status: string
if practice != null && practice.draw_window != null {
status = practice.draw_window(app, picture, status_text[:])
}
name := practice_label(session_window_practice(screen))
text_y := picture.y + picture.height + cast(float32)AppScale(4)
Text(session, TextProps.{.key = KeyHash("inbe/session-window/name"),
.bounds = Rectangle.{bounds.x + padding, text_y, width - padding * 2.0,
cast(float32)AppScale(20)},
.text = FrameTextHold(*app.ui.frame_text, name), .font = AppScale(15),
.wrap = cast(TextWrap)TextWrapNone,
.align = cast(TextAlign)TextAlignCenter})
if status.count > 0 {
Text(session, TextProps.{.key = KeyHash("inbe/session-window/status"),
.bounds = Rectangle.{bounds.x + padding, text_y + cast(float32)AppScale(20),
width - padding * 2.0, cast(float32)AppScale(18)},
.text = FrameTextHold(*app.ui.frame_text, status), .font = AppScale(13),
.wrap = cast(TextWrap)TextWrapNone,
.align = cast(TextAlign)TextAlignCenter,
.class_name = KssClassId(KssMakeName("launcher-muted"))})
}
}
+27 -1
View File
@@ -1,6 +1,31 @@
#import, file "app_types.zi";
#import, file "../core/types.zi";
#import, file "sync_safety_policy.zi";
#import, file "session_screen.zi";
// Android and the web run sync on the frame thread instead of a worker.
SyncOnFrameThread :: () -> bool {
#if #defined(PLATFORM_WEB) || #defined(ANDROID_BUILD) {
return true
}
return false
}
// The practice drawn on screen, also in its small window. While the app is
// in the background nothing is drawn, so no practice holds work back.
app_visible_practice_screen :: (app: *InnerBreeze) -> s32 {
if app == null || app.backgrounded != 0 {
return ScreenStart
}
return app_session_screen(app)
}
// A visible practice animates every frame, so frame-thread work that can
// outlast a frame (finishing a request, applying its records, package
// updates) waits until the practice ends.
app_practice_holds_frame_work :: (app: *InnerBreeze) -> bool {
return SyncScreenBlocksRefresh(app_visible_practice_screen(app))
}
#program_export
app_background_sync_safe :: (app: *InnerBreeze) -> s32 {
@@ -8,7 +33,8 @@ app_background_sync_safe :: (app: *InnerBreeze) -> s32 {
return ifx BackgroundSyncSafeFields(
app.modal.active, app.habit_edit.active,
app.sync_server_url_focused, app.sync_alias_focused,
app.profile_friend_input_focused, app.breathing.screen) then 1 else 0
app.profile_friend_input_focused, app.breathing.screen,
app_visible_practice_screen(app), SyncOnFrameThread()) then 1 else 0
}
SyncUiUpdateSafe :: (app: *InnerBreeze, now: float64,
+15 -3
View File
@@ -9,6 +9,10 @@ SyncSafetyState :: struct {
alias_focused: s32
friend_input_focused: s32
screen: s32
// The running practice, also while it shows in its small window.
practice_screen: s32
// Android and the web run sync on the frame thread, not a worker.
frame_thread_transport: bool
}
SyncScreenBlocksRefresh :: (screen: s32) -> bool {
@@ -21,14 +25,20 @@ SyncInputBlocksRefresh :: (state: SyncSafetyState) -> bool {
}
BackgroundSyncSafe :: (state: SyncSafetyState) -> bool {
// Transport may exchange encrypted records during a practice. Refreshing
// its settings or screen remains a separate, deferred operation.
// A sync started on the frame thread stops every frame while it builds
// and applies encrypted records, so a running practice waits until it
// ends. A worker-thread transport may exchange records during a
// practice; refreshing settings or the screen stays deferred.
if state.frame_thread_transport && SyncScreenBlocksRefresh(state.practice_screen) {
return false
}
return state.modal_active == 0 && !SyncInputBlocksRefresh(state)
}
BackgroundSyncSafeFields :: (modal_active: s32, habit_edit_active: s32,
server_url_focused: s32, alias_focused: s32,
friend_input_focused: s32, screen: s32) -> bool {
friend_input_focused: s32, screen: s32, practice_screen: s32,
frame_thread_transport: bool) -> bool {
state: SyncSafetyState
state.modal_active = modal_active
state.habit_edit_active = habit_edit_active
@@ -36,6 +46,8 @@ BackgroundSyncSafeFields :: (modal_active: s32, habit_edit_active: s32,
state.alias_focused = alias_focused
state.friend_input_focused = friend_input_focused
state.screen = screen
state.practice_screen = practice_screen
state.frame_thread_transport = frame_thread_transport
return BackgroundSyncSafe(state)
}
+5 -3
View File
@@ -328,7 +328,11 @@ LumiTelegramPump :: (app: *InnerBreeze) {
}
}
}
if lumi_telegram_operation.active || storage_has_sync_account() == 0 { return }
if lumi_telegram_operation.active { return }
now := TelegramNow(null)
requested := lumi_telegram_disconnect_requested || lumi_telegram_link_requested
if !requested && now < lumi_telegram_retry { return }
if storage_has_sync_account() == 0 { return }
client := storage_get_setting_text("lumi_telegram_client")
if client.count != 64 {
bytes: [65]u8
@@ -355,8 +359,6 @@ LumiTelegramPump :: (app: *InnerBreeze) {
}
return
}
now := TelegramNow(null)
if now < lumi_telegram_retry { return }
lumi_telegram_retry = now + LUMI_TELEGRAM_POLL_SECONDS
if lumi_telegram_ack != 0 {
out: Vec(u8)
+2 -2
View File
@@ -3,7 +3,7 @@ PackageBundledVersion :: (index: s32) -> string {
if index < 0 || index >= 6 {
return ""
}
versions: [6]string = .["2.1.20", "1.0.3", "1.0.3", "1.1.3", "1.1.4", "1.3.2"]
versions: [6]string = .["2.1.20", "1.0.3", "1.0.3", "1.1.3", "1.1.5", "1.3.3"]
return versions[index]
}
@@ -11,6 +11,6 @@ PackageBundledSequence :: (index: s32) -> s32 {
if index < 0 || index >= 6 {
return 0
}
sequences: [6]s32 = .[17, 4, 4, 5, 6, 9]
sequences: [6]s32 = .[17, 4, 4, 5, 7, 10]
return sequences[index]
}
+52 -1
View File
@@ -153,7 +153,58 @@ BreathAnimatedSpan :: (session: BreathSession, span: s32,
#program_export
BreathDrawRadius :: (session: BreathSession) -> float32 {
return cast(float32)session.r
return BreathDrawRadiusAt(session, 0.0)
}
// Keep the portable session's integer fields, but paint its continuous
// curve rather than snapping the radius to whole layout units.
#program_export
BreathDrawRadiusAt :: (session: BreathSession, fraction: float32) -> float32 {
span := session.rmax - session.rmin
half_ticks := session.breath_half_ticks
shrinking := session.phase == BreathPhaseNext
if session.phase == BreathPhaseBreathe {
half_ticks = BreathEffectiveHalfTicks(session)
shrinking = session.dir != 0
} else if session.phase != BreathPhaseNext &&
(session.phase != BreathPhaseRecover || session.r >= session.rmax) {
return cast(float32)session.r
}
if span <= 0 || half_ticks <= 0 {
return cast(float32)session.r
}
if !(fraction >= 0.0) { fraction = 0.0 }
if fraction > 1.0 { fraction = 1.0 }
amount := (cast(float32)session.breath_frame + fraction) /
cast(float32)half_ticks
if amount < 0.0 { amount = 0.0 }
if amount > 1.0 { amount = 1.0 }
if session.breath_animation != BreathAnimationLinear {
amount = BreathSmoothstep(amount)
}
if shrinking { amount = 1.0 - amount }
return cast(float32)session.rmin + cast(float32)span * amount
}
BreathClockStep :: struct {
ticks: s32
remainder: float64
}
// Carry fractional ticks directly. Converting each 60 Hz tick back to a
// truncated number of milliseconds makes the clock run too fast.
#program_export
BreathClockAdvance :: (seconds: float64, remainder: float64) -> BreathClockStep {
result: BreathClockStep
if !(remainder >= 0.0) || remainder >= 1.0 { remainder = 0.0 }
result.remainder = remainder
if !(seconds > 0.0) { return result }
if seconds > 300.0 { seconds = 300.0 }
ticks := seconds * 60.0 + remainder
result.ticks = cast(s32)(ticks + 0.000000001)
result.remainder = ticks - cast(float64)result.ticks
if result.remainder < 0.0 { result.remainder = 0.0 }
return result
}
#program_export
+2 -2
View File
@@ -3,7 +3,7 @@
#define APP_VERSION_MAJOR 2
#define APP_VERSION_MINOR 1
#define APP_VERSION_PATCH 23
#define APP_VERSION_STRING "2.1.23"
#define APP_VERSION_PATCH 26
#define APP_VERSION_STRING "2.1.26"
#endif
+2 -2
View File
@@ -1,5 +1,5 @@
// Generated by update_version.sh from CHANGELOG.md. Do not edit by hand.
VersionMajor :: 2
VersionMinor :: 1
VersionPatch :: 23
VersionString :: "2.1.23"
VersionPatch :: 26
VersionString :: "2.1.26"
+3 -2
View File
@@ -191,7 +191,8 @@ run_practice_probe :: (mode: s32, size: WindowSize) -> s32 {
TraceLog(LOG_INFO, "APP: quit requested by shutdown signal")
quit = 1
}
if (IsWindowHidden() || IsWindowMinimized()) && desktop_tray_ready() == 0 {
if (IsWindowHidden() || IsWindowMinimized()) && desktop_tray_ready() == 0 &&
!app.session_window.detached {
TraceLog(LOG_INFO, "APP: tray indicator unavailable; stopping background execution")
quit = 1
}
@@ -243,7 +244,7 @@ run_practice_probe :: (mode: s32, size: WindowSize) -> s32 {
while ShutdownRequested() == 0 && !quit {
#if #defined(PLATFORM_DESKTOP) {
if IsWindowHidden() || IsWindowMinimized() {
if (IsWindowHidden() || IsWindowMinimized()) && !app.session_window.detached {
TraceLog(LOG_INFO, "APP: no tray indicator; stopping background execution")
break
}
+6
View File
@@ -8,6 +8,7 @@
}
AndroidMutexLockForeign :: (mutex: *AndroidMutex) -> s32 #foreign c "pthread_mutex_lock";
AndroidMutexUnlockForeign :: (mutex: *AndroidMutex) -> s32 #foreign c "pthread_mutex_unlock";
AndroidMutexTryLockForeign :: (mutex: *AndroidMutex) -> s32 #foreign c "pthread_mutex_trylock";
AndroidMutexLock :: (mutex: *AndroidMutex) {
AndroidMutexLockForeign(mutex)
@@ -15,4 +16,9 @@
AndroidMutexUnlock :: (mutex: *AndroidMutex) {
AndroidMutexUnlockForeign(mutex)
}
// True when the mutex was free and is now held; false when another
// thread holds it.
AndroidMutexTryLock :: (mutex: *AndroidMutex) -> bool {
return AndroidMutexTryLockForeign(mutex) == 0
}
}
@@ -0,0 +1,49 @@
#import, file "activity_jni.zi";
picture_window_state_sent: bool;
picture_window_enabled_sent: bool;
// Java owns the Android PiP lifecycle. Native reads its volatile snapshot;
// activity callbacks never write practice state from the UI thread.
AndroidPictureWindowState :: () -> s32 {
#if #defined(ANDROID_BUILD) {
session: ActivityJniSession
if activity_jni_attach(*session) == 0 {
return 0
}
defer activity_jni_detach(*session)
method := JniMethod(*session, "pictureWindowState", "()I")
if method != null {
return session.env.functions.CallIntMethodA(session.env,
session.activity, method, null)
}
}
return 0
}
AndroidPictureWindowUpdate :: (enabled: bool, requested: bool) {
#if #defined(ANDROID_BUILD) {
if picture_window_state_sent && enabled == picture_window_enabled_sent && !requested {
return
}
session: ActivityJniSession
if activity_jni_attach(*session) == 0 {
return
}
defer activity_jni_detach(*session)
method := JniMethod(*session, "updatePictureWindow", "(ZZ)V")
if method != null {
arguments: [2]JniValue
arguments[0].boolean = cast(u8)enabled
arguments[1].boolean = cast(u8)requested
session.env.functions.CallVoidMethodA(session.env,
session.activity, method, *arguments[0])
if session.env.functions.ExceptionCheck(session.env) == 0 {
picture_window_state_sent = true
picture_window_enabled_sent = enabled
}
}
}
unused enabled
unused requested
}
@@ -27,6 +27,10 @@
timer_mutex: AndroidMutex;
timer_stopped: [8]u64;
app_state_mutex: AndroidMutex;
// Held while sync and activity requests are exchanged. The frame and
// this timer both exchange them while a practice moves in and out of
// picture-in-picture, and they share one pending sync.
network_mutex: AndroidMutex;
timer_running: bool;
timer_stopping: bool;
timer_active: bool;
@@ -109,6 +113,24 @@ android_timer_get_mutex :: () -> *void {
return null
}
// Starts exchanging sync and activity requests. Returns false while another
// thread exchanges them; that thread finishes them and this one tries again
// on its next frame or tick.
#program_export
android_network_pump_begin :: () -> bool {
#if #defined(ANDROID_BUILD) {
return AndroidMutexTryLock(*network_mutex)
}
return true
}
#program_export
android_network_pump_end :: () {
#if #defined(ANDROID_BUILD) {
AndroidMutexUnlock(*network_mutex)
}
}
#program_export
android_timer_start :: () {
#if #defined(ANDROID_BUILD) {
+28 -4
View File
@@ -20,6 +20,7 @@ app_getenv_bytes :: (name: *u8) -> *u8 #foreign c;
#import, file "environment.zi";
#import, file "android/android_startup.zi";
#import, file "raylib_host.zi";
#import "text_input_platform"
#if #defined(PLATFORM_WEB) == false {
#import, file "../../build/packages/kryon/src/backend/raylib_runtime.zi";
}
@@ -79,6 +80,8 @@ SetTargetFPS :: (fps: s32) #foreign raylib;
#import, file "../app/theme_catalog.zi";
#import, file "../breaks/app_breaks.zi";
#import, file "secondary_window.zi";
#import, file "practice_window_host.zi";
#import, file "android/android_picture_window.zi";
#import "drawing_props"
#if #defined(PLATFORM_WEB) {
#import "web_window"
@@ -119,9 +122,11 @@ native_update_apply_at_exit :: () -> s32 #foreign c;
#if #defined(ANDROID_BUILD) {
#import "android_surface"
#import, file "android/android_device.zi";
#import, file "../practices/practice_registry.zi";
SetWindowState :: (flags: u32) #foreign raylib;
ClearWindowState :: (flags: u32) #foreign raylib;
native_android_frame_viewport :: (viewport: *AndroidViewport) -> s32 #foreign c;
#if #defined(ANDROID_DEBUG) {
#import, file "../practices/practice_registry.zi";
native_android_report_geometry :: (viewport: AndroidViewport,
layout_width: s32, layout_height: s32, render_scale: float32,
practice: s32, paused: s32) #foreign c;
@@ -255,6 +260,18 @@ app_frame_probe_count: s32;
#program_export
app_frame :: (app: *InnerBreeze) {
#if #defined(ANDROID_BUILD) {
picture_state := AndroidPictureWindowState()
picture_ready := (picture_state & 1) != 0 &&
practice_active(app) != null && app.session_paused == 0
// Keep processing callbacks throughout PiP entry. Waiting until the
// mode callback arrives can leave raylib blocked waiting for focus.
if picture_ready || (picture_state & 2) != 0 {
SetWindowState(FLAG_WINDOW_ALWAYS_RUN)
} else {
ClearWindowState(FLAG_WINDOW_ALWAYS_RUN)
}
}
requested_feature := TakeHostFeatureRequest()
if requested_feature >= 0 {
if app_open_feature(cast(*void)app, requested_feature) != 0 {
@@ -319,7 +336,9 @@ app_frame :: (app: *InnerBreeze) {
app.ui.manual_next = IsKeyPressed(KEY_RIGHT)
app.ui.manual_finish = IsKeyPressed(KEY_ENTER)
app.ui.manual_close = IsKeyPressed(KEY_BACK) || IsKeyPressed(KEY_ESCAPE)
app.ui.text_input_active = app_lumi_input_focused(app) || app.elist.input_focused != 0 ||
// Any focused Kryon text field or area counts, such as the Diary entry.
app.ui.text_input_active = TextInputFocused(app.ui.session) ||
app_lumi_input_focused(app) || app.elist.input_focused != 0 ||
app.habit_edit.focused != 0 ||
app.habit_edit.description_focused != 0 ||
app.profile_friend_input_focused != 0 ||
@@ -399,7 +418,10 @@ app_frame :: (app: *InnerBreeze) {
}
#if !#defined(ANDROID_BUILD) && !#defined(PLATFORM_WEB) {
app.ui.retained_target_active = false
if BeginRetainedFrame(width, height) {
// The detached SDL surface has its own presentation state. Draw the
// main window directly while it is open, avoiding failed framebuffer
// allocations on each animation frame.
if !app.session_window.detached && BeginRetainedFrame(width, height) {
app.ui.retained_target_active = true
if first_frame {
TraceLog(LOG_INFO, "APP PROBE: drawing begun")
@@ -457,7 +479,8 @@ app_frame :: (app: *InnerBreeze) {
practice_id, app.session_paused)
}
#if #defined(ANDROID_BUILD) {
active := app_lumi_input_focused(app) || app.elist.input_focused != 0 ||
active := TextInputFocused(app.ui.session) ||
app_lumi_input_focused(app) || app.elist.input_focused != 0 ||
app.habit_edit.focused != 0 ||
app.habit_edit.description_focused != 0 ||
app.profile_friend_input_focused != 0 ||
@@ -481,6 +504,7 @@ app_frame :: (app: *InnerBreeze) {
}
}
PumpSecondaryWindows()
UpdatePracticeWindow(app)
if app.ui.frame_target_changed {
SetTargetFPS(app.ui.frame_target_fps)
app.ui.frame_target_changed = false
+145
View File
@@ -0,0 +1,145 @@
// Presentation of the existing practice in an application-owned OS window.
#import, file "../app/app_types.zi";
#import, file "../core/types.zi";
#import, file "../app/session_window.zi";
#import, file "../app/session_window_view.zi";
#import, file "../app/session_screen.zi";
#import, file "../app/locale.zi";
#import, file "../app/metrics.zi";
#import, file "../practices/practice_registry.zi";
#import, file "secondary_window.zi";
#import, file "android/android_picture_window.zi";
#import "button_props"
#import "button_widget"
#import "control_props"
#import "drawing_props"
#import "geometry"
#import "layout"
#import "session"
using ButtonEmphasis;
#if !#defined(ANDROID_BUILD) && !#defined(PLATFORM_WEB) {
raylib :: #system_library "raylib";
RestoreWindow :: () #foreign raylib;
SetWindowFocused :: () #foreign raylib;
PracticeClearWindowState :: (flags: u32) #foreign raylib "ClearWindowState";
}
practice_window: SecondaryWindow;
practice_window_session: Session;
ClosePracticeWindow :: (app: *InnerBreeze) {
CloseSecondaryWindow(practice_window)
practice_window = SecondaryWindow.{}
CloseSecondarySession(practice_window_session)
practice_window_session = Session.{}
if app != null {
app.session_window.detached = false
}
}
FocusPracticeApp :: () {
#if !#defined(ANDROID_BUILD) && !#defined(PLATFORM_WEB) {
// Clear both flags immediately; RestoreWindow alone waits for a later
// SDL event, after the no-tray loop has already checked them.
PracticeClearWindowState(cast(u32)(128 + 512))
RestoreWindow()
SetWindowFocused()
}
}
UpdatePracticeWindow :: (app: *InnerBreeze) {
if app == null {
return
}
#if #defined(ANDROID_BUILD) {
// Turned off in Settings, a practice never floats over other apps.
active := practice_active(app) != null && app.session_paused == 0 &&
app.picture_in_picture_enabled != 0
AndroidPictureWindowUpdate(active, app.session_window.detach_requested)
app.session_window.detach_requested = false
} else {
#if #defined(NATIVE_WINDOW_HAVE_SDL) && !#defined(PLATFORM_WEB) {
app.session_window.system_available = true
if app.session_window.screen == ScreenStart {
ClosePracticeWindow(app)
app.session_window.detach_requested = false
return
}
if app.session_window.detach_requested {
app.session_window.detach_requested = false
if practice_window.handle == null {
// A normal movable, resizable window, kept above other apps.
practice_window = OpenSecondaryWindow("Inner Breeze", 24, 72,
260, 320, 2 + 8 + 32, StyleTokenColor("surface"), 1.0)
if practice_window.handle != null {
practice_window_session = SessionOpen()
if !SessionValid(practice_window_session) {
ClosePracticeWindow(app)
}
}
}
app.session_window.detached = practice_window.handle != null
}
if !app.session_window.detached {
return
}
if TakeSecondaryWindowClose(practice_window) {
ClosePracticeWindow(app)
FocusPracticeApp()
return
}
if !BeginSecondaryWindow(practice_window) {
ClosePracticeWindow(app)
return
}
width: s32
height: s32
GetSecondaryWindowSize(practice_window, *width, *height)
main_session := app.ui.session
app.ui.session = practice_window_session
if BeginSecondaryFrame(practice_window_session, width, height) {
bounds := Rectangle.{0.0, 0.0, cast(float32)width, cast(float32)height}
app_session_window_picture(app, app.session_window.screen, bounds, 40.0)
names: [3]string = .[LocaleText("session_attach_button"),
LocaleText("session_maximize_button"), LocaleText("close_button")]
icons: [3]string = .["S1.8rr:M4 4H20V20H4ZM11 11H18V18H11Z",
"S1.8rr:M14 5H19V10M10 19H5V14M19 5L13 11M5 19L11 13",
"S1.8rr:M6 6L18 18M18 6L6 18"]
for index: cast(s32)0..cast(s32)2 {
button: ButtonProps
button.id = SESSION_WINDOW_DETACH_ID + index
button.bounds = Rectangle.{cast(float32)(width - 114 + index * 36),
2.0, 36.0, 36.0}
button.label = names[index]
button.icon_only = true
button.icon_shape = icons[index]
button.emphasis = cast(ButtonEmphasis)ButtonEmphasisGhost
unused Button(practice_window_session, button)
}
EndSecondaryFrame(practice_window_session)
}
app.ui.session = main_session
if !EndSecondaryWindow(practice_window) {
ClosePracticeWindow(app)
return
}
if IsSecondaryWindowClicked(practice_window) {
x: s32
y: s32
GetSecondaryWindowClickPosition(practice_window, *x, *y)
ClosePracticeWindow(app)
FocusPracticeApp()
if y >= 2 && y < 38 && x >= width - 114 && x < width - 78 {
return
}
if y >= 2 && y < 38 && x >= width - 42 {
app.session_window.close_requested = true
} else {
app.session_window.restore_requested = true
}
}
}
}
}
+9 -1
View File
@@ -71,11 +71,19 @@ IsSecondaryWindowDragged :: (window: SecondaryWindow) -> bool {
return window.handle != null && app_secondary_window_dragged(window.handle)
}
TakeSecondaryWindowClose :: (window: SecondaryWindow) -> bool {
return window.handle != null && app_secondary_window_take_close(window.handle)
}
GetSecondaryWindowSize :: (window: SecondaryWindow, width: *s32, height: *s32) {
app_secondary_window_size(window.handle, width, height)
}
#program_export
SetSecondaryWindowKeyboardGrab :: (window: SecondaryWindow,
enabled: bool) -> bool {
return window.handle != null &&
app_secondary_window_keyboard_grab(window.handle, enabled)
app_secondary_window_keyboard_grab(window.handle, enabled)
}
#program_export
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff. Show more