Compare commits

...
29 Commits
Author SHA1 Message Date
waozi a1914a1415 add habits overview 2026-06-30 18:55:29 -03:00
waozi e9f95d8c89 update workflow 2026-06-29 13:39:42 -03:00
waozi 40a660249c fix locale string 2026-06-29 11:34:05 -03:00
waozi 14a270c7b6 refactor 2026-06-29 11:30:54 -03:00
waozi d39ea8fd4d improve friend sync 2026-06-29 11:05:54 -03:00
waozi 88818aea09 cleanup 2026-06-29 10:54:28 -03:00
waozi 3aec019348 update verson 2026-06-29 10:51:31 -03:00
waozi 8e01c0fa7d publish to amazon 2026-06-29 10:49:57 -03:00
waozi 5e98458257 fix android bug 2026-06-29 10:47:24 -03:00
waozi 1209e29078 fixes for modern android 2026-06-29 04:03:43 -03:00
waozi a3743c9b37 improve profile screen 2026-06-29 03:16:43 -03:00
waozi fe96b6c61e bug fixes 2026-06-29 03:06:17 -03:00
waozi eabbff2972 fix critical inset issue 2026-06-29 00:15:28 -03:00
waozi 157788fa5c improve habit management 2026-06-28 23:58:01 -03:00
waozi e89f63e382 improve my profile screen 2026-06-28 23:45:36 -03:00
waozi 1105b51c24 fix translations 2026-06-28 22:08:00 -03:00
waozi c9cf77d05a new version 2026-06-28 21:31:46 -03:00
waozi 8315898d00 Fix profile sync and leaderboard flow 2026-06-28 21:26:38 -03:00
waozi f61a9e9094 update web release for chrome 2026-06-28 12:01:24 -03:00
waozi f7cb61cf57 updated practic screen layout 2026-06-28 11:36:06 -03:00
waozi 407e4fa2a0 fix sync 2026-06-28 01:41:05 -03:00
waozi 7093dd1a51 Publish Chrome Web Store extension 2026-06-27 22:57:05 -03:00
waozi f78cd854c8 Use current Google Play upload track input 2026-06-27 19:42:51 -03:00
waozi 44725b5bf6 fix changelog 2026-06-27 18:55:59 -03:00
waozi 894552e1b6 update version 2026-06-27 18:55:11 -03:00
waozi 2695cf99a1 Update Flint vendor runtime paths 2026-06-27 18:39:48 -03:00
waozi 62317fa294 improved meditation practice 2026-06-27 18:15:36 -03:00
waozi b492e59c90 move liboqs account managemnt to flint 2026-06-27 16:14:13 -03:00
waozi 86e529db36 polish theme and translations 2026-06-27 15:37:08 -03:00
137 changed files with 9508 additions and 4643 deletions

No files matched your search

+172 -1
View File
@@ -393,7 +393,7 @@ jobs:
- name: Copy Android Assets
run: ./scripts/copy-android-assets.sh
- name: Build Android APK
- name: Build Android APK and AAB
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
@@ -405,7 +405,13 @@ jobs:
-Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
--stacktrace
./droid/gradlew -p droid bundleRelease \
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
-Pkeystore.alias="$KEY_ALIAS" \
-Pkeystore.password="$KEYSTORE_PASSWORD" \
--stacktrace
make android-copy-release-apks
make android-copy-bundle
- name: Collect Android Release Files
run: |
@@ -417,6 +423,12 @@ jobs:
exit 1
fi
cp "build/android/inbe-$VERSION.apk" build/release/android/
aab="$(find droid/app/build/outputs/bundle/release build/android -type f -name '*.aab' | head -n 1)"
if [ -z "$aab" ]; then
echo "No release AAB was produced"
exit 1
fi
cp "$aab" "build/release/android/inbe-$VERSION.aab"
- name: Upload Android Artifacts
uses: actions/upload-artifact@v4
@@ -557,3 +569,162 @@ jobs:
butler push "$android_apk" waozi/inbe:android --userversion "$VERSION"
butler push "$windows_zip" waozi/inbe:windows --userversion "$VERSION"
butler push "$linux_appimage" waozi/inbe:linux --userversion "$VERSION"
publish-google-play:
name: Publish Google Play Production
runs-on: ubuntu-latest
needs:
- build-android
- release
if: needs.release.outputs.tag_pushed == 'true'
steps:
- name: Check Google Play Secret
env:
PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }}
run: |
set -euo pipefail
if [ -z "${PLAY_STORE_JSON_KEY:-}" ]; then
echo "PLAY_STORE_JSON_KEY secret is required to publish Google Play"
exit 1
fi
- name: Download Android Release Artifact
uses: actions/download-artifact@v4
with:
name: release-android
path: build/release/android
- name: Publish AAB to Play Games on PC Production
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_JSON_KEY }}
packageName: xyz.waozi.inbe
releaseFiles: build/release/android/*.aab
tracks: google_play_games_pc:production
status: completed
publish-amazon:
name: Publish Amazon Appstore
runs-on: ubuntu-latest
needs:
- build-android
- release
if: needs.release.outputs.tag_pushed == 'true'
env:
AMAZON_CLIENT_ID: ${{ secrets.AMAZON_CLIENT_ID }}
AMAZON_CLIENT_SECRET: ${{ secrets.AMAZON_CLIENT_SECRET }}
AMAZON_APP_ID: ${{ secrets.AMAZON_APP_ID }}
steps:
- name: Check Amazon Appstore Secrets
run: |
set -euo pipefail
for name in AMAZON_CLIENT_ID AMAZON_CLIENT_SECRET AMAZON_APP_ID; do
if [ -z "${!name:-}" ]; then
echo "$name secret is required to publish Amazon Appstore"
exit 1
fi
done
- name: Download Android Release Artifact
uses: actions/download-artifact@v4
with:
name: release-android
path: build/release/android
- name: Upload APK to Amazon Appstore
uses: galonga/[email protected]
with:
clientId: ${{ env.AMAZON_CLIENT_ID }}
clientSecret: ${{ env.AMAZON_CLIENT_SECRET }}
appId: ${{ env.AMAZON_APP_ID }}
releaseFile: build/release/android/inbe-${{ needs.release.outputs.version }}.apk
publish-chrome-web-store:
name: Publish Chrome Web Store
runs-on: ubuntu-latest
needs:
- build-chrome-extension
- release
if: needs.release.outputs.tag_pushed == 'true'
steps:
- name: Check Chrome Web Store Secrets
env:
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
run: |
set -euo pipefail
if [ -z "${CHROME_CLIENT_ID:-}" ]; then
echo "CHROME_CLIENT_ID secret is required to publish Chrome Web Store"
exit 1
fi
if [ -z "${CHROME_CLIENT_SECRET:-}" ]; then
echo "CHROME_CLIENT_SECRET secret is required to publish Chrome Web Store"
exit 1
fi
if [ -z "${CHROME_REFRESH_TOKEN:-}" ]; then
echo "CHROME_REFRESH_TOKEN secret is required to publish Chrome Web Store"
exit 1
fi
- name: Download Chrome Extension Artifact
uses: actions/download-artifact@v4
with:
name: release-chrome-web-store
path: build/release/chrome-web-store
- name: Publish Chrome Extension
env:
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
CHROME_EXTENSION_ID: lballhghblaenelehneigekpofgcaifa
CHROME_EXTENSION_ZIP: build/release/chrome-web-store/inbe-chrome-web-store.zip
run: |
set -euo pipefail
token_response="$(curl --fail --silent --show-error \
--request POST \
--data-urlencode "client_id=${CHROME_CLIENT_ID}" \
--data-urlencode "client_secret=${CHROME_CLIENT_SECRET}" \
--data-urlencode "refresh_token=${CHROME_REFRESH_TOKEN}" \
--data-urlencode "grant_type=refresh_token" \
https://oauth2.googleapis.com/token)"
access_token="$(python3 -c 'import json, sys; print(json.load(sys.stdin)["access_token"])' <<< "$token_response")"
upload_response="$(curl --fail --silent --show-error \
--request PUT \
--header "Authorization: Bearer ${access_token}" \
--header "x-goog-api-version: 2" \
--upload-file "${CHROME_EXTENSION_ZIP}" \
"https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_EXTENSION_ID}")"
python3 - "$upload_response" <<'PY'
import json
import sys
response = json.loads(sys.argv[1])
if response.get("uploadState") != "SUCCESS":
print(json.dumps(response, indent=2), file=sys.stderr)
raise SystemExit("Chrome Web Store upload failed")
PY
publish_response="$(curl --fail --silent --show-error \
--request POST \
--header "Authorization: Bearer ${access_token}" \
--header "x-goog-api-version: 2" \
"https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_EXTENSION_ID}/publish")"
python3 - "$publish_response" <<'PY'
import json
import sys
response = json.loads(sys.argv[1])
if "OK" not in response.get("status", []):
print(json.dumps(response, indent=2), file=sys.stderr)
raise SystemExit("Chrome Web Store publish failed")
PY
-6
View File
@@ -4,12 +4,6 @@
[submodule "vendor/sqlite"]
path = vendor/sqlite
url = https://github.com/sqlite/sqlite
[submodule "vendor/liboqs"]
path = vendor/liboqs
url = https://github.com/open-quantum-safe/liboqs.git
[submodule "vendor/curl"]
path = vendor/curl
url = https://github.com/curl/curl.git
[submodule "vendor/flint"]
path = vendor/flint
url = [email protected]:waozixyz/flint.git
+65 -2
View File
@@ -1,10 +1,73 @@
# Changelog
## [1.7.6] - 2026-06-30
### Added
- habit overview
## [1.7.5] - 2026-06-29
### Fixed
- Fix Android 15 relaunch freeze.
- Code cleanup
## [1.7.4] - 2026-06-29
### Fixed
- Clean up practice stats, friend removal, sync review, and Android inset handling.
## [1.7.3] - 2026-06-29
### Fixed
- bottom inset in practice
### Changed
- Improve habit management
## [1.7.2] - 2026-06-29
### Added
- Add local `make install` target.
- Add Profile controls for habit ordering and practice visibility.
### Changed
- Move sync status into the Data view and simplify the habits add option.
- Clean up the README.
## [1.7.1] - 2026-06-28
### Changed
- Move shared Lyra sync protocol code into Flint and simplify Inbe sync client wiring.
## [1.7.0] - 2026-06-28
### Changed
- Rework Android safe-area handling to use one native inset path with stable bottom navigation spacing.
- Move leaderboard stats to synced source data, with local current-user rows shown immediately.
### Fixed
- Fix profile/friend sync freshness, leaderboard empty states, modal input capture, pet asset embedding, and wrapped text previews.
## [1.6.6] - 2026-06-28
### Changed
- updated the practice screen ui/ux
## [1.6.5] - 2026-06-28
### Fixed
- Repair habit-day sync for zero-count completions.
- Require liboqs at build time for every sync-enabled target.
## [1.6.4] - 2026-06-27
### Changed
- Move meditation duration selection into practice configuration with custom time support.
- Add centered in-session meditation add-time controls.
- Use Flint-managed liboqs, LibreSSL, and curl build paths.
### Fixed
- Fix Android native build to use Flint's liboqs submodule.
## [1.6.3] - 2026-06-27
### Changed
- Improve theme, habit, and localization UI polish
## [1.6.2] - 2026-06-27
## Changed
### Changed
- Improve sun salutation
## [1.6.1] - 2026-06-27
## Changed
### Changed
- Improved notification in session
- Standardized settings screen1
+151 -111
View File
@@ -47,6 +47,9 @@ CLICK_BIN := $(CLICK_BIN_DIR)/$(APP_NAME)
CLICK_BIN_INPUT := $(if $(strip $(CLICK_BIN_SOURCE)),$(CLICK_BIN_SOURCE),$(CLICK_BIN))
CLICK_RAYLIB_BUILD_DIR := $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/raylib
CLICK_RAYLIB_A := $(CLICK_RAYLIB_BUILD_DIR)/libraylib.a
CLICK_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/liboqs
CLICK_LIBOQS_A := $(CLICK_LIBOQS_BUILD_DIR)/lib/liboqs.a
CLICK_LIBOQS_INCLUDE := -I$(CLICK_LIBOQS_BUILD_DIR)/include
CLICK_PATCHELF_INTERPRETER ?= /lib/ld-linux-aarch64.so.1
CLICK_RUNTIME_LIBS ?= $(AARCH64_CLICK_RUNTIME_LIBS)
WINDOWS_OBJ_DIR := $(BUILD_OBJ_DIR)/windows
@@ -70,6 +73,7 @@ WIN64_CC ?= $(or $(WIN_CC),x86_64-w64-mingw32-gcc)
WIN64_AR ?= $(or $(WIN_AR),x86_64-w64-mingw32-ar)
WIN64_RANLIB ?= $(or $(WIN_RANLIB),x86_64-w64-mingw32-ranlib)
WIN64_STRIP ?= $(or $(WIN_STRIP),x86_64-w64-mingw32-strip)
WIN64_CMAKE_SYSTEM_PROCESSOR ?= x86_64
WIN64_CC_PATH := $(shell command -v $(WIN64_CC) 2>/dev/null || printf '%s' $(WIN64_CC))
WIN64_AR_PATH := $(shell command -v $(WIN64_AR) 2>/dev/null || printf '%s' $(WIN64_AR))
WIN64_RANLIB_PATH := $(shell command -v $(WIN64_RANLIB) 2>/dev/null || printf '%s' $(WIN64_RANLIB))
@@ -78,6 +82,7 @@ WIN32_CC ?= i686-w64-mingw32-gcc
WIN32_AR ?= i686-w64-mingw32-ar
WIN32_RANLIB ?= i686-w64-mingw32-ranlib
WIN32_STRIP ?= i686-w64-mingw32-strip
WIN32_CMAKE_SYSTEM_PROCESSOR ?= x86
WIN32_CC_PATH := $(shell command -v $(WIN32_CC) 2>/dev/null || printf '%s' $(WIN32_CC))
WIN32_AR_PATH := $(shell command -v $(WIN32_AR) 2>/dev/null || printf '%s' $(WIN32_AR))
WIN32_RANLIB_PATH := $(shell command -v $(WIN32_RANLIB) 2>/dev/null || printf '%s' $(WIN32_RANLIB))
@@ -88,9 +93,15 @@ WIN32_RAYLIB_A := $(WIN32_RAYLIB_BUILD_DIR)/libraylib.a
WIN64_CURL_BUILD_DIR := $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/curl
WIN64_CURL_INCLUDE_DIR := $(WIN64_CURL_BUILD_DIR)/include
WIN64_CURL_A := $(WIN64_CURL_BUILD_DIR)/lib/libcurl.a
WIN64_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/liboqs
WIN64_LIBOQS_A := $(WIN64_LIBOQS_BUILD_DIR)/lib/liboqs.a
WIN64_LIBOQS_INCLUDE := -I$(WIN64_LIBOQS_BUILD_DIR)/include
WIN32_CURL_BUILD_DIR := $(VENDOR_BUILD_DIR)/windows/$(WIN32_ARCH)/curl
WIN32_CURL_INCLUDE_DIR := $(WIN32_CURL_BUILD_DIR)/include
WIN32_CURL_A := $(WIN32_CURL_BUILD_DIR)/lib/libcurl.a
WIN32_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/windows/$(WIN32_ARCH)/liboqs
WIN32_LIBOQS_A := $(WIN32_LIBOQS_BUILD_DIR)/lib/liboqs.a
WIN32_LIBOQS_INCLUDE := -I$(WIN32_LIBOQS_BUILD_DIR)/include
WEB_RAYLIB_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/raylib
WEB_RAYLIB_A := $(WEB_RAYLIB_BUILD_DIR)/libraylib.web.a
RAYLIB_SOURCES := $(shell find $(RAYLIB_DIR) -type f \( -name '*.c' -o -name '*.h' \))
@@ -102,22 +113,37 @@ FLINT_SRCS := $(filter-out $(FLINT_ICON_ASSETS_C),$(wildcard $(FLINT_DIR)/src/*.
FLINT_WEB_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
FLINT_WINDOWS_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
FLINT_INCLUDE := -I$(FLINT_DIR)/include
CURL_DIR := vendor/curl
CURL_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)/curl
CURL_INCLUDE_DIR := $(CURL_BUILD_DIR)/include
CURL_LIB_DIR := $(CURL_BUILD_DIR)/lib64
CURL_SO := $(CURL_LIB_DIR)/libcurl.so
CURL_PROTOCOL_CHECK := $(CURL_BUILD_DIR)/.protocols-ok
OPENSSL_ROOT_DIR ?= $(shell pkg-config --variable=prefix openssl 2>/dev/null)
OPENSSL_CMAKE_OPT := $(if $(strip $(OPENSSL_ROOT_DIR)),-DOPENSSL_ROOT_DIR=$(OPENSSL_ROOT_DIR),)
OPENSSL_INCLUDE_CMAKE_OPT := $(if $(strip $(OPENSSL_INCLUDE_DIR)),-DOPENSSL_INCLUDE_DIR=$(OPENSSL_INCLUDE_DIR),)
OPENSSL_SSL_CMAKE_OPT := $(if $(strip $(OPENSSL_SSL_LIBRARY)),-DOPENSSL_SSL_LIBRARY=$(OPENSSL_SSL_LIBRARY),)
OPENSSL_CRYPTO_CMAKE_OPT := $(if $(strip $(OPENSSL_CRYPTO_LIBRARY)),-DOPENSSL_CRYPTO_LIBRARY=$(OPENSSL_CRYPTO_LIBRARY),)
OPENSSL_LIB_DIR := $(patsubst %/,%,$(dir $(OPENSSL_SSL_LIBRARY)))
OPENSSL_LDLIBS := $(if $(strip $(OPENSSL_SSL_LIBRARY) $(OPENSSL_CRYPTO_LIBRARY)),-Xlinker -rpath -Xlinker $(OPENSSL_LIB_DIR) $(OPENSSL_SSL_LIBRARY) $(OPENSSL_CRYPTO_LIBRARY),$(or $(shell pkg-config --libs openssl 2>/dev/null),-lssl -lcrypto))
FLINT_CURL_CFLAGS := -I$(CURL_INCLUDE_DIR)
FLINT_CURL_LDLIBS := -L$(CURL_LIB_DIR) -Wl,-rpath,$(abspath $(CURL_LIB_DIR)) -lcurl $(OPENSSL_LDLIBS)
FLINT_CURL_VERSION_NUM ?= $(shell printf '%s\n' '#include <curl/curlver.h>' 'LIBCURL_VERSION_NUM' | $(CC) -I$(CURL_DIR)/include -E -P - 2>/dev/null | tail -n 1)
FLINT_VENDOR_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)
FLINT_LIBOQS_BUILD_DIR := $(FLINT_VENDOR_BUILD_DIR)/liboqs
FLINT_WEB_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/liboqs
FLINT_CURL_BUILD_DIR := $(FLINT_VENDOR_BUILD_DIR)/curl
FLINT_CURL_REQUIRE_WEBSOCKETS := 1
FLINT_CURL_EXTRA_CMAKE_FLAGS := \
-DCURL_DISABLE_WEBSOCKETS=OFF \
-DCURL_DISABLE_INSTALL=OFF \
-DCURL_DISABLE_DICT=ON \
-DCURL_DISABLE_FILE=ON \
-DCURL_DISABLE_FTP=ON \
-DCURL_DISABLE_GOPHER=ON \
-DCURL_DISABLE_IMAP=ON \
-DCURL_DISABLE_MQTT=ON \
-DCURL_DISABLE_POP3=ON \
-DCURL_DISABLE_RTSP=ON \
-DCURL_DISABLE_SMTP=ON \
-DCURL_DISABLE_TELNET=ON \
-DCURL_DISABLE_TFTP=ON \
-DCURL_DISABLE_LIBCURL_OPTION=ON \
-DCURL_ZLIB=OFF \
-DCURL_BROTLI=OFF \
-DCURL_ZSTD=OFF
include $(FLINT_DIR)/mk/vendor.mk
CURL_DIR := $(FLINT_CURL_DIR)
CURL_BUILD_DIR := $(FLINT_CURL_BUILD_DIR)
CURL_INCLUDE_DIR := $(FLINT_CURL_INCLUDE_DIR)
CURL_LIB_DIR := $(FLINT_CURL_LIB_DIR)
CURL_SO := $(FLINT_CURL_SO)
CURL_PROTOCOL_CHECK := $(FLINT_CURL_PROTOCOL_CHECK)
FLINT_CURL_VERSION_NUM ?= $(shell printf '%s\n' '#include <curl/curlver.h>' 'LIBCURL_VERSION_NUM' | $(CC) -I$(FLINT_CURL_DIR)/include -E -P - 2>/dev/null | tail -n 1)
FLINT_CURL_VERSION_HEX := $(patsubst 0x%,%,$(FLINT_CURL_VERSION_NUM))
SQLITE_DIR := vendor/sqlite
SQLITE_BUILD_DIR := $(VENDOR_BUILD_DIR)/sqlite
@@ -125,12 +151,12 @@ SQLITE_AMALGAMATION_C := $(SQLITE_BUILD_DIR)/sqlite3.c
SQLITE_AMALGAMATION_H := $(SQLITE_BUILD_DIR)/sqlite3.h
SQLITE_SRC := $(SQLITE_AMALGAMATION_C)
SQLITE_INCLUDE := -I$(SQLITE_BUILD_DIR)
LIBOQS_DIR := vendor/liboqs
LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/linux/$(ARCH)/liboqs
LIBOQS_A := $(LIBOQS_BUILD_DIR)/lib/liboqs.a
LIBOQS_INCLUDE := -I$(LIBOQS_BUILD_DIR)/include
WEB_LIBOQS_BUILD_DIR := $(VENDOR_BUILD_DIR)/web/liboqs
WEB_LIBOQS_A := $(WEB_LIBOQS_BUILD_DIR)/lib/liboqs.a
LIBOQS_DIR := $(FLINT_LIBOQS_DIR)
LIBOQS_BUILD_DIR := $(FLINT_LIBOQS_BUILD_DIR)
LIBOQS_A := $(FLINT_LIBOQS_A)
LIBOQS_INCLUDE := $(FLINT_LIBOQS_INCLUDE)
WEB_LIBOQS_BUILD_DIR := $(FLINT_WEB_LIBOQS_BUILD_DIR)
WEB_LIBOQS_A := $(FLINT_WEB_LIBOQS_A)
WEB_LIBOQS_INCLUDE := -I$(WEB_LIBOQS_BUILD_DIR)/include
TEST_BIN_DIR := $(BUILD_BIN_DIR)/tests
STORAGE_IMPORT_TEST := $(TEST_BIN_DIR)/storage_import_test
@@ -146,8 +172,10 @@ FLINT_RUNTIME_ASSET_LDLIBS := $(FLINT_CURL_LDLIBS)
APP_SRCS := \
src/main.c \
src/app/app_sync.c \
src/core/breath_engine.c \
src/app/app.c \
src/app/app_nav.c \
src/app/app_settings.c \
src/app/device_preferences.c \
src/practices/practice_registry.c \
@@ -165,11 +193,15 @@ APP_SRCS := \
src/screens/statistics_screen.c \
src/screens/habits/edit.c \
src/screens/habits/session.c \
src/screens/profile_screen.c \
src/screens/profile_social.c \
src/screens/pet_screen.c \
src/practices/meditation/meditation_music.c \
src/storage/data.c \
src/storage/db.c \
src/storage/import.c \
src/storage/storage.c \
src/storage/storage_sessions.c \
src/storage/sync_review.c \
src/storage/sync_account.c \
src/storage/sync_client.c \
@@ -179,14 +211,16 @@ APP_SRCS := \
src/screens/language_screen.c \
src/screens/manual_screen.c \
src/screens/settings/settings_screen.c \
src/screens/settings/settings_ui.c \
src/screens/settings/settings_device.c \
src/screens/settings/settings_session.c \
src/screens/settings/settings_theme.c \
src/screens/settings/settings_about.c \
src/screens/settings/settings_data.c \
src/screens/settings/settings_sync_account.c
LOCALE_FILES := $(wildcard locales/*.txt)
IMAGE_FILES := assets/practices/whm/1.jpg assets/practices/whm/2.jpg assets/practices/meditation/1.jpg $(wildcard assets/practices/sunsalutation/pos_*.png)
IMAGE_FILES := assets/practices/whm/1.jpg assets/practices/whm/2.jpg assets/practices/meditation/1.jpg assets/pet/egg1.png $(wildcard assets/practices/sunsalutation/pos_*.png)
SOUND_FILES := $(wildcard assets/sounds/*.ogg)
FONT_OUTPUTS := assets/fonts/locales.png assets/fonts/locales.dat
OTFCHOP_DIR ?= $(FLINT_DIR)/tools/otfchop
@@ -247,13 +281,27 @@ UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
UNPACKAGED_AUDIO_FILES := $(shell find $(UNPACKAGED_AUDIO_DIR) -type f 2>/dev/null)
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
.PHONY: all native run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-debug-fast android-release android-bundle android-install android-install-fast android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web site chrome-web-store
.PHONY: all native install run run-fresh screenshot test dist appimage click click-verify vendor-prebuilds vendor-prebuilds-native vendor-prebuilds-web vendor-prebuilds-windows clean clean-linux clean-vendor-builds android-avd android-check-keystore android-copy-assets android-local-properties android-debug android-debug-fast android-release android-bundle android-install android-install-fast android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web site chrome-web-store
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle click
all: native
native: $(TARGET)
install: $(TARGET)
@install_dir="$(HOME)/.local/lib/$(APP_NAME)"; \
bin_dir="$(HOME)/.local/bin"; \
mkdir -p "$$install_dir" "$$bin_dir"; \
cp "$(TARGET)" "$$install_dir/$(APP_NAME)"; \
chmod 755 "$$install_dir/$(APP_NAME)"; \
ln -sf "$$install_dir/$(APP_NAME)" "$$bin_dir/$(APP_NAME)"; \
if [ -d "$(HOME)/bin" ]; then \
ln -sf "$$install_dir/$(APP_NAME)" "$(HOME)/bin/$(APP_NAME)"; \
echo "Installed $(APP_NAME) to $$install_dir and linked $$bin_dir/$(APP_NAME), $(HOME)/bin/$(APP_NAME)"; \
else \
echo "Installed $(APP_NAME) to $$install_dir and linked $$bin_dir/$(APP_NAME)"; \
fi
dist:
@password="$(PASSWORD)"; \
if [ -z "$$password" ]; then \
@@ -294,7 +342,7 @@ vendor-prebuilds-native: $(RAYLIB_A) $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMAT
vendor-prebuilds-web: $(WEB_RAYLIB_A) $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H) $(WEB_LIBOQS_A)
vendor-prebuilds-windows: $(WIN64_RAYLIB_A) $(WIN32_RAYLIB_A) $(WIN64_CURL_A) $(WIN32_CURL_A) $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H)
vendor-prebuilds-windows: $(WIN64_RAYLIB_A) $(WIN32_RAYLIB_A) $(WIN64_CURL_A) $(WIN32_CURL_A) $(WIN64_LIBOQS_A) $(WIN32_LIBOQS_A) $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H)
run: $(TARGET)
./$(TARGET)
@@ -335,11 +383,11 @@ test: $(TESTS)
fi; \
exit "$$status"
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/screens/habits_screen.h src/screens/habits/habits.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/screens/habits_screen.h src/screens/habits/habits.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party -I$(RAYLIB_DIR) $(FLINT_INCLUDE) $(SQLITE_INCLUDE) \
-o $@ \
tests/storage_import_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/third_party/miniz.c $(SQLITE_SRC) \
tests/storage_import_test.c src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/screens/habits_screen.c src/screens/habits/edit.c src/screens/habits/session.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
$(LOCALE_KEYS_TEST): tests/locale_keys_test.c $(LOCALE_FILES) | $(TEST_BIN_DIR)
@@ -347,24 +395,24 @@ $(LOCALE_KEYS_TEST): tests/locale_keys_test.c $(LOCALE_FILES) | $(TEST_BIN_DIR)
-o $@ \
tests/locale_keys_test.c
$(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sync_client.h $(CURL_PROTOCOL_CHECK) | $(TEST_BIN_DIR)
$(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sync_client.h $(FLINT_DIR)/src/flint_lyra_sync.c $(FLINT_DIR)/src/flint_lyra_account.c $(CURL_PROTOCOL_CHECK) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -Wno-unused-function -std=c99 -D_DEFAULT_SOURCE -DINBE_SYNC_CLIENT_TESTS -ffunction-sections -fdata-sections \
-Isrc/storage -Isrc -Isrc/core $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(FLINT_CURL_CFLAGS) -o $@ \
tests/sync_url_test.c src/storage/sync_client.c \
tests/sync_url_test.c src/storage/sync_client.c $(FLINT_DIR)/src/flint_lyra_sync.c $(FLINT_DIR)/src/flint_lyra_account.c \
-Wl,--gc-sections $(FLINT_CURL_LDLIBS)
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
$(SYNC_ACCOUNT_TEST): tests/sync_account_test.c src/storage/sync_account.c src/storage/sync_account.h $(FLINT_DIR)/src/flint_lyra_account.c $(FLINT_DIR)/include/flint_lyra_account.h src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(LIBOQS_A) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -DFLINT_HAS_LIBOQS=1 -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) $(LIBOQS_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
-o $@ \
tests/sync_account_test.c src/storage/sync_account.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
tests/sync_account_test.c src/storage/sync_account.c $(FLINT_DIR)/src/flint_lyra_account.c src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
$(LIBOQS_A) -Wl,--gc-sections -lm -lpthread -ldl
$(SYNC_REVIEW_TEST): tests/sync_review_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(SYNC_REVIEW_TEST): tests/sync_review_test.c src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/storage/storage.h src/storage/db.h src/storage/import.h src/third_party/miniz.c src/third_party/miniz.h $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) | $(TEST_BIN_DIR)
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
-Isrc -Isrc/app -Isrc/core -Isrc/screens -Isrc/screens/settings -Isrc/practices -Isrc/practices/whm -Isrc/practices/meditation -Isrc/storage -Isrc/platform/android -Isrc/third_party $(FLINT_INCLUDE) -I$(RAYLIB_DIR) $(SQLITE_INCLUDE) \
-o $@ \
tests/sync_review_test.c src/storage/storage.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
tests/sync_review_test.c src/storage/storage.c src/storage/storage_sessions.c src/storage/sync_review.c src/storage/db.c src/storage/import.c src/third_party/miniz.c $(SQLITE_SRC) \
-Wl,--gc-sections -lm -lpthread -ldl
$(FONT_LOCALE_TEST): tests/font_locale_test.c $(FONT_OUTPUTS) | $(TEST_BIN_DIR)
@@ -453,6 +501,23 @@ $(CLICK_RAYLIB_A): $(RAYLIB_SOURCES)
SDL_LIBRARIES="$(AARCH64_RAY_SDL_LDLIBS)" \
CUSTOM_CFLAGS="-DUSING_SDL2_PROJECT $(AARCH64_RAY_CFLAGS) $(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
$(CLICK_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt
rm -rf $(CLICK_LIBOQS_BUILD_DIR)
$(CMAKE) -S $(LIBOQS_DIR) -B $(CLICK_LIBOQS_BUILD_DIR) \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=$(AARCH64_CC) \
-DCMAKE_AR=$(AARCH64_AR) \
-DCMAKE_RANLIB=$(AARCH64_RANLIB) \
-DCMAKE_BUILD_TYPE=$(FLINT_LIBOQS_BUILD_TYPE) \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_DIST_BUILD=OFF \
-DOQS_OPT_TARGET=generic \
-DOQS_MINIMAL_BUILD=$(FLINT_LIBOQS_MINIMAL_BUILD)
$(CMAKE) --build $(CLICK_LIBOQS_BUILD_DIR) --target oqs
$(WIN64_RAYLIB_A): $(RAYLIB_SOURCES)
rm -rf $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/raylib-src
mkdir -p $(VENDOR_BUILD_DIR)/windows/$(WIN64_ARCH)/raylib-src $(WIN64_RAYLIB_BUILD_DIR)
@@ -492,76 +557,6 @@ $(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H): $(SQLITE_DIR)/configure $(SQL
cd $(SQLITE_BUILD_DIR) && $(abspath $(SQLITE_DIR))/configure
$(MAKE) -C $(SQLITE_BUILD_DIR) sqlite3.c sqlite3.h
$(LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt | $(BUILD_OBJ_DIR)
$(CMAKE) -S $(LIBOQS_DIR) -B $(LIBOQS_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44
$(CMAKE) --build $(LIBOQS_BUILD_DIR) --target oqs
$(WEB_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt | $(BUILD_OBJ_DIR)
emcmake $(CMAKE) -S $(LIBOQS_DIR) -B $(WEB_LIBOQS_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_DIST_BUILD=OFF \
-DOQS_OPT_TARGET=generic \
-DOQS_MINIMAL_BUILD=SIG_ml_dsa_44
$(CMAKE) --build $(WEB_LIBOQS_BUILD_DIR) --target oqs
$(CURL_SO): $(CURL_DIR)/CMakeLists.txt
$(CMAKE) -S $(CURL_DIR) -B $(CURL_BUILD_DIR) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=$(abspath $(CURL_BUILD_DIR)) \
-DCMAKE_INSTALL_LIBDIR=lib64 \
-DBUILD_CURL_EXE=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCURL_USE_OPENSSL=ON \
$(OPENSSL_CMAKE_OPT) \
$(OPENSSL_INCLUDE_CMAKE_OPT) \
$(OPENSSL_SSL_CMAKE_OPT) \
$(OPENSSL_CRYPTO_CMAKE_OPT) \
-DCURL_DISABLE_WEBSOCKETS=OFF \
-DCURL_DISABLE_INSTALL=OFF \
-DCURL_DISABLE_LDAP=ON \
-DCURL_DISABLE_LDAPS=ON \
-DCURL_DISABLE_DICT=ON \
-DCURL_DISABLE_FILE=ON \
-DCURL_DISABLE_FTP=ON \
-DCURL_DISABLE_GOPHER=ON \
-DCURL_DISABLE_IMAP=ON \
-DCURL_DISABLE_MQTT=ON \
-DCURL_DISABLE_POP3=ON \
-DCURL_DISABLE_RTSP=ON \
-DCURL_DISABLE_SMB=ON \
-DCURL_DISABLE_SMTP=ON \
-DCURL_DISABLE_TELNET=ON \
-DCURL_DISABLE_TFTP=ON \
-DCURL_DISABLE_LIBCURL_OPTION=ON \
-DCURL_ZLIB=OFF \
-DCURL_BROTLI=OFF \
-DCURL_ZSTD=OFF \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_GSSAPI=OFF \
-DUSE_NGHTTP2=OFF \
-DUSE_LIBIDN2=OFF \
-DENABLE_CURL_MANUAL=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_LIBCURL_DOCS=OFF \
-DBUILD_MISC_DOCS=OFF \
-DBUILD_TESTING=OFF
$(CMAKE) --build $(CURL_BUILD_DIR) --target install
$(CURL_PROTOCOL_CHECK): $(CURL_SO)
@$(CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WS([[:space:]]|$$)' || { echo "vendored libcurl was built without WS protocol support"; exit 1; }
@$(CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WSS([[:space:]]|$$)' || { echo "vendored libcurl was built without WSS protocol support"; exit 1; }
@touch $@
$(WIN64_CURL_A): $(CURL_DIR)/CMakeLists.txt
rm -rf $(WIN64_CURL_BUILD_DIR)
$(CMAKE) -S $(CURL_DIR) -B $(WIN64_CURL_BUILD_DIR) \
@@ -593,6 +588,24 @@ $(WIN64_CURL_A): $(CURL_DIR)/CMakeLists.txt
-DBUILD_TESTING=OFF
$(CMAKE) --build $(WIN64_CURL_BUILD_DIR) --target install
$(WIN64_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt
rm -rf $(WIN64_LIBOQS_BUILD_DIR)
$(CMAKE) -S $(LIBOQS_DIR) -B $(WIN64_LIBOQS_BUILD_DIR) \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_SYSTEM_PROCESSOR=$(WIN64_CMAKE_SYSTEM_PROCESSOR) \
-DCMAKE_C_COMPILER=$(WIN64_CC_PATH) \
-DCMAKE_AR=$(WIN64_AR_PATH) \
-DCMAKE_RANLIB=$(WIN64_RANLIB_PATH) \
-DCMAKE_EXE_LINKER_FLAGS="$(WIN64_THREAD_LDFLAGS)" \
-DCMAKE_BUILD_TYPE=$(FLINT_LIBOQS_BUILD_TYPE) \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_DIST_BUILD=OFF \
-DOQS_OPT_TARGET=generic \
-DOQS_MINIMAL_BUILD=$(FLINT_LIBOQS_MINIMAL_BUILD)
$(CMAKE) --build $(WIN64_LIBOQS_BUILD_DIR) --target oqs
$(WIN32_CURL_A): $(CURL_DIR)/CMakeLists.txt
rm -rf $(WIN32_CURL_BUILD_DIR)
$(CMAKE) -S $(CURL_DIR) -B $(WIN32_CURL_BUILD_DIR) \
@@ -624,6 +637,24 @@ $(WIN32_CURL_A): $(CURL_DIR)/CMakeLists.txt
-DBUILD_TESTING=OFF
$(CMAKE) --build $(WIN32_CURL_BUILD_DIR) --target install
$(WIN32_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt
rm -rf $(WIN32_LIBOQS_BUILD_DIR)
$(CMAKE) -S $(LIBOQS_DIR) -B $(WIN32_LIBOQS_BUILD_DIR) \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_SYSTEM_PROCESSOR=$(WIN32_CMAKE_SYSTEM_PROCESSOR) \
-DCMAKE_C_COMPILER=$(WIN32_CC_PATH) \
-DCMAKE_AR=$(WIN32_AR_PATH) \
-DCMAKE_RANLIB=$(WIN32_RANLIB_PATH) \
-DCMAKE_EXE_LINKER_FLAGS="$(WIN32_THREAD_LDFLAGS)" \
-DCMAKE_BUILD_TYPE=$(FLINT_LIBOQS_BUILD_TYPE) \
-DBUILD_SHARED_LIBS=OFF \
-DOQS_BUILD_ONLY_LIB=ON \
-DOQS_USE_OPENSSL=OFF \
-DOQS_DIST_BUILD=OFF \
-DOQS_OPT_TARGET=generic \
-DOQS_MINIMAL_BUILD=$(FLINT_LIBOQS_MINIMAL_BUILD)
$(CMAKE) --build $(WIN32_LIBOQS_BUILD_DIR) --target oqs
$(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(RAYLIB_A) $(LIBOQS_A) $(CURL_PROTOCOL_CHECK) | $(LINUX_BIN_DIR)
$(CC) $(CFLAGS) \
$(APP_INCLUDE) \
@@ -632,7 +663,7 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQL
$(LIBOQS_INCLUDE) \
-I$(RAYLIB_DIR) \
$(RAY_CFLAGS) \
-DINBE_HAS_LIBOQS=1 \
-DFLINT_HAS_LIBOQS=1 \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
-DSUPPORT_FILEFORMAT_MP3=0 \
@@ -647,13 +678,15 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQL
-lm -lpthread -ldl -lrt \
$(LDFLAGS)
$(CLICK_BIN): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(CLICK_RAYLIB_A) | $(CLICK_BIN_DIR)
$(CLICK_BIN): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(CLICK_RAYLIB_A) $(CLICK_LIBOQS_A) | $(CLICK_BIN_DIR)
$(AARCH64_CC) $(CLICK_CFLAGS) \
$(APP_INCLUDE) \
$(FLINT_INCLUDE) \
$(SQLITE_INCLUDE) \
$(CLICK_LIBOQS_INCLUDE) \
-I$(RAYLIB_DIR) \
$(AARCH64_RAY_CFLAGS) \
-DFLINT_HAS_LIBOQS=1 \
-DPLATFORM_DESKTOP \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
@@ -663,6 +696,7 @@ $(CLICK_BIN): Makefile $(SRC) $(FLINT_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(
$(FLINT_SRCS) \
$(SQLITE_SRC) \
$(CLICK_RAYLIB_A) \
$(CLICK_LIBOQS_A) \
$(AARCH64_RAY_LDLIBS) \
$(AARCH64_FLINT_CURL_LDLIBS) \
-lm -lpthread -ldl -lrt \
@@ -703,13 +737,15 @@ $(CLICK_TARGET): $(CLICK_BIN_INPUT) $(CLICK_MANIFEST_TEMPLATE) $(CLICK_CONTROL_T
cp $(LINUX_APPIMAGE_ICON) $(CLICK_ROOT)/usr/share/icons/hicolor/512x512/apps/inbe.png
cd $(CLICK_ROOT) && zip -qr $(abspath $@) .
$(WIN64_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN64_RAYLIB_A) $(WIN64_CURL_A) | $(WINDOWS_BIN_DIR)/$(WIN64_ARCH)
$(WIN64_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN64_RAYLIB_A) $(WIN64_CURL_A) $(WIN64_LIBOQS_A) | $(WINDOWS_BIN_DIR)/$(WIN64_ARCH)
$(WIN64_CC) $(WINDOWS_CFLAGS) \
$(APP_INCLUDE) \
$(FLINT_INCLUDE) \
$(SQLITE_INCLUDE) \
$(WIN64_LIBOQS_INCLUDE) \
-I$(WIN64_CURL_INCLUDE_DIR) \
-I$(RAYLIB_DIR) \
-DFLINT_HAS_LIBOQS=1 \
-DPLATFORM_DESKTOP \
-DCURL_STATICLIB \
-o $@ \
@@ -718,18 +754,21 @@ $(WIN64_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQL
$(SQLITE_SRC) \
$(WIN64_RAYLIB_A) \
$(WIN64_CURL_A) \
$(WIN64_LIBOQS_A) \
$(WINDOWS_LDLIBS) \
$(WIN64_THREAD_LDFLAGS) \
$(WINDOWS_LDFLAGS)
$(WIN64_STRIP) $@
$(WIN32_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN32_RAYLIB_A) $(WIN32_CURL_A) | $(WINDOWS_BIN_DIR)/$(WIN32_ARCH)
$(WIN32_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WIN32_RAYLIB_A) $(WIN32_CURL_A) $(WIN32_LIBOQS_A) | $(WINDOWS_BIN_DIR)/$(WIN32_ARCH)
$(WIN32_CC) $(WINDOWS_CFLAGS) \
$(APP_INCLUDE) \
$(FLINT_INCLUDE) \
$(SQLITE_INCLUDE) \
$(WIN32_LIBOQS_INCLUDE) \
-I$(WIN32_CURL_INCLUDE_DIR) \
-I$(RAYLIB_DIR) \
-DFLINT_HAS_LIBOQS=1 \
-DPLATFORM_DESKTOP \
-DCURL_STATICLIB \
-o $@ \
@@ -738,6 +777,7 @@ $(WIN32_TARGET): Makefile $(SRC) $(FLINT_WINDOWS_SRCS) $(FLINT_ICON_STAMP) $(SQL
$(SQLITE_SRC) \
$(WIN32_RAYLIB_A) \
$(WIN32_CURL_A) \
$(WIN32_LIBOQS_A) \
$(WINDOWS_LDLIBS) \
$(WIN32_THREAD_LDFLAGS) \
$(WINDOWS_LDFLAGS)
@@ -819,7 +859,7 @@ $(WEB_TARGET): Makefile $(SRC) $(FLINT_WEB_SRCS) $(FLINT_ICON_STAMP) $(SQLITE_SR
$(SQLITE_INCLUDE) \
$(WEB_LIBOQS_INCLUDE) \
-I$(RAYLIB_DIR) \
-DINBE_HAS_LIBOQS=1 \
-DFLINT_HAS_LIBOQS=1 \
-DPLATFORM_WEB \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
+28 -89
View File
@@ -1,111 +1,50 @@
# Inner Breeze
Inner Breeze is a free, open-source practice app for breathing, meditation, and habit tracking.
Inner Breeze is a free, open-source app for breathing, meditation, and habit tracking.
## Features
## Build
- Guided practice sessions with visual and audio cues
- Mind, Yoga, and Fitness organization for habits and practice views
- Configurable breathing sessions and meditation timers
- Habit tracking with session history
- Local SQLite storage with import/export support
- Theme customization with light and dark variants
- Touch-optimized UI for desktop and mobile
## Building
inbe uses [raylib](https://github.com/raysan5/raylib) and requires a Nix development environment.
### Prerequisites
- [Nix](https://nixos.org/download.html) with flakes enabled
- For Android builds: Java 17+ JDK
### Native Build
Use the Nix development shell:
```bash
# Enter the development shell
nix develop
# Build for your current platform
make native
# Run
make run
```
### Cross-Platform Builds
Install locally:
```bash
# Android debug APK
make install
```
This installs the app to `~/.local/lib/inbe` and links `~/.local/bin/inbe`.
If `~/bin` exists, it links `~/bin/inbe` too.
## Other Targets
```bash
make test
make android-debug
# Android release APK
make android-release PASSWORD=your-keystore-password
make web
make appimage
make windows
```
## Release Automation
## Project Layout
GitHub Actions builds release artifacts for web, Linux, Windows, Android, and
the Chrome extension. When a new version tag is created by the release workflow,
the web, Android, Windows, and Linux builds are also published to itch.io.
- `src/` - app code
- `assets/` - images, fonts, and sounds
- `locales/` - translations
- `droid/` - Android project
- `site/` - website
- `vendor/flint/` - Flint UI/runtime submodule
Required repository secrets:
## Notes
- `ITCH_API_KEY` - itch.io Butler API key for publishing `waozi/inbe:html5`,
`waozi/inbe:android`, `waozi/inbe:windows`, and `waozi/inbe:linux`
### Android Emulator Testing
For automated testing with camera notch (cutout) support:
```bash
# Enter the development shell and run everything automatically
nix develop
./scripts/emulator.sh # Creates and launches the test AVD
make android-install # Builds, installs, and launches the app
```
This single script handles:
- AVD creation (if missing)
- Emulator launch
- APK build
- App installation and launch
The AVD is configured with:
- **Device**: Pixel 6 (punch-hole camera style)
- **Display**: 1080×2400 @ 420dpi
- **RAM**: 4GB with hardware acceleration
- **Cutout**: Punch-hole camera for testing window insets
### Platform-Specific Notes
- **Linux**: Requires SDL2 runtime libraries
- **Windows**: Standalone executable, no dependencies
- **Android**: Requires Android NDK in the development shell
- **Web**: Requires Emscripten toolchain
## Project Structure
- `src/` - Inbe application code
- `vendor/` - external third-party dependencies
- `vendor/flint/` - **git submodule** for first-party UI/runtime support code used directly by Inbe
- `wasm4/` - Standalone WASM-4 version
- `assets/` - Images and sounds
- `droid/` - Android build configuration
## Flint submodule workflow
`vendor/flint` is a source submodule (not a one-off copied sync). To update Inbe after a Flint change:
1. Push changes in the Flint repo.
2. In Inbe, update the submodule pointer:
- `git submodule update --init --recursive vendor/flint`
- `git -C vendor/flint pull`
3. Commit Inbe with the updated `vendor/flint` submodule reference.
When updating other projects that vendor Flint as a submodule, this keeps UI behavior and API docs aligned.
Inbe stores app data locally in SQLite. Optional sync can mirror user-owned
data through a Lyra-compatible sync server.
## License
MIT - see [LICENSE](LICENSE)
MIT. See [LICENSE](LICENSE).
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 35
versionCode 58
versionName "1.6.2"
versionCode 69
versionName "1.7.6"
}
+2 -1
View File
@@ -12,8 +12,9 @@
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name="xyz.waozi.inbe.MainActivity"
android:configChanges="keyboardHidden|uiMode"
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:windowLayoutInDisplayCutoutMode="never">
<meta-data
+15 -2
View File
@@ -21,7 +21,10 @@ set(NATIVE_APP_GLUE_DIR "${ANDROID_NDK}/sources/android/native_app_glue")
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "" FORCE)
set(OQS_USE_OPENSSL OFF CACHE BOOL "" FORCE)
set(OQS_MINIMAL_BUILD "SIG_ml_dsa_44" CACHE STRING "" FORCE)
add_subdirectory("${REPO_ROOT}/vendor/liboqs" "${CMAKE_BINARY_DIR}/liboqs")
add_subdirectory("${FLINT_DIR}/vendor/liboqs" "${CMAKE_BINARY_DIR}/liboqs")
if(NOT TARGET oqs)
message(FATAL_ERROR "Inbe Android builds require liboqs for sync account crypto")
endif()
file(GLOB FLINT_SOURCES CONFIGURE_DEPENDS "${FLINT_DIR}/src/*.c" "${FLINT_DIR}/src/ui/*.c")
list(REMOVE_ITEM FLINT_SOURCES "${FLINT_DIR}/src/flint_file_dialog.c")
file(GLOB INBE_LOCALE_ASSETS RELATIVE "${REPO_ROOT}" CONFIGURE_DEPENDS "${REPO_ROOT}/locales/*.txt")
@@ -31,6 +34,7 @@ set(INBE_EMBEDDED_INPUTS
assets/practices/whm/1.jpg
assets/practices/whm/2.jpg
assets/practices/meditation/1.jpg
assets/pet/egg1.png
assets/practices/sunsalutation/pos_0001.png
assets/practices/sunsalutation/pos_0002.png
assets/practices/sunsalutation/pos_0003.png
@@ -106,7 +110,9 @@ target_include_directories(raylib PUBLIC
add_library(main SHARED
"${SRC_DIR}/main.c"
"${SRC_DIR}/core/breath_engine.c"
"${SRC_DIR}/app/app_sync.c"
"${SRC_DIR}/app/app.c"
"${SRC_DIR}/app/app_nav.c"
"${SRC_DIR}/app/app_settings.c"
"${SRC_DIR}/app/device_preferences.c"
"${SRC_DIR}/practices/practice_registry.c"
@@ -124,11 +130,15 @@ add_library(main SHARED
"${SRC_DIR}/screens/statistics_screen.c"
"${SRC_DIR}/screens/habits/edit.c"
"${SRC_DIR}/screens/habits/session.c"
"${SRC_DIR}/screens/profile_screen.c"
"${SRC_DIR}/screens/profile_social.c"
"${SRC_DIR}/screens/pet_screen.c"
"${SRC_DIR}/practices/meditation/meditation_music.c"
"${SRC_DIR}/storage/data.c"
"${SRC_DIR}/storage/db.c"
"${SRC_DIR}/storage/import.c"
"${SRC_DIR}/storage/storage.c"
"${SRC_DIR}/storage/storage_sessions.c"
"${SRC_DIR}/storage/sync_review.c"
"${SRC_DIR}/storage/sync_account.c"
"${SRC_DIR}/storage/sync_client.c"
@@ -142,9 +152,11 @@ add_library(main SHARED
"${SRC_DIR}/screens/language_screen.c"
"${SRC_DIR}/screens/manual_screen.c"
"${SRC_DIR}/screens/settings/settings_screen.c"
"${SRC_DIR}/screens/settings/settings_ui.c"
"${SRC_DIR}/screens/settings/settings_device.c"
"${SRC_DIR}/screens/settings/settings_session.c"
"${SRC_DIR}/screens/settings/settings_theme.c"
"${SRC_DIR}/screens/settings/settings_about.c"
"${SRC_DIR}/screens/settings/settings_data.c"
"${SRC_DIR}/screens/settings/settings_sync_account.c"
"${INBE_EMBEDDED_ASSETS_C}"
@@ -185,7 +197,7 @@ target_compile_definitions(main PRIVATE
SUPPORT_MODULE_RAUDIO=1
SUPPORT_FILEFORMAT_OGG=1
FLINT_EMBEDDED_ONLY=1
INBE_HAS_LIBOQS=1
FLINT_HAS_LIBOQS=1
)
target_compile_options(main PRIVATE
@@ -199,6 +211,7 @@ target_link_options(main PRIVATE
-Wl,--gc-sections
-Wl,--strip-all
-Wl,-z,max-page-size=16384
-Wl,-z,common-page-size=16384
-Wl,--wrap=fopen
)
@@ -14,29 +14,25 @@ import android.graphics.Insets;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.DisplayCutout;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import androidx.core.view.WindowCompat;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.UnknownHostException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import javax.net.ssl.SSLSocketFactory;
public class MainActivity extends NativeActivity {
private static final String TAG = "InbeMainActivity";
@@ -49,9 +45,8 @@ public class MainActivity extends NativeActivity {
System.loadLibrary("main");
}
// [status_bar, nav_bar, cutout_left, cutout_top, cutout_right, cutout_bottom]
// [status_bar, nav_bar, cutouts] mirrored in native.
private final int[] cachedInsets = new int[6];
private boolean insetsInitialized = false;
private boolean activityPaused = false;
private boolean windowFocused = true;
private boolean backgroundExecutionActive = false;
@@ -305,224 +300,11 @@ public class MainActivity extends NativeActivity {
}
public String syncHttpRequest(String method, String urlText, String body, String[] headers) {
HttpURLConnection connection = null;
int status = 0;
try {
byte[] bodyBytes = body != null ? body.getBytes(StandardCharsets.UTF_8) : new byte[0];
connection = (HttpURLConnection)new URL(urlText).openConnection();
connection.setInstanceFollowRedirects(false);
connection.setConnectTimeout(15000);
connection.setReadTimeout(30000);
connection.setRequestMethod(method);
connection.setRequestProperty("User-Agent", "inbe-sync/1");
if (headers != null) {
for (String header : headers) {
if (header == null) continue;
int colon = header.indexOf(':');
if (colon <= 0) continue;
String key = header.substring(0, colon).trim();
String value = header.substring(colon + 1).trim();
if (!key.isEmpty()) {
connection.setRequestProperty(key, value);
}
}
}
if ("POST".equals(method) || "DELETE".equals(method)) {
connection.setDoOutput(true);
connection.setFixedLengthStreamingMode(bodyBytes.length);
try (OutputStream output = connection.getOutputStream()) {
output.write(bodyBytes);
}
}
status = connection.getResponseCode();
InputStream stream = status >= 400 ? connection.getErrorStream() : connection.getInputStream();
String response = "";
if (stream != null) {
try (InputStream input = stream) {
byte[] bytes = readAllBytesCompat(input);
response = new String(bytes, StandardCharsets.UTF_8);
}
}
return status + "\n" + response;
} catch (Exception e) {
Log.e(TAG, "Sync HTTP request failed", e);
return status + "\n" + (e.getMessage() != null ? e.getMessage() : "request failed");
} finally {
if (connection != null) {
connection.disconnect();
}
}
return SyncNetwork.httpRequest(TAG, method, urlText, body, headers);
}
public String syncWebSocketWait(String urlText, String[] headers) {
Socket socket = null;
try {
URI url = new URI(urlText);
String protocol = url.getScheme();
boolean secure = "wss".equals(protocol);
int port = url.getPort();
String path = url.getRawPath();
if (path == null || path.isEmpty()) path = "/";
if (url.getRawQuery() != null && !url.getRawQuery().isEmpty()) {
path += "?" + url.getRawQuery();
}
if (port <= 0) port = secure ? 443 : 80;
if (!secure && !"ws".equals(protocol)) {
return "0\ninvalid websocket url";
}
socket = secure
? SSLSocketFactory.getDefault().createSocket(url.getHost(), port)
: new Socket(url.getHost(), port);
socket.setTcpNoDelay(true);
byte[] keyBytes = new byte[16];
new SecureRandom().nextBytes(keyBytes);
String key = Base64.encodeToString(keyBytes, Base64.NO_WRAP);
StringBuilder request = new StringBuilder();
request.append("GET ").append(path).append(" HTTP/1.1\r\n");
request.append("Host: ").append(url.getHost());
if ((secure && port != 443) || (!secure && port != 80)) {
request.append(":").append(port);
}
request.append("\r\n");
request.append("Upgrade: websocket\r\n");
request.append("Connection: Upgrade\r\n");
request.append("Sec-WebSocket-Version: 13\r\n");
request.append("Sec-WebSocket-Key: ").append(key).append("\r\n");
request.append("User-Agent: inbe-sync/1\r\n");
if (headers != null) {
for (String header : headers) {
if (header != null && !header.isEmpty()) {
request.append(header).append("\r\n");
}
}
}
request.append("\r\n");
socket.getOutputStream().write(request.toString().getBytes(StandardCharsets.US_ASCII));
socket.getOutputStream().flush();
String statusLine = readAsciiLine(socket);
int status = parseHttpStatus(statusLine);
while (true) {
String line = readAsciiLine(socket);
if (line == null || line.isEmpty()) break;
}
if (status != 101) {
return status + "\nwebsocket upgrade failed";
}
Log.i(TAG, "Sync WebSocket connected");
while (true) {
String message = readWebSocketText(socket);
if (message == null) {
return "0\nwebsocket closed";
}
if (message.contains("\"type\":\"sync_changed\"")) {
return "101\n" + message;
}
}
} catch (Exception e) {
Log.w(TAG, "WebSocket wait failed", e);
return "0\n" + (e.getMessage() != null ? e.getMessage() : "websocket failed");
} finally {
if (socket != null) {
try {
socket.close();
} catch (Exception ignored) {
}
}
}
}
private static int parseHttpStatus(String statusLine) {
if (statusLine == null) return 0;
String[] parts = statusLine.split(" ", 3);
if (parts.length < 2) return 0;
try {
return Integer.parseInt(parts[1]);
} catch (NumberFormatException e) {
return 0;
}
}
private static String readAsciiLine(Socket socket) throws java.io.IOException {
StringBuilder line = new StringBuilder();
while (true) {
int b = socket.getInputStream().read();
if (b < 0) {
return line.length() > 0 ? line.toString() : null;
}
if (b == '\n') break;
if (b != '\r') line.append((char)b);
}
return line.toString();
}
private static String readWebSocketText(Socket socket) throws java.io.IOException {
int b0 = socket.getInputStream().read();
int b1 = socket.getInputStream().read();
if (b0 < 0 || b1 < 0) return null;
int opcode = b0 & 0x0f;
boolean masked = (b1 & 0x80) != 0;
long length = b1 & 0x7f;
if (length == 126) {
length = ((long)readByte(socket) << 8) | readByte(socket);
} else if (length == 127) {
length = 0;
for (int i = 0; i < 8; i++) {
length = (length << 8) | readByte(socket);
}
}
if (length < 0 || length > 1024 * 1024) {
throw new java.io.IOException("websocket frame too large");
}
byte[] mask = null;
if (masked) {
mask = readExact(socket, 4);
}
byte[] payload = readExact(socket, (int)length);
if (masked) {
for (int i = 0; i < payload.length; i++) {
payload[i] = (byte)(payload[i] ^ mask[i % 4]);
}
}
if (opcode == 8) return null;
if (opcode != 1) return "";
return new String(payload, StandardCharsets.UTF_8);
}
private static int readByte(Socket socket) throws java.io.IOException {
int b = socket.getInputStream().read();
if (b < 0) throw new java.io.IOException("unexpected eof");
return b;
}
private static byte[] readExact(Socket socket, int count) throws java.io.IOException {
byte[] data = new byte[count];
int offset = 0;
while (offset < count) {
int read = socket.getInputStream().read(data, offset, count - offset);
if (read < 0) throw new java.io.IOException("unexpected eof");
offset += read;
}
return data;
}
private static byte[] readAllBytesCompat(InputStream input) throws java.io.IOException {
byte[] buffer = new byte[8192];
int read;
java.io.ByteArrayOutputStream output = new java.io.ByteArrayOutputStream();
while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
return output.toByteArray();
return SyncNetwork.webSocketWait(TAG, urlText, headers);
}
public void openImportPicker(final String mimeTypesCsv) {
@@ -624,8 +406,7 @@ public class MainActivity extends NativeActivity {
}
public void updateSessionNotification(final String statusText) {
if (statusText == null || statusText.isEmpty()) return;
SessionForegroundService.updateStatus(statusText);
SessionForegroundService.updateStatus(statusText == null ? "" : statusText);
}
public void keepScreenOn() {
@@ -650,7 +431,9 @@ public class MainActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
configureSystemBars();
super.onCreate(savedInstanceState);
configureSystemBars();
synchronized (cachedInsets) {
for (int i = 0; i < 6; i++) {
@@ -663,17 +446,61 @@ public class MainActivity extends NativeActivity {
// Notify native code that activity is ready for wake lock
nativeWakeLockReady();
requestNotificationPermissionIfNeeded();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
nativeInvalidateGraphicsResources();
configureSystemBars();
pushDeviceConfiguration();
requestInsetRefresh();
}
private void configureSystemBars() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
attrs.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
} else {
attrs.layoutInDisplayCutoutMode =
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
getWindow().setAttributes(attrs);
}
int flags = getWindow().getDecorView().getSystemUiVisibility();
flags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
flags &= ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
flags &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
flags &= ~View.SYSTEM_UI_FLAG_IMMERSIVE;
flags &= ~View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
}
getWindow().getDecorView().setSystemUiVisibility(flags);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowInsetsController controller = getWindow().getInsetsController();
if (controller != null) {
controller.hide(WindowInsets.Type.statusBars());
controller.show(WindowInsets.Type.navigationBars());
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
getWindow().setNavigationBarContrastEnforced(false);
}
}
private void pushDeviceConfiguration() {
Configuration config = getResources().getConfiguration();
int nightMask = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
@@ -740,38 +567,9 @@ public class MainActivity extends NativeActivity {
}
}
});
} else {
fallbackForOldPhones();
}
}
private void fallbackForOldPhones() {
int statusBarHeight = 0;
int navBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
int navResourceId = getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (navResourceId > 0) {
navBarHeight = getResources().getDimensionPixelSize(navResourceId);
}
synchronized (cachedInsets) {
cachedInsets[0] = statusBarHeight;
cachedInsets[1] = navBarHeight;
cachedInsets[2] = 0;
cachedInsets[3] = 0;
cachedInsets[4] = 0;
cachedInsets[5] = 0;
}
insetsInitialized = true;
nativeSetInsets(statusBarHeight, navBarHeight, 0, 0, 0, 0);
}
private void updateInsets(WindowInsets insets) {
if (insets == null) return;
@@ -780,7 +578,8 @@ public class MainActivity extends NativeActivity {
int navBar = 0;
int cLeft = 0, cTop = 0, cRight = 0, cBottom = 0;
// System bar calculations
// Inbe owns a single edge-to-edge native surface. Java reports the
// system bar insets; native applies them once against the real GL surface.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Insets systemBars = insets.getInsetsIgnoringVisibility(WindowInsets.Type.systemBars());
statusBar = systemBars.top;
@@ -789,7 +588,6 @@ public class MainActivity extends NativeActivity {
statusBar = insets.getSystemWindowInsetTop();
navBar = insets.getSystemWindowInsetBottom();
}
// Display cutout calculations
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
DisplayCutout cutout = insets.getDisplayCutout();
@@ -810,7 +608,6 @@ public class MainActivity extends NativeActivity {
cachedInsets[5] = cBottom;
}
insetsInitialized = true;
nativeSetInsets(statusBar, navBar, cLeft, cTop, cRight, cBottom);
} catch (Exception e) {
@@ -868,15 +665,29 @@ public class MainActivity extends NativeActivity {
protected void onResume() {
super.onResume();
activityPaused = false;
configureSystemBars();
nativeInvalidateGraphicsResources();
requestInsetRefresh();
syncLifecycleState("onResume");
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
configureSystemBars();
requestInsetRefresh();
syncLifecycleState("onNewIntent");
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
windowFocused = hasFocus;
if (hasFocus) {
configureSystemBars();
requestInsetRefresh();
}
syncLifecycleState("onWindowFocusChanged");
}
@@ -59,6 +59,7 @@ public class SessionForegroundService extends Service {
}
private void startSession() {
currentStatusText = "";
Notification notification = buildNotification();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(
@@ -74,6 +75,7 @@ public class SessionForegroundService extends Service {
}
private void stopSession() {
currentStatusText = "";
releaseWakeLock();
stopForegroundCompat();
stopSelf();
@@ -81,9 +83,7 @@ public class SessionForegroundService extends Service {
}
public static void updateStatus(String statusText) {
if (statusText != null && !statusText.isEmpty()) {
currentStatusText = statusText;
}
currentStatusText = statusText != null ? statusText : "";
SessionForegroundService service = activeService;
if (service == null) {
@@ -0,0 +1,240 @@
package xyz.waozi.inbe;
import android.util.Base64;
import android.util.Log;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.Socket;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import javax.net.ssl.SSLSocketFactory;
final class SyncNetwork {
private SyncNetwork() {
}
static String httpRequest(String logTag, String method, String urlText, String body,
String[] headers) {
HttpURLConnection connection = null;
int status = 0;
try {
byte[] bodyBytes = body != null ? body.getBytes(StandardCharsets.UTF_8) : new byte[0];
connection = (HttpURLConnection)new URL(urlText).openConnection();
connection.setInstanceFollowRedirects(false);
connection.setConnectTimeout(15000);
connection.setReadTimeout(30000);
connection.setRequestMethod(method);
connection.setRequestProperty("User-Agent", "inbe-sync/1");
if (headers != null) {
for (String header : headers) {
if (header == null) continue;
int colon = header.indexOf(':');
if (colon <= 0) continue;
String key = header.substring(0, colon).trim();
String value = header.substring(colon + 1).trim();
if (!key.isEmpty()) {
connection.setRequestProperty(key, value);
}
}
}
if (bodyBytes.length > 0) {
connection.setDoOutput(true);
connection.setFixedLengthStreamingMode(bodyBytes.length);
try (OutputStream output = connection.getOutputStream()) {
output.write(bodyBytes);
}
}
status = connection.getResponseCode();
InputStream stream = status >= 400 ? connection.getErrorStream() : connection.getInputStream();
String response = "";
if (stream != null) {
try (InputStream input = stream) {
byte[] bytes = readAllBytesCompat(input);
response = new String(bytes, StandardCharsets.UTF_8);
}
}
return status + "\n" + response;
} catch (Exception e) {
Log.e(logTag, "Sync HTTP request failed", e);
return status + "\n" + (e.getMessage() != null ? e.getMessage() : "request failed");
} finally {
if (connection != null) {
connection.disconnect();
}
}
}
static String webSocketWait(String logTag, String urlText, String[] headers) {
Socket socket = null;
try {
URI url = new URI(urlText);
String protocol = url.getScheme();
boolean secure = "wss".equals(protocol);
int port = url.getPort();
String path = url.getRawPath();
if (path == null || path.isEmpty()) path = "/";
if (url.getRawQuery() != null && !url.getRawQuery().isEmpty()) {
path += "?" + url.getRawQuery();
}
if (port <= 0) port = secure ? 443 : 80;
if (!secure && !"ws".equals(protocol)) {
return "0\ninvalid websocket url";
}
socket = secure
? SSLSocketFactory.getDefault().createSocket(url.getHost(), port)
: new Socket(url.getHost(), port);
socket.setTcpNoDelay(true);
byte[] keyBytes = new byte[16];
new SecureRandom().nextBytes(keyBytes);
String key = Base64.encodeToString(keyBytes, Base64.NO_WRAP);
StringBuilder request = new StringBuilder();
request.append("GET ").append(path).append(" HTTP/1.1\r\n");
request.append("Host: ").append(url.getHost());
if ((secure && port != 443) || (!secure && port != 80)) {
request.append(":").append(port);
}
request.append("\r\n");
request.append("Upgrade: websocket\r\n");
request.append("Connection: Upgrade\r\n");
request.append("Sec-WebSocket-Version: 13\r\n");
request.append("Sec-WebSocket-Key: ").append(key).append("\r\n");
request.append("User-Agent: inbe-sync/1\r\n");
if (headers != null) {
for (String header : headers) {
if (header != null && !header.isEmpty()) {
request.append(header).append("\r\n");
}
}
}
request.append("\r\n");
socket.getOutputStream().write(request.toString().getBytes(StandardCharsets.US_ASCII));
socket.getOutputStream().flush();
String statusLine = readAsciiLine(socket);
int status = parseHttpStatus(statusLine);
while (true) {
String line = readAsciiLine(socket);
if (line == null || line.isEmpty()) break;
}
if (status != 101) {
return status + "\nwebsocket upgrade failed";
}
Log.i(logTag, "Sync WebSocket connected");
while (true) {
String message = readWebSocketText(socket);
if (message == null) {
return "0\nwebsocket closed";
}
if (message.contains("\"type\":\"sync_changed\"")) {
return "101\n" + message;
}
}
} catch (Exception e) {
Log.w(logTag, "WebSocket wait failed", e);
return "0\n" + (e.getMessage() != null ? e.getMessage() : "websocket failed");
} finally {
if (socket != null) {
try {
socket.close();
} catch (Exception ignored) {
}
}
}
}
private static int parseHttpStatus(String statusLine) {
if (statusLine == null) return 0;
String[] parts = statusLine.split(" ", 3);
if (parts.length < 2) return 0;
try {
return Integer.parseInt(parts[1]);
} catch (NumberFormatException e) {
return 0;
}
}
private static String readAsciiLine(Socket socket) throws java.io.IOException {
StringBuilder line = new StringBuilder();
while (true) {
int b = socket.getInputStream().read();
if (b < 0) {
return line.length() > 0 ? line.toString() : null;
}
if (b == '\n') break;
if (b != '\r') line.append((char)b);
}
return line.toString();
}
private static String readWebSocketText(Socket socket) throws java.io.IOException {
int b0 = socket.getInputStream().read();
int b1 = socket.getInputStream().read();
if (b0 < 0 || b1 < 0) return null;
int opcode = b0 & 0x0f;
boolean masked = (b1 & 0x80) != 0;
long length = b1 & 0x7f;
if (length == 126) {
length = ((long)readByte(socket) << 8) | readByte(socket);
} else if (length == 127) {
length = 0;
for (int i = 0; i < 8; i++) {
length = (length << 8) | readByte(socket);
}
}
if (length < 0 || length > 1024 * 1024) {
throw new java.io.IOException("websocket frame too large");
}
byte[] mask = null;
if (masked) {
mask = readExact(socket, 4);
}
byte[] payload = readExact(socket, (int)length);
if (masked) {
for (int i = 0; i < payload.length; i++) {
payload[i] = (byte)(payload[i] ^ mask[i % 4]);
}
}
if (opcode == 8) return null;
if (opcode != 1) return "";
return new String(payload, StandardCharsets.UTF_8);
}
private static int readByte(Socket socket) throws java.io.IOException {
int b = socket.getInputStream().read();
if (b < 0) throw new java.io.IOException("unexpected eof");
return b;
}
private static byte[] readExact(Socket socket, int count) throws java.io.IOException {
byte[] data = new byte[count];
int offset = 0;
while (offset < count) {
int read = socket.getInputStream().read(data, offset, count - offset);
if (read < 0) throw new java.io.IOException("unexpected eof");
offset += read;
}
return data;
}
private static byte[] readAllBytesCompat(InputStream input) throws java.io.IOException {
byte[] buffer = new byte[8192];
int read;
java.io.ByteArrayOutputStream output = new java.io.ByteArrayOutputStream();
while ((read = input.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
return output.toByteArray();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

+1 -1
View File
@@ -1,3 +1,3 @@
plugins {
id 'com.android.application' version '8.4.2' apply false
id 'com.android.application' version '8.5.1' apply false
}
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
@@ -0,0 +1 @@
- Improve theme, habit, and localization UI polish
@@ -0,0 +1,4 @@
- Move meditation duration selection into practice configuration with custom time support.
- Add centered in-session meditation add-time controls.
- Use Flint-managed liboqs, LibreSSL, and curl build paths.
- Fix Android native build to use Flint's liboqs submodule.
@@ -0,0 +1,4 @@
Fixed
---
- Repair habit-day sync for zero-count completions.
- Require liboqs at build time for every sync-enabled target.
@@ -0,0 +1,3 @@
Changed
---
- updated the practice screen ui/ux
@@ -0,0 +1,7 @@
Changed
---
- Rework Android safe-area handling to use one native inset path with stable bottom navigation spacing.
- Move leaderboard stats to synced source data, with local current-user rows shown immediately.
Fixed
---
- Fix profile/friend sync freshness, leaderboard empty states, modal input capture, pet asset embedding, and wrapped text previews.
@@ -0,0 +1,3 @@
Changed
---
- Move shared Lyra sync protocol code into Flint and simplify Inbe sync client wiring.
@@ -0,0 +1,8 @@
Added
---
- Add local `make install` target.
- Add Profile controls for habit ordering and practice visibility.
Changed
---
- Move sync status into the Data view and simplify the habits add option.
- Clean up the README.
@@ -0,0 +1,3 @@
Changed
---
- Improve habit management
@@ -0,0 +1,3 @@
Fixed
---
- bottom inset in practice
@@ -0,0 +1,3 @@
Fixed
---
- Android lanuch bug
@@ -0,0 +1,3 @@
Added
---
- habit overview
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+51 -3
View File
@@ -75,6 +75,32 @@
sdk = androidComposition.androidsdk;
ndkPath = "${sdk}/libexec/android-sdk/ndk-bundle";
emulatorRuntimeLibraryPath = pkgs.lib.makeLibraryPath (with pkgs; [
dbus
expat
fontconfig
freetype
libbsd
libice
libmd
libpng
libsm
libuuid
libx11
libxau
libxcb
libxdmcp
libxkbcommon
xcb-util-cursor
libXext
libXi
libxkbfile
nspr
nss
stdenv.cc.cc.lib
zlib
]);
pkgConfigPath = pkgs.lib.makeSearchPath "lib/pkgconfig" [
sdl2Pkgs.SDL2.dev
pkgs.curl.dev
@@ -180,9 +206,9 @@ EOF
export MCFGTHREADS="${mcfgthreads}"
export WIN32_MCFGTHREADS="${mcfgthreads32}"
export CPATH="$MCFGTHREADS/include:$CPATH"
export LIBRARY_PATH="$MCFGTHREADS/lib:$LIBRARY_PATH"
export LDFLAGS="-L$MCFGTHREADS/lib $LDFLAGS"
export CPATH="$MCFGTHREADS/include:$WIN32_MCFGTHREADS/include:$CPATH"
export LIBRARY_PATH="$MCFGTHREADS/lib:$WIN32_MCFGTHREADS/lib:$LIBRARY_PATH"
export LDFLAGS="-L$MCFGTHREADS/lib -L$WIN32_MCFGTHREADS/lib $LDFLAGS"
'';
in
(pkgs.buildFHSEnv {
@@ -212,6 +238,27 @@ EOF
libgbm
libglvnd
libglvnd.dev
dbus
expat
fontconfig
freetype
libbsd
libmd
libice
libsm
libxcb
libxau
libxdmcp
libxkbcommon
xcb-util-cursor
libXi
libXext
libxkbfile
nspr
nss
libpng
libuuid
libx11
alsa-lib
appimagetool
libpulseaudio
@@ -255,6 +302,7 @@ EOF
export ANDROID_HOME="${sdk}/libexec/android-sdk"
export ANDROID_SDK_ROOT="${sdk}/libexec/android-sdk"
export ANDROID_NDK_ROOT="${ndkPath}"
export ANDROID_EMULATOR_LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$ANDROID_HOME/emulator/lib64/qt/lib:${emulatorRuntimeLibraryPath}"
export CCACHE_DIR="$PWD/.ccache"
export CCACHE_BASEDIR="$PWD"
export CCACHE_COMPRESS=1
+202 -59
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Historie
---
[tab_profile]
Profil
---
[tab_habits]
Návyky
---
@@ -22,6 +25,129 @@ Označit
[tab_manual]
Návod
---
[tab_pet]
Pet
---
[profile_data_title]
Data
---
[profile_data_button]
Nastavit data
---
[profile_habits_label]
Navyky
---
[profile_sessions_label]
Sezeni
---
[profile_storage_label]
Uloziste
---
[profile_friends_title]
Pratele
---
[profile_leaderboard_title]
Zebricek
---
[profile_metric_streak]
Serie
---
[profile_metric_avg_time]
Prumerny cas
---
[profile_metric_avg_hold]
Prumerna vydrz
---
[profile_none_label]
Zadne
---
[profile_friend_accept_button]
Prijmout
---
[profile_friend_decline_button]
Odmitnout
---
[profile_friend_remove_title]
Odebrat pritele?
---
[profile_friend_remove_message]
%s bude odebran. Pro obnoveni poslete novou zadost.
---
[profile_updating_status]
Aktualizace
---
[profile_no_account]
Zadny ucet
---
[profile_account_section]
Ucet
---
[profile_configure_button]
Nastavit
---
[profile_data_section]
Data
---
[profile_sync_section]
Synchronizace
---
[profile_friends_count_format]
%d pratel
---
[profile_pending_count_format]
%d cekajici
---
[profile_social_section]
Socialni
---
[profile_add_friend_button]
Pridat pritele
---
[profile_incoming_title]
Prichozi
---
[profile_outgoing_title]
Odchozi
---
[profile_no_leaderboard_data]
Zadna data zebricku
---
[profile_practice_label]
Cviceni
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Nastavení
---
@@ -157,6 +283,21 @@ Nelze načíst soubor s meditační hudbou. Zkontrolujte připojení k internetu
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
DÝCHAT
---
@@ -250,15 +391,12 @@ Vzhled
[settings_section_language]
Jazyk
---
[settings_tab_data]
Data
---
[settings_section_data]
Data
---
[settings_tab_about]
O aplikaci
---
[about_text]
Klidny pruvodce pro dychani, navyky a synchronizaci.
---
[theme_label]
Motiv
---
@@ -305,10 +443,19 @@ Pauza po kole
Pokročilé ovládání sezení
---
[double_tap_to_breathe_label]
Double tap to breathe
Dvojí klepnutí pro nádech
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Dvakrát klepněte na obrazovku pro nádech
---
[session_count_singular]
%d sezení
---
[session_count_plural]
%d sezení
---
[no_sessions]
Žádná sezení
---
[hold_display_label]
Zobrazeni zadrze
@@ -323,7 +470,7 @@ Kruh
Hlasitost
---
[show_session_volume_control_label]
Zobrazit ovladani hlasitosti
Zobrazit ovládání hlasitosti
---
[reset_to_defaults_label]
Obnovit výchozí
@@ -549,7 +696,7 @@ Oceán
Les
---
[theme_sunset]
Západ slunce
Soumrak
---
[theme_lavender]
Levandule
@@ -656,8 +803,20 @@ Použijte https:// nebo loopback jako localhost:8080
[sync_server_saved]
Synchronizační server uložen
---
[sync_connected]
Vzdálená synchronizace dokončena
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Vzdálená synchronizace selhala
@@ -734,14 +893,17 @@ Upravit návyk
[habit_name_label]
Název
---
[habit_description_label]
Description
---
[habit_underline_label]
Podtržení
---
[habit_practice_list_title]
Session Data From
Data sezení z
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Vyberte, která cvičební sezení se počítají do tohoto návyku. Odpovídající dny se zobrazí jako splněné a mohou otevřít editor sezení.
---
[habit_counting_title]
Počítání
@@ -776,6 +938,9 @@ Vytvořit návyk
[habit_stats_no_rounds_week]
Za poslední týden nejsou žádná kola
---
[habit_stats_no_rounds_month]
Za poslední měsíc nejsou žádná kola
---
[habit_stats_current_streak]
Aktuální série
---
@@ -800,40 +965,12 @@ Celková zádrž
[habit_stats_best_streak]
Nejlepší série
---
[bottom_nav_customize_button]
Upravit spodní navigaci
[habit_stats_day_singular]
%d den
---
[bottom_nav_customize_title]
Spodní navigace
---
[bottom_nav_add_button]
Přidat položku
---
[bottom_nav_slot_1]
Položka 1
---
[bottom_nav_slot_2]
Položka 2
---
[bottom_nav_slot_3]
Položka 3
---
[bottom_nav_slot_4]
Položka 4
---
[bottom_nav_slot_5]
Položka 5
---
[bottom_nav_slot_6]
Položka 6
---
[bottom_nav_slot_7]
Položka 7
---
[bottom_nav_slot_8]
Položka 8
---
[reset_button]
[habit_stats_day_plural]
%d dní
---[reset_button]
Obnovit
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Zde si vyberte praxi.
[practice_guide_manual]
Pred zahajenim praxe si prectete navod, abyste porozumeli celemu cviceni.
---
[practice_guide_sun]
Az budete pripraveni zacit cviceni, pouzijte kartu se sluncem.
---
[practice_guide_config]
Upravte konfiguraci praxe podle svych potreb.
---
@@ -860,6 +994,18 @@ Zvolte Tyden nebo Kalendar pro kontrolu navyku.
[habits_guide_statistics]
Zde zobrazite statistiky navyku.
---
[profile_guide_account]
Zde nastavite synchronizacni ucet.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Odtud otevete pratele a zebricek.
---
[profile_guide_social_no_account]
Vytvorte synchronizacni ucet pro odemceni pratel a zebricku.
---
[nav_mode_label]
Navigace
---
@@ -871,13 +1017,13 @@ Karty
---
[transition_label]
Transition
Přechod
[transition_none]
None
Žádný
[transition_fade]
Fade
Prolnutí
[theme_picker_title]
Choose Theme
Vybrat motiv
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Relace je aktivni
---
[notification_starting_seconds]
Start: %ds
---
@@ -935,7 +1078,7 @@ Zadrz: %ds
[notification_breath_in_seconds]
Nadech: %ds
---
[notification_next_round]
Dalsi kolo
[notification_results]
Results
---
---
+205 -62
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Verlauf
---
[tab_profile]
Profil
---
[tab_habits]
Gewohnheiten
---
@@ -22,6 +25,129 @@ Markieren
[tab_manual]
Anleitung
---
[tab_pet]
Pet
---
[profile_data_title]
Daten
---
[profile_data_button]
Daten konfigurieren
---
[profile_habits_label]
Gewohnheiten
---
[profile_sessions_label]
Sitzungen
---
[profile_storage_label]
Speicher
---
[profile_friends_title]
Freunde
---
[profile_leaderboard_title]
Bestenliste
---
[profile_metric_streak]
Serie
---
[profile_metric_avg_time]
Durchschnittszeit
---
[profile_metric_avg_hold]
Durchschn. Halten
---
[profile_none_label]
Keine
---
[profile_friend_accept_button]
Annehmen
---
[profile_friend_decline_button]
Ablehnen
---
[profile_friend_remove_title]
Freund entfernen?
---
[profile_friend_remove_message]
%s wird entfernt. Sende eine neue Anfrage zum Wiederverbinden.
---
[profile_updating_status]
Aktualisieren
---
[profile_no_account]
Kein Konto
---
[profile_account_section]
Konto
---
[profile_configure_button]
Konfigurieren
---
[profile_data_section]
Daten
---
[profile_sync_section]
Sync
---
[profile_friends_count_format]
%d Freunde
---
[profile_pending_count_format]
%d ausstehend
---
[profile_social_section]
Sozial
---
[profile_add_friend_button]
Freund hinzufuegen
---
[profile_incoming_title]
Eingehend
---
[profile_outgoing_title]
Ausgehend
---
[profile_no_leaderboard_data]
Keine Bestenlistendaten
---
[profile_practice_label]
Praxis
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Einstellungen
---
@@ -157,6 +283,21 @@ Der Meditations-Musikserver konnte nicht erreicht werden. Prüfe die Android-Net
[duration_2h]
2 Std.
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
ATEM
---
@@ -250,14 +391,11 @@ Darstellung
[settings_section_language]
Sprache
---
[settings_tab_data]
Daten
---
[settings_section_data]
Daten
---
[settings_tab_about]
Über
Info
---
[about_text]
Ein ruhiger Begleiter fuer Atemuebungen, Gewohnheiten und Synchronisierung.
---
[theme_label]
Thema
@@ -305,10 +443,19 @@ Pause nach Runde
Erweiterte Sitzungssteuerung
---
[double_tap_to_breathe_label]
Double tap to breathe
Doppeltippen zum Atmen
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Doppeltippe auf den Bildschirm, um zu atmen
---
[session_count_singular]
%d Sitzung
---
[session_count_plural]
%d Sitzungen
---
[no_sessions]
Keine Sitzungen
---
[hold_display_label]
Atemhalteanzeige
@@ -323,7 +470,7 @@ Kreis
Lautstärke
---
[show_session_volume_control_label]
Lautstaerkeregler anzeigen
Lautstärkeregler anzeigen
---
[reset_to_defaults_label]
Auf Standard zurücksetzen
@@ -549,7 +696,7 @@ Ozean
Wald
---
[theme_sunset]
Sonnenuntergang
Abendrot
---
[theme_lavender]
Lavendel
@@ -656,8 +803,20 @@ Nutze https:// oder Loopback wie localhost:8080
[sync_server_saved]
Sync-Server gespeichert
---
[sync_connected]
Remote-Sync abgeschlossen
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Remote-Sync fehlgeschlagen
@@ -734,14 +893,17 @@ Gewohnheit bearbeiten
[habit_name_label]
Bezeichnung
---
[habit_description_label]
Description
---
[habit_underline_label]
Unterstreichung
---
[habit_practice_list_title]
Session Data From
Sitzungsdaten aus
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Wähle, welche Übungssitzungen für diese Gewohnheit zählen. Passende Tage werden als erledigt angezeigt und können den Sitzungseditor öffnen.
---
[habit_counting_title]
Zählen
@@ -776,6 +938,9 @@ Gewohnheit erstellen
[habit_stats_no_rounds_week]
Keine Runden in der letzten Woche
---
[habit_stats_no_rounds_month]
Keine Runden im letzten Monat
---
[habit_stats_current_streak]
Aktuelle Serie
---
@@ -800,40 +965,12 @@ Gesamte Atemhaltezeit
[habit_stats_best_streak]
Beste Serie
---
[bottom_nav_customize_button]
Untere Navigation anpassen
[habit_stats_day_singular]
%d Tag
---
[bottom_nav_customize_title]
Untere Navigation
---
[bottom_nav_add_button]
Eintrag hinzufügen
---
[bottom_nav_slot_1]
Eintrag 1
---
[bottom_nav_slot_2]
Eintrag 2
---
[bottom_nav_slot_3]
Eintrag 3
---
[bottom_nav_slot_4]
Eintrag 4
---
[bottom_nav_slot_5]
Eintrag 5
---
[bottom_nav_slot_6]
Eintrag 6
---
[bottom_nav_slot_7]
Eintrag 7
---
[bottom_nav_slot_8]
Eintrag 8
---
[reset_button]
[habit_stats_day_plural]
%d Tage
---[reset_button]
Zurücksetzen
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Wahle hier deine Praxis aus.
[practice_guide_manual]
Lies das Tutorial, bevor du eine Praxis startest, damit du die ganze Uebung verstehst.
---
[practice_guide_sun]
Nutze den Sonnen-Tab, wenn du bereit bist, die Uebung zu starten.
---
[practice_guide_config]
Passe die Konfiguration der Praxis an deine Anforderungen an.
---
@@ -860,24 +994,36 @@ Wahle Woche oder Kalender, um deine Gewohnheit zu pruefen.
[habits_guide_statistics]
Sieh dir hier deine Gewohnheitsstatistiken an.
---
[profile_guide_account]
Richte hier dein Sync-Konto ein.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Oeffne Freunde und Bestenliste von hier.
---
[profile_guide_social_no_account]
Erstelle ein Sync-Konto, um Freunde und Bestenliste freizuschalten.
---
[nav_mode_label]
Navigation
---
[nav_mode_dropdown]
Dropdown
Liste
---
[nav_mode_tabbar]
Tabs
Reiter
---
[transition_label]
Transition
Übergang
[transition_none]
None
Keine
[transition_fade]
Fade
Blende
[theme_picker_title]
Choose Theme
Thema wählen
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Sitzung aktiv
---
[notification_starting_seconds]
Start: %ds
---
@@ -935,7 +1078,7 @@ Halten: %ds
[notification_breath_in_seconds]
Einatmen: %ds
---
[notification_next_round]
Naechste Runde
[notification_results]
Results
---
---
+195 -52
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
History
---
[tab_profile]
Profile
---
[tab_habits]
Habits
---
@@ -22,6 +25,129 @@ Mark Done
[tab_manual]
Tutorial
---
[tab_pet]
Pet
---
[profile_data_title]
Data
---
[profile_data_button]
Configure Data
---
[profile_habits_label]
Habits
---
[profile_sessions_label]
Sessions
---
[profile_storage_label]
Storage
---
[profile_friends_title]
Friends
---
[profile_leaderboard_title]
Leaderboard
---
[profile_metric_streak]
Streak
---
[profile_metric_avg_time]
Avg time
---
[profile_metric_avg_hold]
Avg hold
---
[profile_none_label]
None
---
[profile_friend_accept_button]
Accept
---
[profile_friend_decline_button]
Decline
---
[profile_friend_remove_title]
Remove friend?
---
[profile_friend_remove_message]
%s will be removed. Send a new request to reconnect.
---
[profile_updating_status]
Updating
---
[profile_no_account]
No account
---
[profile_account_section]
Account
---
[profile_configure_button]
Configure
---
[profile_data_section]
Data
---
[profile_sync_section]
Sync
---
[profile_friends_count_format]
%d friends
---
[profile_pending_count_format]
%d pending
---
[profile_social_section]
Social
---
[profile_add_friend_button]
Add friend
---
[profile_incoming_title]
Incoming
---
[profile_outgoing_title]
Outgoing
---
[profile_no_leaderboard_data]
No leaderboard data
---
[profile_practice_label]
Practice
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Settings
---
@@ -160,6 +286,21 @@ Music by Elijah_K.
[duration_2h]
2h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
BREATH
---
@@ -256,15 +397,12 @@ Appearance
[settings_section_language]
Language
---
[settings_tab_data]
Data
---
[settings_section_data]
Data
---
[settings_tab_about]
About
---
[about_text]
A quiet breathing companion for practice, habits, and sync.
---
[theme_label]
Theme
---
@@ -370,6 +508,15 @@ Double tap to breathe
[double_tap_to_breathe_hint]
Double tap screen to breathe
---
[session_count_singular]
%d session
---
[session_count_plural]
%d sessions
---
[no_sessions]
No sessions
---
[hold_display_label]
Hold display
---
@@ -698,8 +845,20 @@ Use https:// or loopback like localhost:8080
[sync_server_saved]
Sync server saved
---
[sync_connected]
Remote sync complete
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Remote sync failed
@@ -776,11 +935,14 @@ Edit Habit
[habit_name_label]
Name
---
[habit_description_label]
Description
---
[habit_underline_label]
Underline
---
[habit_practice_list_title]
Practice list
Session data from
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
@@ -818,6 +980,9 @@ Create habit
[habit_stats_no_rounds_week]
No rounds in the last week
---
[habit_stats_no_rounds_month]
No rounds in the last month
---
[habit_stats_current_streak]
Current streak
---
@@ -842,53 +1007,22 @@ Total hold
[habit_stats_best_streak]
Best streak
---
[bottom_nav_customize_button]
Customize bottom navigation
[habit_stats_day_singular]
%d day
---
[bottom_nav_customize_title]
Bottom Navigation
---
[bottom_nav_add_button]
Add item
---
[bottom_nav_slot_1]
Item 1
---
[bottom_nav_slot_2]
Item 2
---
[bottom_nav_slot_3]
Item 3
---
[bottom_nav_slot_4]
Item 4
---
[bottom_nav_slot_5]
Item 5
---
[bottom_nav_slot_6]
Item 6
---
[bottom_nav_slot_7]
Item 7
---
[bottom_nav_slot_8]
Item 8
---
[reset_button]
[habit_stats_day_plural]
%d days
---[reset_button]
Reset
---
[practice_guide_dropdown]
Choose your practice here.
---
[practice_guide_manual]
Read the tutorial before starting a practice so you understand the full exercise.
---
[practice_guide_sun]
Use the sun tab when you are ready to start the exercise.
Use this manual icon to open the tutorial before starting.
---
[practice_guide_config]
Change the practice configuration to meet your standards.
Use this wrench icon to adjust the practice configuration.
---
[habits_guide_dropdown]
Select habits here or create a new one.
@@ -902,6 +1036,18 @@ Choose Weekly or Calendar to review your habit.
[habits_guide_statistics]
View habit statistics here.
---
[profile_guide_account]
Configure your sync account here.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Open friends and leaderboard from here.
---
[profile_guide_social_no_account]
Create a sync account to unlock friends and leaderboard.
---
[nav_mode_label]
Navigation
---
@@ -923,9 +1069,6 @@ Fade
[theme_picker_title]
Choose Theme
---
[notification_session_active]
Session active
---
[notification_starting_seconds]
Starting: %ds
---
@@ -938,6 +1081,6 @@ Hold: %ds
[notification_breath_in_seconds]
Breath in: %ds
---
[notification_next_round]
Next round
[notification_results]
Results
---
+200 -57
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Historial
---
[tab_profile]
Perfil
---
[tab_habits]
Hábitos
---
@@ -22,6 +25,129 @@ Marcar
[tab_manual]
Manual
---
[tab_pet]
Pet
---
[profile_data_title]
Datos
---
[profile_data_button]
Configurar datos
---
[profile_habits_label]
Habitos
---
[profile_sessions_label]
Sesiones
---
[profile_storage_label]
Almacenamiento
---
[profile_friends_title]
Amigos
---
[profile_leaderboard_title]
Clasificacion
---
[profile_metric_streak]
Racha
---
[profile_metric_avg_time]
Tiempo medio
---
[profile_metric_avg_hold]
Retencion media
---
[profile_none_label]
Ninguno
---
[profile_friend_accept_button]
Aceptar
---
[profile_friend_decline_button]
Rechazar
---
[profile_friend_remove_title]
¿Eliminar amigo?
---
[profile_friend_remove_message]
Se eliminara a %s. Envia una nueva solicitud para reconectar.
---
[profile_updating_status]
Actualizando
---
[profile_no_account]
Sin cuenta
---
[profile_account_section]
Cuenta
---
[profile_configure_button]
Configurar
---
[profile_data_section]
Datos
---
[profile_sync_section]
Sincronizacion
---
[profile_friends_count_format]
%d amigos
---
[profile_pending_count_format]
%d pendientes
---
[profile_social_section]
Social
---
[profile_add_friend_button]
Anadir amigo
---
[profile_incoming_title]
Entrantes
---
[profile_outgoing_title]
Salientes
---
[profile_no_leaderboard_data]
Sin datos de clasificacion
---
[profile_practice_label]
Practica
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Configuración
---
@@ -157,6 +283,21 @@ No se pudo acceder al archivo de música de meditación. Revisa tu conexión a i
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRACIÓN
---
@@ -250,15 +391,12 @@ Apariencia
[settings_section_language]
Idioma
---
[settings_tab_data]
Datos
---
[settings_section_data]
Datos
---
[settings_tab_about]
Acerca de
---
[about_text]
Un companero tranquilo para respiracion, habitos y sincronizacion.
---
[theme_label]
Tema
---
@@ -305,10 +443,19 @@ Pausa después de ronda
Controles avanzados de sesión
---
[double_tap_to_breathe_label]
Double tap to breathe
Doble toque para respirar
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Toca dos veces la pantalla para respirar
---
[session_count_singular]
%d sesión
---
[session_count_plural]
%d sesiones
---
[no_sessions]
Sin sesiones
---
[hold_display_label]
Visualizacion de retencion
@@ -656,8 +803,20 @@ Usa https:// o loopback como localhost:8080
[sync_server_saved]
Servidor de sincronización guardado
---
[sync_connected]
Sincronización remota completa
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Falló la sincronización remota
@@ -734,14 +893,17 @@ Editar hábito
[habit_name_label]
Nombre
---
[habit_description_label]
Description
---
[habit_underline_label]
Subrayado
---
[habit_practice_list_title]
Session Data From
Datos de sesión
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Elige qué sesiones de práctica cuentan para este hábito. Los días coincidentes se muestran como completados y pueden abrir el editor de sesión.
---
[habit_counting_title]
Conteo
@@ -776,6 +938,9 @@ Crear hábito
[habit_stats_no_rounds_week]
No hay rondas en la última semana
---
[habit_stats_no_rounds_month]
No hay rondas en el último mes
---
[habit_stats_current_streak]
Racha actual
---
@@ -800,40 +965,12 @@ Retención total
[habit_stats_best_streak]
Mejor racha
---
[bottom_nav_customize_button]
Personalizar navegación inferior
[habit_stats_day_singular]
%d día
---
[bottom_nav_customize_title]
Navegación inferior
---
[bottom_nav_add_button]
Añadir elemento
---
[bottom_nav_slot_1]
Elemento 1
---
[bottom_nav_slot_2]
Elemento 2
---
[bottom_nav_slot_3]
Elemento 3
---
[bottom_nav_slot_4]
Elemento 4
---
[bottom_nav_slot_5]
Elemento 5
---
[bottom_nav_slot_6]
Elemento 6
---
[bottom_nav_slot_7]
Elemento 7
---
[bottom_nav_slot_8]
Elemento 8
---
[reset_button]
[habit_stats_day_plural]
%d días
---[reset_button]
Restablecer
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Elige tu practica aqui.
[practice_guide_manual]
Lee el tutorial antes de iniciar una practica para entender todo el ejercicio.
---
[practice_guide_sun]
Usa la pestana del sol cuando estes listo para iniciar el ejercicio.
---
[practice_guide_config]
Cambia la configuracion de la practica segun tus necesidades.
---
@@ -860,6 +994,18 @@ Elige Semanal o Calendario para revisar tu habito.
[habits_guide_statistics]
Consulta tus estadisticas de habitos aqui.
---
[profile_guide_account]
Configura tu cuenta de sincronizacion aqui.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Abre amigos y clasificacion desde aqui.
---
[profile_guide_social_no_account]
Crea una cuenta de sincronizacion para desbloquear amigos y clasificacion.
---
[nav_mode_label]
Navegación
---
@@ -871,13 +1017,13 @@ Pestañas
---
[transition_label]
Transition
Transición
[transition_none]
None
Ninguna
[transition_fade]
Fade
Fundido
[theme_picker_title]
Choose Theme
Elegir tema
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Sesion activa
---
[notification_starting_seconds]
Inicio: %ds
---
@@ -935,7 +1078,7 @@ Retencion: %ds
[notification_breath_in_seconds]
Inhala: %ds
---
[notification_next_round]
Siguiente ronda
[notification_results]
Results
---
---
+204 -60
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Historique
---
[tab_profile]
Profil
---
[tab_habits]
Habitudes
---
@@ -22,6 +25,129 @@ Marquer
[tab_manual]
Tutoriel
---
[tab_pet]
Pet
---
[profile_data_title]
Donnees
---
[profile_data_button]
Configurer les donnees
---
[profile_habits_label]
Habitudes
---
[profile_sessions_label]
Seances
---
[profile_storage_label]
Stockage
---
[profile_friends_title]
Amis
---
[profile_leaderboard_title]
Classement
---
[profile_metric_streak]
Serie
---
[profile_metric_avg_time]
Temps moyen
---
[profile_metric_avg_hold]
Retenue moyenne
---
[profile_none_label]
Aucun
---
[profile_friend_accept_button]
Accepter
---
[profile_friend_decline_button]
Refuser
---
[profile_friend_remove_title]
Supprimer l'ami ?
---
[profile_friend_remove_message]
%s sera supprime. Envoyez une nouvelle demande pour vous reconnecter.
---
[profile_updating_status]
Mise a jour
---
[profile_no_account]
Aucun compte
---
[profile_account_section]
Compte
---
[profile_configure_button]
Configurer
---
[profile_data_section]
Donnees
---
[profile_sync_section]
Synchronisation
---
[profile_friends_count_format]
%d amis
---
[profile_pending_count_format]
%d en attente
---
[profile_social_section]
Social
---
[profile_add_friend_button]
Ajouter un ami
---
[profile_incoming_title]
Recues
---
[profile_outgoing_title]
Envoyees
---
[profile_no_leaderboard_data]
Aucune donnee de classement
---
[profile_practice_label]
Pratique
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Réglages
---
@@ -157,6 +283,21 @@ Impossible de joindre le fichier de musique de méditation. Vérifiez votre conn
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRER
---
@@ -253,14 +394,11 @@ Apparence
[settings_section_language]
Langue
---
[settings_tab_data]
Données
---
[settings_section_data]
Données
---
[settings_tab_about]
À propos
A propos
---
[about_text]
Un compagnon discret pour la respiration, les habitudes et la synchronisation.
---
[theme_label]
Thème
@@ -308,10 +446,19 @@ Pause après cycle
Contrôles avancés de séance
---
[double_tap_to_breathe_label]
Double tap to breathe
Double toucher pour respirer
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Touchez deux fois l'écran pour respirer
---
[session_count_singular]
%d session
---
[session_count_plural]
%d sessions
---
[no_sessions]
Aucune session
---
[hold_display_label]
Affichage de la retention
@@ -326,7 +473,7 @@ Cercle
Volume
---
[show_session_volume_control_label]
Afficher le controle du volume
Afficher le contrôle du volume
---
[reset_to_defaults_label]
Réinitialiser
@@ -552,7 +699,7 @@ Océan
Forêt
---
[theme_sunset]
Coucher de soleil
Crépuscule
---
[theme_lavender]
Lavande
@@ -698,8 +845,20 @@ Utilisez https:// ou une boucle locale comme localhost:8080
[sync_server_saved]
Serveur de synchronisation enregistré
---
[sync_connected]
Synchronisation distante terminée
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Échec de la synchronisation distante
@@ -776,14 +935,17 @@ Modifier l'habitude
[habit_name_label]
Nom
---
[habit_description_label]
Description
---
[habit_underline_label]
Soulignement
---
[habit_practice_list_title]
Session Data From
Données de session
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Choisissez quelles sessions de pratique comptent pour cette habitude. Les jours correspondants sont marqués comme faits et peuvent ouvrir l'éditeur de session.
---
[habit_counting_title]
Comptage
@@ -818,6 +980,9 @@ Créer une habitude
[habit_stats_no_rounds_week]
Aucune série la semaine dernière
---
[habit_stats_no_rounds_month]
Aucune série le mois dernier
---
[habit_stats_current_streak]
Série actuelle
---
@@ -842,40 +1007,12 @@ Rétention totale
[habit_stats_best_streak]
Meilleure série
---
[bottom_nav_customize_button]
Personnaliser la navigation du bas
[habit_stats_day_singular]
%d jour
---
[bottom_nav_customize_title]
Navigation du bas
---
[bottom_nav_add_button]
Ajouter un élément
---
[bottom_nav_slot_1]
Élément 1
---
[bottom_nav_slot_2]
Élément 2
---
[bottom_nav_slot_3]
Élément 3
---
[bottom_nav_slot_4]
Élément 4
---
[bottom_nav_slot_5]
Élément 5
---
[bottom_nav_slot_6]
Élément 6
---
[bottom_nav_slot_7]
Élément 7
---
[bottom_nav_slot_8]
Élément 8
---
[reset_button]
[habit_stats_day_plural]
%d jours
---[reset_button]
Réinitialiser
---
[practice_guide_dropdown]
@@ -884,9 +1021,6 @@ Choisissez votre pratique ici.
[practice_guide_manual]
Lisez le tutoriel avant de commencer une pratique afin de comprendre tout l'exercice.
---
[practice_guide_sun]
Utilisez l'onglet soleil lorsque vous etes pret a commencer l'exercice.
---
[practice_guide_config]
Modifiez la configuration de la pratique selon vos besoins.
---
@@ -902,6 +1036,18 @@ Choisissez Hebdomadaire ou Calendrier pour suivre votre habitude.
[habits_guide_statistics]
Consultez vos statistiques d'habitudes ici.
---
[profile_guide_account]
Configurez votre compte de synchronisation ici.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Ouvrez les amis et le classement ici.
---
[profile_guide_social_no_account]
Creez un compte de synchronisation pour debloquer les amis et le classement.
---
[nav_mode_label]
Navigation
---
@@ -913,16 +1059,13 @@ Onglets
---
[transition_label]
Transition
Effet
[transition_none]
None
Aucune
[transition_fade]
Fade
Fondu
[theme_picker_title]
Choose Theme
---
[notification_session_active]
Session active
Choisir un thème
---
[notification_starting_seconds]
Demarrage : %ds
@@ -936,5 +1079,6 @@ Retention : %ds
[notification_breath_in_seconds]
Inspirez : %ds
---
[notification_next_round]
Tour suivant
[notification_results]
Results
---
+201 -58
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Riwayat
---
[tab_profile]
Profil
---
[tab_habits]
Kebiasaan
---
@@ -22,6 +25,129 @@ Tandai
[tab_manual]
Manual
---
[tab_pet]
Pet
---
[profile_data_title]
Data
---
[profile_data_button]
Atur data
---
[profile_habits_label]
Kebiasaan
---
[profile_sessions_label]
Sesi
---
[profile_storage_label]
Penyimpanan
---
[profile_friends_title]
Teman
---
[profile_leaderboard_title]
Papan peringkat
---
[profile_metric_streak]
Rangkaian
---
[profile_metric_avg_time]
Waktu rata-rata
---
[profile_metric_avg_hold]
Tahan rata-rata
---
[profile_none_label]
Tidak ada
---
[profile_friend_accept_button]
Terima
---
[profile_friend_decline_button]
Tolak
---
[profile_friend_remove_title]
Hapus teman?
---
[profile_friend_remove_message]
%s akan dihapus. Kirim permintaan baru untuk terhubung lagi.
---
[profile_updating_status]
Memperbarui
---
[profile_no_account]
Tidak ada akun
---
[profile_account_section]
Akun
---
[profile_configure_button]
Atur
---
[profile_data_section]
Data
---
[profile_sync_section]
Sinkronisasi
---
[profile_friends_count_format]
%d teman
---
[profile_pending_count_format]
%d tertunda
---
[profile_social_section]
Sosial
---
[profile_add_friend_button]
Tambah teman
---
[profile_incoming_title]
Masuk
---
[profile_outgoing_title]
Keluar
---
[profile_no_leaderboard_data]
Tidak ada data papan peringkat
---
[profile_practice_label]
Latihan
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Pengaturan
---
@@ -157,6 +283,21 @@ Tidak dapat membuka file musik meditasi. Periksa koneksi internetmu, lalu coba l
[duration_2h]
2j
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
NAFAS
---
@@ -250,15 +391,12 @@ Tampilan
[settings_section_language]
Bahasa
---
[settings_tab_data]
Data
---
[settings_section_data]
Data
---
[settings_tab_about]
Tentang
---
[about_text]
Pendamping tenang untuk pernapasan, kebiasaan, dan sinkronisasi.
---
[theme_label]
Tema
---
@@ -305,10 +443,19 @@ Jeda setelah ronde
Kontrol sesi lanjutan
---
[double_tap_to_breathe_label]
Double tap to breathe
Ketuk dua kali untuk bernapas
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Ketuk layar dua kali untuk bernapas
---
[session_count_singular]
%d sesi
---
[session_count_plural]
%d sesi
---
[no_sessions]
Tidak ada sesi
---
[hold_display_label]
Tampilan tahan napas
@@ -656,8 +803,20 @@ Gunakan https:// atau loopback seperti localhost:8080
[sync_server_saved]
Server sinkronisasi disimpan
---
[sync_connected]
Sinkronisasi remote selesai
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Sinkronisasi remote gagal
@@ -734,14 +893,17 @@ Edit kebiasaan
[habit_name_label]
Nama
---
[habit_description_label]
Description
---
[habit_underline_label]
Garis bawah
---
[habit_practice_list_title]
Session Data From
Data sesi dari
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Pilih sesi latihan mana yang dihitung untuk kebiasaan ini. Hari yang cocok ditandai selesai dan dapat membuka editor sesi.
---
[habit_counting_title]
Penghitungan
@@ -776,6 +938,9 @@ Buat kebiasaan
[habit_stats_no_rounds_week]
Tidak ada ronde minggu lalu
---
[habit_stats_no_rounds_month]
Tidak ada ronde bulan lalu
---
[habit_stats_current_streak]
Rangkaian saat ini
---
@@ -800,40 +965,12 @@ Total tahan
[habit_stats_best_streak]
Rangkaian terbaik
---
[bottom_nav_customize_button]
Sesuaikan navigasi bawah
[habit_stats_day_singular]
%d hari
---
[bottom_nav_customize_title]
Navigasi bawah
---
[bottom_nav_add_button]
Tambah item
---
[bottom_nav_slot_1]
Item 1
---
[bottom_nav_slot_2]
Item 2
---
[bottom_nav_slot_3]
Item 3
---
[bottom_nav_slot_4]
Item 4
---
[bottom_nav_slot_5]
Item 5
---
[bottom_nav_slot_6]
Item 6
---
[bottom_nav_slot_7]
Item 7
---
[bottom_nav_slot_8]
Item 8
---
[reset_button]
[habit_stats_day_plural]
%d hari
---[reset_button]
Reset
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Pilih praktik Anda di sini.
[practice_guide_manual]
Baca tutorial sebelum memulai praktik agar Anda memahami seluruh latihan.
---
[practice_guide_sun]
Gunakan tab matahari saat Anda siap memulai latihan.
---
[practice_guide_config]
Ubah konfigurasi praktik agar sesuai dengan kebutuhan Anda.
---
@@ -860,24 +994,36 @@ Pilih Mingguan atau Kalender untuk meninjau kebiasaan.
[habits_guide_statistics]
Lihat statistik kebiasaan Anda di sini.
---
[profile_guide_account]
Atur akun sinkronisasi Anda di sini.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Buka teman dan papan peringkat dari sini.
---
[profile_guide_social_no_account]
Buat akun sinkronisasi untuk membuka teman dan papan peringkat.
---
[nav_mode_label]
Navigasi
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Tab
---
[transition_label]
Transition
Transisi
[transition_none]
None
Tidak ada
[transition_fade]
Fade
Pudar
[theme_picker_title]
Choose Theme
Pilih Tema
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Sesi aktif
---
[notification_starting_seconds]
Mulai: %ds
---
@@ -935,7 +1078,7 @@ Tahan: %ds
[notification_breath_in_seconds]
Tarik napas: %ds
---
[notification_next_round]
Ronde berikutnya
[notification_results]
Results
---
---
+203 -60
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Cronologia
---
[tab_profile]
Profilo
---
[tab_habits]
Abitudini
---
@@ -22,6 +25,129 @@ Segna Come Fatto
[tab_manual]
Manuale
---
[tab_pet]
Pet
---
[profile_data_title]
Dati
---
[profile_data_button]
Configura dati
---
[profile_habits_label]
Abitudini
---
[profile_sessions_label]
Sessioni
---
[profile_storage_label]
Archiviazione
---
[profile_friends_title]
Amici
---
[profile_leaderboard_title]
Classifica
---
[profile_metric_streak]
Serie
---
[profile_metric_avg_time]
Tempo medio
---
[profile_metric_avg_hold]
Tenuta media
---
[profile_none_label]
Nessuno
---
[profile_friend_accept_button]
Accetta
---
[profile_friend_decline_button]
Rifiuta
---
[profile_friend_remove_title]
Rimuovere amico?
---
[profile_friend_remove_message]
%s sara rimosso. Invia una nuova richiesta per riconnetterti.
---
[profile_updating_status]
Aggiornamento
---
[profile_no_account]
Nessun account
---
[profile_account_section]
Account
---
[profile_configure_button]
Configura
---
[profile_data_section]
Dati
---
[profile_sync_section]
Sincronizzazione
---
[profile_friends_count_format]
%d amici
---
[profile_pending_count_format]
%d in attesa
---
[profile_social_section]
Social
---
[profile_add_friend_button]
Aggiungi amico
---
[profile_incoming_title]
In arrivo
---
[profile_outgoing_title]
In uscita
---
[profile_no_leaderboard_data]
Nessun dato classifica
---
[profile_practice_label]
Pratica
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Impostazioni
---
@@ -157,6 +283,21 @@ Impossibile raggiungere il file musicale per la meditazione. Controlla la connes
[duration_2h]
2 ore
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRO
---
@@ -250,14 +391,11 @@ Aspetto
[settings_section_language]
Lingua
---
[settings_tab_data]
Dati
---
[settings_section_data]
Dati
---
[settings_tab_about]
Info
Informazioni
---
[about_text]
Un compagno discreto per respirazione, abitudini e sincronizzazione.
---
[theme_label]
Tema
@@ -359,10 +497,19 @@ Pausa dopo round
Controlli avanzati sessione
---
[double_tap_to_breathe_label]
Double tap to breathe
Doppio tap per respirare
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Tocca due volte lo schermo per respirare
---
[session_count_singular]
%d sessione
---
[session_count_plural]
%d sessioni
---
[no_sessions]
Nessuna sessione
---
[hold_display_label]
Visualizzazione trattenuta
@@ -377,7 +524,7 @@ Cerchio
Volume
---
[show_session_volume_control_label]
Mostra il controllo volume
Mostra controllo volume
---
[reset_to_defaults_label]
Ripristina predefiniti
@@ -656,8 +803,20 @@ Usa https:// o loopback come localhost:8080
[sync_server_saved]
Server di sincronizzazione salvato
---
[sync_connected]
Sincronizzazione remota completata
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Sincronizzazione remota fallita
@@ -734,14 +893,17 @@ Modifica abitudine
[habit_name_label]
Nome
---
[habit_description_label]
Description
---
[habit_underline_label]
Sottolineatura
---
[habit_practice_list_title]
Session Data From
Dati sessione da
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Scegli quali sessioni di pratica contano per questa abitudine. I giorni corrispondenti risultano completati e possono aprire l'editor della sessione.
---
[habit_counting_title]
Conteggio
@@ -776,6 +938,9 @@ Crea abitudine
[habit_stats_no_rounds_week]
Nessun round nell'ultima settimana
---
[habit_stats_no_rounds_month]
Nessun round nell'ultimo mese
---
[habit_stats_current_streak]
Serie attuale
---
@@ -800,40 +965,12 @@ Apnea totale
[habit_stats_best_streak]
Migliore serie
---
[bottom_nav_customize_button]
Personalizza navigazione inferiore
[habit_stats_day_singular]
%d giorno
---
[bottom_nav_customize_title]
Navigazione inferiore
---
[bottom_nav_add_button]
Aggiungi elemento
---
[bottom_nav_slot_1]
Elemento 1
---
[bottom_nav_slot_2]
Elemento 2
---
[bottom_nav_slot_3]
Elemento 3
---
[bottom_nav_slot_4]
Elemento 4
---
[bottom_nav_slot_5]
Elemento 5
---
[bottom_nav_slot_6]
Elemento 6
---
[bottom_nav_slot_7]
Elemento 7
---
[bottom_nav_slot_8]
Elemento 8
---
[reset_button]
[habit_stats_day_plural]
%d giorni
---[reset_button]
Ripristina
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Scegli qui la tua pratica.
[practice_guide_manual]
Leggi il tutorial prima di iniziare una pratica per capire l'esercizio completo.
---
[practice_guide_sun]
Usa la scheda con il sole quando sei pronto per iniziare l'esercizio.
---
[practice_guide_config]
Modifica la configurazione della pratica in base alle tue esigenze.
---
@@ -860,24 +994,36 @@ Scegli Settimanale o Calendario per rivedere l'abitudine.
[habits_guide_statistics]
Visualizza qui le statistiche delle abitudini.
---
[profile_guide_account]
Configura qui il tuo account di sincronizzazione.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Apri amici e classifica da qui.
---
[profile_guide_social_no_account]
Crea un account di sincronizzazione per sbloccare amici e classifica.
---
[nav_mode_label]
Navigazione
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Schede
---
[transition_label]
Transition
Transizione
[transition_none]
None
Nessuna
[transition_fade]
Fade
Dissolvenza
[theme_picker_title]
Choose Theme
Scegli tema
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Sessione attiva
---
[notification_starting_seconds]
Avvio: %ds
---
@@ -935,7 +1078,7 @@ Trattieni: %ds
[notification_breath_in_seconds]
Inspira: %ds
---
[notification_next_round]
Round successivo
[notification_results]
Results
---
---
+201 -58
View File
@@ -4,6 +4,9 @@
[tab_history]
履歴
---
[tab_profile]
プロフィール
---
[tab_habits]
習慣
---
@@ -22,6 +25,129 @@
[tab_manual]
チュートリアル
---
[tab_pet]
Pet
---
[profile_data_title]
データ
---
[profile_data_button]
データを設定
---
[profile_habits_label]
習慣
---
[profile_sessions_label]
セッション
---
[profile_storage_label]
ストレージ
---
[profile_friends_title]
フレンド
---
[profile_leaderboard_title]
ランキング
---
[profile_metric_streak]
連続日数
---
[profile_metric_avg_time]
平均時間
---
[profile_metric_avg_hold]
平均保持
---
[profile_none_label]
なし
---
[profile_friend_accept_button]
承認
---
[profile_friend_decline_button]
拒否
---
[profile_friend_remove_title]
フレンドを削除?
---
[profile_friend_remove_message]
%s を削除します。再接続には新しいリクエストが必要です。
---
[profile_updating_status]
更新中
---
[profile_no_account]
アカウントなし
---
[profile_account_section]
アカウント
---
[profile_configure_button]
設定
---
[profile_data_section]
データ
---
[profile_sync_section]
同期
---
[profile_friends_count_format]
%d人のフレンド
---
[profile_pending_count_format]
%d件保留中
---
[profile_social_section]
ソーシャル
---
[profile_add_friend_button]
フレンドを追加
---
[profile_incoming_title]
受信
---
[profile_outgoing_title]
送信
---
[profile_no_leaderboard_data]
ランキングデータなし
---
[profile_practice_label]
プラクティス
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
設定
---
@@ -157,6 +283,21 @@ Sun Salutation
[duration_2h]
2時間
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
呼吸
---
@@ -250,14 +391,11 @@ OK
[settings_section_language]
言語
---
[settings_tab_data]
データ
---
[settings_section_data]
データ
---
[settings_tab_about]
情報
アプリについて
---
[about_text]
呼吸、習慣、同期のための静かなパートナーです。
---
[theme_label]
テーマ
@@ -305,10 +443,19 @@ OK
詳細なセッション設定
---
[double_tap_to_breathe_label]
Double tap to breathe
ダブルタップで呼吸
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
画面をダブルタップして呼吸
---
[session_count_singular]
%dセッション
---
[session_count_plural]
%dセッション
---
[no_sessions]
セッションなし
---
[hold_display_label]
ホールド表示
@@ -656,8 +803,20 @@ https:// または localhost:8080 のようなループバックを使用して
[sync_server_saved]
同期サーバーを保存しました
---
[sync_connected]
リモート同期が完了しました
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
リモート同期に失敗しました
@@ -734,14 +893,17 @@ https:// または localhost:8080 のようなループバックを使用して
[habit_name_label]
名前
---
[habit_description_label]
Description
---
[habit_underline_label]
下線
---
[habit_practice_list_title]
Session Data From
セッションデータ
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
この習慣に含める練習セッションを選びます。一致する日は完了として表示され、セッション編集画面を開けます。
---
[habit_counting_title]
カウント
@@ -776,6 +938,9 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_no_rounds_week]
過去1週間にラウンドはありません
---
[habit_stats_no_rounds_month]
過去1か月にラウンドはありません
---
[habit_stats_current_streak]
現在の連続記録
---
@@ -800,40 +965,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
最長連続記録
---
[bottom_nav_customize_button]
下部ナビゲーションをカスタマイズ
[habit_stats_day_singular]
%d日
---
[bottom_nav_customize_title]
下部ナビゲーション
---
[bottom_nav_add_button]
項目を追加
---
[bottom_nav_slot_1]
項目1
---
[bottom_nav_slot_2]
項目2
---
[bottom_nav_slot_3]
項目3
---
[bottom_nav_slot_4]
項目4
---
[bottom_nav_slot_5]
項目5
---
[bottom_nav_slot_6]
項目6
---
[bottom_nav_slot_7]
項目7
---
[bottom_nav_slot_8]
項目8
---
[reset_button]
[habit_stats_day_plural]
%d日
---[reset_button]
リセット
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
[practice_guide_manual]
練習を始める前にチュートリアルを読んで、エクササイズ全体を理解してください。
---
[practice_guide_sun]
エクササイズを始める準備ができたら、太陽タブを使います。
---
[practice_guide_config]
自分に合うように練習の設定を変更できます。
---
@@ -860,6 +994,18 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habits_guide_statistics]
ここで習慣の統計を確認できます。
---
[profile_guide_account]
ここで同期アカウントを設定します。
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
ここからフレンドとランキングを開きます。
---
[profile_guide_social_no_account]
フレンドとランキングを使うには同期アカウントを作成してください。
---
[nav_mode_label]
ナビゲーション
---
@@ -871,13 +1017,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
切り替え
[transition_none]
None
なし
[transition_fade]
Fade
フェード
[theme_picker_title]
Choose Theme
テーマ選択
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
セッション中
---
[notification_starting_seconds]
開始: %d秒
---
@@ -935,7 +1078,7 @@ Alias saved
[notification_breath_in_seconds]
吸う: %d秒
---
[notification_next_round]
次のラウンド
[notification_results]
Results
---
---
+200 -57
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
기록
---
[tab_profile]
프로필
---
[tab_habits]
습관
---
@@ -22,6 +25,129 @@ Inner Breeze
[tab_manual]
튜토리얼
---
[tab_pet]
Pet
---
[profile_data_title]
데이터
---
[profile_data_button]
데이터 설정
---
[profile_habits_label]
습관
---
[profile_sessions_label]
세션
---
[profile_storage_label]
저장 공간
---
[profile_friends_title]
친구
---
[profile_leaderboard_title]
순위표
---
[profile_metric_streak]
연속 기록
---
[profile_metric_avg_time]
평균 시간
---
[profile_metric_avg_hold]
평균 유지
---
[profile_none_label]
없음
---
[profile_friend_accept_button]
수락
---
[profile_friend_decline_button]
거절
---
[profile_friend_remove_title]
친구 삭제?
---
[profile_friend_remove_message]
%s 님이 삭제됩니다. 다시 연결하려면 새 요청을 보내세요.
---
[profile_updating_status]
업데이트 중
---
[profile_no_account]
계정 없음
---
[profile_account_section]
계정
---
[profile_configure_button]
설정
---
[profile_data_section]
데이터
---
[profile_sync_section]
동기화
---
[profile_friends_count_format]
친구 %d명
---
[profile_pending_count_format]
대기 %d개
---
[profile_social_section]
소셜
---
[profile_add_friend_button]
친구 추가
---
[profile_incoming_title]
받은 요청
---
[profile_outgoing_title]
보낸 요청
---
[profile_no_leaderboard_data]
순위표 데이터 없음
---
[profile_practice_label]
연습
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
설정
---
@@ -157,6 +283,21 @@ Sun Salutation
[duration_2h]
2시간
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
호흡
---
@@ -250,15 +391,12 @@ Sun Salutation
[settings_section_language]
언어
---
[settings_tab_data]
데이터
---
[settings_section_data]
데이터
---
[settings_tab_about]
정보
---
[about_text]
호흡, 습관, 동기화를 위한 조용한 동반자입니다.
---
[theme_label]
테마
---
@@ -359,10 +497,19 @@ Sun Salutation
고급 세션 제어
---
[double_tap_to_breathe_label]
Double tap to breathe
두 번 탭해 호흡
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
화면을 두 번 탭해 호흡
---
[session_count_singular]
%d개 세션
---
[session_count_plural]
%d개 세션
---
[no_sessions]
세션 없음
---
[hold_display_label]
홀드 표시
@@ -655,8 +802,20 @@ https:// 또는 localhost:8080 같은 루프백을 사용하세요
[sync_server_saved]
동기화 서버 저장됨
---
[sync_connected]
원격 동기화 완료
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
원격 동기화 실패
@@ -733,14 +892,17 @@ https:// 또는 localhost:8080 같은 루프백을 사용하세요
[habit_name_label]
이름
---
[habit_description_label]
Description
---
[habit_underline_label]
밑줄
---
[habit_practice_list_title]
Session Data From
세션 데이터
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
이 습관에 포함할 연습 세션을 선택하세요. 일치하는 날은 완료로 표시되며 세션 편집기를 열 수 있습니다.
---
[habit_counting_title]
횟수
@@ -775,6 +937,9 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_no_rounds_week]
지난주 라운드 없음
---
[habit_stats_no_rounds_month]
지난달 라운드 없음
---
[habit_stats_current_streak]
현재 연속 기록
---
@@ -799,40 +964,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
최고 연속 기록
---
[bottom_nav_customize_button]
하단 내비게이션 사용자화
[habit_stats_day_singular]
%d일
---
[bottom_nav_customize_title]
하단 내비게이션
---
[bottom_nav_add_button]
항목 추가
---
[bottom_nav_slot_1]
항목 1
---
[bottom_nav_slot_2]
항목 2
---
[bottom_nav_slot_3]
항목 3
---
[bottom_nav_slot_4]
항목 4
---
[bottom_nav_slot_5]
항목 5
---
[bottom_nav_slot_6]
항목 6
---
[bottom_nav_slot_7]
항목 7
---
[bottom_nav_slot_8]
항목 8
---
[reset_button]
[habit_stats_day_plural]
%d일
---[reset_button]
초기화
---
[practice_guide_dropdown]
@@ -841,9 +978,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
[practice_guide_manual]
연습을 시작하기 전에 튜토리얼을 읽고 전체 운동을 이해하세요.
---
[practice_guide_sun]
운동을 시작할 준비가 되면 태양 탭을 사용하세요.
---
[practice_guide_config]
필요에 맞게 연습 설정을 변경하세요.
---
@@ -859,6 +993,18 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habits_guide_statistics]
여기에서 습관 통계를 확인하세요.
---
[profile_guide_account]
여기에서 동기화 계정을 설정하세요.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
여기에서 친구와 순위표를 엽니다.
---
[profile_guide_social_no_account]
친구와 순위표를 사용하려면 동기화 계정을 만드세요.
---
[nav_mode_label]
탐색
---
@@ -870,13 +1016,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
전환
[transition_none]
None
없음
[transition_fade]
Fade
페이드
[theme_picker_title]
Choose Theme
테마 선택
[skip_button]
Skip
---
@@ -919,9 +1065,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
세션 진행 중
---
[notification_starting_seconds]
시작: %d초
---
@@ -934,7 +1077,7 @@ Alias saved
[notification_breath_in_seconds]
들이쉬기: %d초
---
[notification_next_round]
다음 라운드
[notification_results]
Results
---
---
+202 -59
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
Histórico
---
[tab_profile]
Perfil
---
[tab_habits]
Hábitos
---
@@ -22,6 +25,129 @@ Marcar
[tab_manual]
Manual
---
[tab_pet]
Pet
---
[profile_data_title]
Dados
---
[profile_data_button]
Configurar dados
---
[profile_habits_label]
Habitos
---
[profile_sessions_label]
Sessoes
---
[profile_storage_label]
Armazenamento
---
[profile_friends_title]
Amigos
---
[profile_leaderboard_title]
Classificacao
---
[profile_metric_streak]
Sequencia
---
[profile_metric_avg_time]
Tempo medio
---
[profile_metric_avg_hold]
Retencao media
---
[profile_none_label]
Nenhum
---
[profile_friend_accept_button]
Aceitar
---
[profile_friend_decline_button]
Recusar
---
[profile_friend_remove_title]
Remover amigo?
---
[profile_friend_remove_message]
%s sera removido. Envie uma nova solicitacao para reconectar.
---
[profile_updating_status]
Atualizando
---
[profile_no_account]
Sem conta
---
[profile_account_section]
Conta
---
[profile_configure_button]
Configurar
---
[profile_data_section]
Dados
---
[profile_sync_section]
Sincronizacao
---
[profile_friends_count_format]
%d amigos
---
[profile_pending_count_format]
%d pendentes
---
[profile_social_section]
Social
---
[profile_add_friend_button]
Adicionar amigo
---
[profile_incoming_title]
Recebidos
---
[profile_outgoing_title]
Enviados
---
[profile_no_leaderboard_data]
Sem dados de classificacao
---
[profile_practice_label]
Pratica
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Configurações
---
@@ -157,6 +283,21 @@ Não foi possível acessar o arquivo de música de meditação. Verifique sua co
[duration_2h]
2 h
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
RESPIRAR
---
@@ -250,15 +391,12 @@ Aparência
[settings_section_language]
Idioma
---
[settings_tab_data]
Dados
---
[settings_section_data]
Dados
---
[settings_tab_about]
Sobre
---
[about_text]
Um companheiro tranquilo para respiracao, habitos e sincronizacao.
---
[theme_label]
Tema
---
@@ -305,10 +443,19 @@ Pausa após rodada
Controles avançados da sessão
---
[double_tap_to_breathe_label]
Double tap to breathe
Toque duplo para respirar
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Toque duas vezes na tela para respirar
---
[session_count_singular]
%d sessão
---
[session_count_plural]
%d sessões
---
[no_sessions]
Sem sessões
---
[hold_display_label]
Exibicao da retencao
@@ -549,7 +696,7 @@ Oceano
Floresta
---
[theme_sunset]
Pôr do sol
Poente
---
[theme_lavender]
Lavanda
@@ -656,8 +803,20 @@ Use https:// ou loopback como localhost:8080
[sync_server_saved]
Servidor de sincronização salvo
---
[sync_connected]
Sincronização remota concluída
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Falha na sincronização remota
@@ -734,14 +893,17 @@ Editar hábito
[habit_name_label]
Nome
---
[habit_description_label]
Description
---
[habit_underline_label]
Sublinhado
---
[habit_practice_list_title]
Session Data From
Dados de sessão
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Escolha quais sessões de prática contam para este hábito. Dias correspondentes aparecem como concluídos e podem abrir o editor de sessão.
---
[habit_counting_title]
Contagem
@@ -776,6 +938,9 @@ Criar hábito
[habit_stats_no_rounds_week]
Nenhuma rodada na última semana
---
[habit_stats_no_rounds_month]
Nenhuma rodada no último mês
---
[habit_stats_current_streak]
Sequência atual
---
@@ -800,40 +965,12 @@ Retenção total
[habit_stats_best_streak]
Melhor sequência
---
[bottom_nav_customize_button]
Personalizar navegação inferior
[habit_stats_day_singular]
%d dia
---
[bottom_nav_customize_title]
Navegação inferior
---
[bottom_nav_add_button]
Adicionar item
---
[bottom_nav_slot_1]
Item 1
---
[bottom_nav_slot_2]
Item 2
---
[bottom_nav_slot_3]
Item 3
---
[bottom_nav_slot_4]
Item 4
---
[bottom_nav_slot_5]
Item 5
---
[bottom_nav_slot_6]
Item 6
---
[bottom_nav_slot_7]
Item 7
---
[bottom_nav_slot_8]
Item 8
---
[reset_button]
[habit_stats_day_plural]
%d dias
---[reset_button]
Redefinir
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Escolha a sua pratica aqui.
[practice_guide_manual]
Leia o tutorial antes de iniciar uma pratica para entender o exercicio completo.
---
[practice_guide_sun]
Use a aba do sol quando estiver pronto para iniciar o exercicio.
---
[practice_guide_config]
Altere a configuracao da pratica de acordo com as suas necessidades.
---
@@ -860,24 +994,36 @@ Escolha Semanal ou Calendario para revisar seu habito.
[habits_guide_statistics]
Veja suas estatisticas de habitos aqui.
---
[profile_guide_account]
Configure sua conta de sincronizacao aqui.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Abra amigos e classificacao aqui.
---
[profile_guide_social_no_account]
Crie uma conta de sincronizacao para liberar amigos e classificacao.
---
[nav_mode_label]
Navegação
---
[nav_mode_dropdown]
Dropdown
Menu
---
[nav_mode_tabbar]
Abas
---
[transition_label]
Transition
Transição
[transition_none]
None
Nenhuma
[transition_fade]
Fade
Desvanecer
[theme_picker_title]
Choose Theme
Escolher tema
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Sessao ativa
---
[notification_starting_seconds]
Inicio: %ds
---
@@ -935,7 +1078,7 @@ Segure: %ds
[notification_breath_in_seconds]
Inspire: %ds
---
[notification_next_round]
Proxima rodada
[notification_results]
Results
---
---
+200 -57
View File
@@ -4,6 +4,9 @@ Inner Breeze
[tab_history]
История
---
[tab_profile]
Профиль
---
[tab_habits]
Привычки
---
@@ -22,6 +25,129 @@ Inner Breeze
[tab_manual]
Обучение
---
[tab_pet]
Pet
---
[profile_data_title]
Данные
---
[profile_data_button]
Настроить данные
---
[profile_habits_label]
Привычки
---
[profile_sessions_label]
Сессии
---
[profile_storage_label]
Хранилище
---
[profile_friends_title]
Друзья
---
[profile_leaderboard_title]
Рейтинг
---
[profile_metric_streak]
Серия
---
[profile_metric_avg_time]
Среднее время
---
[profile_metric_avg_hold]
Средняя задержка
---
[profile_none_label]
Нет
---
[profile_friend_accept_button]
Принять
---
[profile_friend_decline_button]
Отклонить
---
[profile_friend_remove_title]
Удалить друга?
---
[profile_friend_remove_message]
%s будет удален. Для связи отправьте новый запрос.
---
[profile_updating_status]
Обновление
---
[profile_no_account]
Нет аккаунта
---
[profile_account_section]
Аккаунт
---
[profile_configure_button]
Настроить
---
[profile_data_section]
Данные
---
[profile_sync_section]
Синхронизация
---
[profile_friends_count_format]
%d друзей
---
[profile_pending_count_format]
%d ожидают
---
[profile_social_section]
Социальное
---
[profile_add_friend_button]
Добавить друга
---
[profile_incoming_title]
Входящие
---
[profile_outgoing_title]
Исходящие
---
[profile_no_leaderboard_data]
Нет данных рейтинга
---
[profile_practice_label]
Практика
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
Настройки
---
@@ -160,6 +286,21 @@ Sun Salutation
[duration_2h]
2 ч
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
ДЫШАТЬ
---
@@ -253,15 +394,12 @@ OK
[settings_section_language]
Язык
---
[settings_tab_data]
Данные
---
[settings_section_data]
Данные
---
[settings_tab_about]
О приложении
---
[about_text]
Спокойный помощник для дыхания, привычек и синхронизации.
---
[theme_label]
Тема
---
@@ -362,10 +500,19 @@ OK
Расширенное управление сессией
---
[double_tap_to_breathe_label]
Double tap to breathe
Двойное касание для вдоха
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
Коснитесь экрана дважды, чтобы вдохнуть
---
[session_count_singular]
%d сессия
---
[session_count_plural]
%d сессий
---
[no_sessions]
Нет сессий
---
[hold_display_label]
Отображение задержки
@@ -656,8 +803,20 @@ liboqs не собран для этой платформы.
[sync_server_saved]
Сервер синхронизации сохранен
---
[sync_connected]
Удаленная синхронизация завершена
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
Удаленная синхронизация не удалась
@@ -734,14 +893,17 @@ liboqs не собран для этой платформы.
[habit_name_label]
Название
---
[habit_description_label]
Description
---
[habit_underline_label]
Подчеркивание
---
[habit_practice_list_title]
Session Data From
Данные сессий из
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
Выберите, какие сессии практик учитываются для этой привычки. Совпадающие дни отмечаются как выполненные и могут открыть редактор сессии.
---
[habit_counting_title]
Подсчет
@@ -776,6 +938,9 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_no_rounds_week]
За последнюю неделю раундов нет
---
[habit_stats_no_rounds_month]
За последний месяц раундов нет
---
[habit_stats_current_streak]
Текущая серия
---
@@ -800,40 +965,12 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_best_streak]
Лучшая серия
---
[bottom_nav_customize_button]
Настроить нижнюю навигацию
[habit_stats_day_singular]
%d день
---
[bottom_nav_customize_title]
Нижняя навигация
---
[bottom_nav_add_button]
Добавить пункт
---
[bottom_nav_slot_1]
Пункт 1
---
[bottom_nav_slot_2]
Пункт 2
---
[bottom_nav_slot_3]
Пункт 3
---
[bottom_nav_slot_4]
Пункт 4
---
[bottom_nav_slot_5]
Пункт 5
---
[bottom_nav_slot_6]
Пункт 6
---
[bottom_nav_slot_7]
Пункт 7
---
[bottom_nav_slot_8]
Пункт 8
---
[reset_button]
[habit_stats_day_plural]
%d дней
---[reset_button]
Сбросить
---
[practice_guide_dropdown]
@@ -842,9 +979,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
[practice_guide_manual]
Прочитайте руководство перед началом практики, чтобы понять упражнение полностью.
---
[practice_guide_sun]
Используйте вкладку с солнцем, когда будете готовы начать упражнение.
---
[practice_guide_config]
Измените настройки практики под свои требования.
---
@@ -860,6 +994,18 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habits_guide_statistics]
Здесь можно посмотреть статистику привычек.
---
[profile_guide_account]
Настройте аккаунт синхронизации здесь.
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
Откройте друзей и рейтинг здесь.
---
[profile_guide_social_no_account]
Создайте аккаунт синхронизации, чтобы открыть друзей и рейтинг.
---
[nav_mode_label]
Навигация
---
@@ -871,13 +1017,13 @@ Choose which practice sessions count for this habit. Matching days show as compl
---
[transition_label]
Transition
Переход
[transition_none]
None
Нет
[transition_fade]
Fade
Плавно
[theme_picker_title]
Choose Theme
Выбор темы
[skip_button]
Skip
---
@@ -920,9 +1066,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
Сессия активна
---
[notification_starting_seconds]
Старт: %dс
---
@@ -935,7 +1078,7 @@ Alias saved
[notification_breath_in_seconds]
Вдох: %dс
---
[notification_next_round]
Следующий раунд
[notification_results]
Results
---
---
+200 -57
View File
@@ -4,6 +4,9 @@
[tab_history]
历史
---
[tab_profile]
个人资料
---
[tab_habits]
习惯
---
@@ -22,6 +25,129 @@
[tab_manual]
教程
---
[tab_pet]
Pet
---
[profile_data_title]
数据
---
[profile_data_button]
配置数据
---
[profile_habits_label]
习惯
---
[profile_sessions_label]
会话
---
[profile_storage_label]
存储
---
[profile_friends_title]
好友
---
[profile_leaderboard_title]
排行榜
---
[profile_metric_streak]
连续记录
---
[profile_metric_avg_time]
平均时间
---
[profile_metric_avg_hold]
平均保持
---
[profile_none_label]
无
---
[profile_friend_accept_button]
接受
---
[profile_friend_decline_button]
拒绝
---
[profile_friend_remove_title]
删除好友?
---
[profile_friend_remove_message]
将删除 %s。重新连接需发送新请求。
---
[profile_updating_status]
正在更新
---
[profile_no_account]
没有账户
---
[profile_account_section]
账户
---
[profile_configure_button]
配置
---
[profile_data_section]
数据
---
[profile_sync_section]
同步
---
[profile_friends_count_format]
%d 位好友
---
[profile_pending_count_format]
%d 个待处理
---
[profile_social_section]
社交
---
[profile_add_friend_button]
添加好友
---
[profile_incoming_title]
收到
---
[profile_outgoing_title]
发出
---
[profile_no_leaderboard_data]
没有排行榜数据
---
[profile_practice_label]
练习
---
[profile_my_habits_button]
My habits
---
[profile_my_practices_button]
My practices
---
[profile_my_habits_title]
My habits
---
[profile_habits_section]
Habits
---
[profile_habits_today_format]
%d / %d done today
---
[profile_habit_done_today]
Done
---
[profile_habit_not_done_today]
Not done
---
[profile_manage_habits_button]
Manage habits
---
[profile_my_practices_title]
My practices
---
[move_up_button]
Up
---
[move_down_button]
Down
---
[tab_settings]
设置
---
@@ -157,6 +283,21 @@ Sun Salutation
[duration_2h]
2小时
---
[meditation_duration_setting]
Meditation length
---
[meditation_duration_custom]
Custom
---
[meditation_custom_minutes]
Custom time
---
[meditation_extend_controls_label]
Show add-time buttons during meditation
---
[finish_button]
Finish
---
[breath_button]
呼吸
---
@@ -250,15 +391,12 @@ Sun Salutation
[settings_section_language]
语言
---
[settings_tab_data]
数据
---
[settings_section_data]
数据
---
[settings_tab_about]
关于
---
[about_text]
用于呼吸、习惯和同步的安静伙伴。
---
[theme_label]
主题
---
@@ -305,10 +443,19 @@ Sun Salutation
高级练习控制
---
[double_tap_to_breathe_label]
Double tap to breathe
双击呼吸
---
[double_tap_to_breathe_hint]
Double tap screen to breathe
双击屏幕开始呼吸
---
[session_count_singular]
%d次会话
---
[session_count_plural]
%d次会话
---
[no_sessions]
没有会话
---
[hold_display_label]
屏息显示
@@ -654,8 +801,20 @@ liboqs 未为此目标构建。
[sync_server_saved]
同步服务器已保存
---
[sync_connected]
远程同步完成
[sync_review_needed]
Sync needs review
---
[sync_review_message]
Review data differences.
---
[sync_review_using_remote]
Using remote data
---
[sync_review_keeping_local]
Keeping local data
---
[sync_review_failed]
Sync review failed
---
[sync_failed]
远程同步失败
@@ -732,14 +891,17 @@ liboqs 未为此目标构建。
[habit_name_label]
名称
---
[habit_description_label]
Description
---
[habit_underline_label]
下划线
---
[habit_practice_list_title]
Session Data From
会话数据来自
---
[habit_practice_list_info]
Choose which practice sessions count for this habit. Matching days show as completed and can open the session editor.
选择哪些练习会话计入此习惯。匹配的日期会显示为已完成,并可打开会话编辑器。
---
[habit_counting_title]
计数
@@ -774,6 +936,9 @@ Choose which practice sessions count for this habit. Matching days show as compl
[habit_stats_no_rounds_week]
过去一周没有轮次
---
[habit_stats_no_rounds_month]
过去一个月没有轮次
---
[habit_stats_current_streak]
当前连续记录
---
@@ -798,40 +963,12 @@ Wim Hof 屏息轮次
[habit_stats_best_streak]
最佳连续记录
---
[bottom_nav_customize_button]
自定义底部导航
[habit_stats_day_singular]
%d天
---
[bottom_nav_customize_title]
底部导航
---
[bottom_nav_add_button]
添加项目
---
[bottom_nav_slot_1]
项目 1
---
[bottom_nav_slot_2]
项目 2
---
[bottom_nav_slot_3]
项目 3
---
[bottom_nav_slot_4]
项目 4
---
[bottom_nav_slot_5]
项目 5
---
[bottom_nav_slot_6]
项目 6
---
[bottom_nav_slot_7]
项目 7
---
[bottom_nav_slot_8]
项目 8
---
[reset_button]
[habit_stats_day_plural]
%d天
---[reset_button]
重置
---
[practice_guide_dropdown]
@@ -840,9 +977,6 @@ Wim Hof 屏息轮次
[practice_guide_manual]
开始练习前请先阅读教程,了解完整的练习流程。
---
[practice_guide_sun]
准备开始练习时,请使用太阳标签。
---
[practice_guide_config]
根据你的需要调整练习配置。
---
@@ -858,6 +992,18 @@ Wim Hof 屏息轮次
[habits_guide_statistics]
在这里查看习惯统计。
---
[profile_guide_account]
在这里配置同步账户。
---
[profile_guide_data]
Manage data, habit order, and visible practices here.
---
[profile_guide_social]
从这里打开好友和排行榜。
---
[profile_guide_social_no_account]
创建同步账户以解锁好友和排行榜。
---
[nav_mode_label]
导航
---
@@ -869,13 +1015,13 @@ Wim Hof 屏息轮次
---
[transition_label]
Transition
过渡
[transition_none]
None
无
[transition_fade]
Fade
淡入淡出
[theme_picker_title]
Choose Theme
选择主题
[skip_button]
Skip
---
@@ -918,9 +1064,6 @@ Save Alias
[sync_alias_saved]
Alias saved
---
[notification_session_active]
练习进行中
---
[notification_starting_seconds]
开始: %d秒
---
@@ -933,7 +1076,7 @@ Alias saved
[notification_breath_in_seconds]
吸气: %d秒
---
[notification_next_round]
下一轮
[notification_results]
Results
---
---
Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 658 B

+4 -3
View File
@@ -4,7 +4,7 @@ set -e
AVD_NAME="${1:-inbe-test}"
echo "📱 Creating AVD: $AVD_NAME (Pixel 8 Pro - Android 14)"
echo "📱 Creating AVD: $AVD_NAME (Pixel 8 Pro - Android 15, punch-hole test profile)"
# Check for Android SDK location
if [ -z "$ANDROID_SDK_ROOT" ] && [ -z "$ANDROID_HOME" ]; then
@@ -31,7 +31,7 @@ done
mkdir -p "$ANDROID_SDK_ROOT/system-images"
mkdir -p "$ANDROID_SDK_ROOT/avd"
ANDROID_API="${ANDROID_API:-34}"
ANDROID_API="${ANDROID_API:-35}"
SYSTEM_IMAGE_TYPE=""
ABI_TYPE=""
SOURCE_DIR=""
@@ -175,7 +175,8 @@ EOF
echo "✅ Done!"
echo " Device: Pixel 8 Pro"
echo " Android: 14 (API $ANDROID_API)"
echo " Android: 15 (API $ANDROID_API)"
echo " ABI: $ABI_DISPLAY"
echo " Cutout: punch-hole overlay enabled by scripts/emulator.sh after boot"
echo ""
echo " Run with: bash scripts/emulator.sh"
+32 -2
View File
@@ -12,6 +12,14 @@ fi
# Set up writable SDK location
PERSISTENT_SDK_ROOT="$HOME/.android-sdk-writable"
ORIGINAL_SDK_ROOT="${ANDROID_SDK_ROOT:-$ANDROID_HOME}"
mkdir -p "$PERSISTENT_SDK_ROOT"
for component in build-tools cmake cmdline-tools emulator licenses ndk platforms platform-tools tools; do
if [ -n "$ORIGINAL_SDK_ROOT" ] && [ -e "$ORIGINAL_SDK_ROOT/$component" ] && [ ! -e "$PERSISTENT_SDK_ROOT/$component" ]; then
ln -sf "$ORIGINAL_SDK_ROOT/$component" "$PERSISTENT_SDK_ROOT/$component"
fi
done
if [ -d "$PERSISTENT_SDK_ROOT" ] && [ -d "$PERSISTENT_SDK_ROOT/avd/$AVD_NAME.avd" ]; then
export ANDROID_SDK_ROOT="$PERSISTENT_SDK_ROOT"
@@ -37,6 +45,9 @@ if [ ! -x "$EMULATOR_CMD" ]; then
EMULATOR_CMD="$(command -v emulator)"
fi
EMULATOR_DIR="$(cd "$(dirname "$EMULATOR_CMD")" && pwd)"
EMULATOR_LD_LIBRARY_PATH="${ANDROID_EMULATOR_LD_LIBRARY_PATH:-$EMULATOR_DIR/lib64:$EMULATOR_DIR/lib64/qt/lib}"
# Check if emulator is already running
if "$ADB_CMD" devices | grep -q '^emulator-[0-9][0-9]*[[:space:]]*device'; then
echo "✅ Emulator already running"
@@ -44,14 +55,21 @@ if "$ADB_CMD" devices | grep -q '^emulator-[0-9][0-9]*[[:space:]]*device'; then
exit 0
fi
echo "🚀 Launching Pixel 8 Pro emulator (Android 14 API 34)..."
if LD_LIBRARY_PATH="$EMULATOR_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ldd "$EMULATOR_CMD" 2>/dev/null | grep -q "not found"; then
echo "❌ Emulator runtime libraries are missing."
echo " Re-enter the repo flake shell so the updated emulator LD_LIBRARY_PATH is active:"
echo " nix develop --impure"
exit 1
fi
echo "🚀 Launching Pixel 8 Pro emulator (Android 15 API 35)..."
# Set environment for emulator
unset ANDROID_HOME
export ANDROID_SDK_ROOT="$ANDROID_SDK_ROOT"
# Launch emulator in background with KVM acceleration
"$EMULATOR_CMD" @"$AVD_NAME" \
LD_LIBRARY_PATH="$EMULATOR_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$EMULATOR_CMD" @"$AVD_NAME" \
-gpu host \
-skin 1440x2960 \
-no-snapshot-load \
@@ -86,6 +104,18 @@ while ! "$ADB_CMD" -e shell getprop sys.boot_completed 2>/dev/null | grep -q "1"
done
echo "✅ Pixel 8 Pro emulator ready!"
echo "🎯 Enabling punch-hole display cutout overlay if available..."
if "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.hole"; then
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.hole || true
elif "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.corner"; then
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.corner || true
elif "$ADB_CMD" -e shell cmd overlay list 2>/dev/null | grep -q "com.android.internal.display.cutout.emulation.tall"; then
"$ADB_CMD" -e shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.tall || true
else
echo " No display cutout emulation overlay found on this image"
fi
echo ""
echo "📱 Device info:"
"$ADB_CMD" -e shell getprop ro.product.model
Binary file not shown.

Before

Width:  |  Height:  |  Size: 713 B

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+5 -3
View File
@@ -131,13 +131,15 @@
form.addEventListener("submit", async (event) => {
event.preventDefault();
const exportedKey = keyText.value.trim();
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
setStatus("error", "Upload the exported inbe-sync.key file.");
if (!exportedKey.startsWith("lyra-account-key-v1") &&
!exportedKey.startsWith("inbe-sync-key-v1") &&
!exportedKey.startsWith("account-key-v1")) {
setStatus("error", "Upload the exported account key file.");
return;
}
const userID = keyField(exportedKey, "public_id").toLowerCase();
if (!/^[0-9a-f]{64}$/.test(userID)) {
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
setStatus("error", "This key file does not include public_id. Export a new account key from the current app.");
return;
}
button.disabled = true;
+5 -3
View File
@@ -131,13 +131,15 @@
form.addEventListener("submit", async (event) => {
event.preventDefault();
const exportedKey = keyText.value.trim();
if (!exportedKey.startsWith("inbe-sync-key-v1")) {
setStatus("error", "Upload the exported inbe-sync.key file.");
if (!exportedKey.startsWith("lyra-account-key-v1") &&
!exportedKey.startsWith("inbe-sync-key-v1") &&
!exportedKey.startsWith("account-key-v1")) {
setStatus("error", "Upload the exported account key file.");
return;
}
const userID = keyField(exportedKey, "public_id").toLowerCase();
if (!/^[0-9a-f]{64}$/.test(userID)) {
setStatus("error", "This key file does not include public_id. Export a new inbe-sync.key from the current Inner Breeze app.");
setStatus("error", "This key file does not include public_id. Export a new account key from the current app.");
return;
}
button.disabled = true;
+123 -977
View File
File diff suppressed because it is too large. Load diff
+62 -16
View File
@@ -44,10 +44,26 @@ enum {
SETTINGS_TAB_SESSION = 0,
SETTINGS_TAB_DEVICE,
SETTINGS_TAB_THEME,
SETTINGS_TAB_DATA,
SETTINGS_TAB_ABOUT,
SETTINGS_TAB_COUNT
};
enum {
PROFILE_VIEW_MAIN = 0,
PROFILE_VIEW_DATA,
PROFILE_VIEW_SYNC_ACCOUNT,
PROFILE_VIEW_HABITS,
PROFILE_VIEW_PRACTICES,
};
enum {
PROFILE_TAB_OVERVIEW = 0,
PROFILE_TAB_FRIENDS,
PROFILE_TAB_LEADERBOARD,
PROFILE_TAB_DATA,
PROFILE_TAB_COUNT
};
enum {
PRACTICE_CATEGORY_MIND = 0,
PRACTICE_CATEGORY_YOGA,
@@ -75,11 +91,13 @@ typedef enum {
UIModalConfirmDeleteSyncAccount,
UIModalHabitPracticeListInfo,
UIModalHabitCountingInfo,
UIModalBottomNavConfig,
UIModalPracticeManual,
UIModalPracticeConfig,
UIModalThemePicker,
UIModalSyncReview,
UIModalSyncAlias,
UIModalSyncPublicId,
UIModalConfirmRemoveFriend,
} UIModalType;
typedef struct {
@@ -145,14 +163,14 @@ typedef enum AppMainTab {
typedef enum AppNavRoute {
APP_NAV_ROUTE_NONE = -1,
APP_NAV_ROUTE_PRACTICE = 0,
APP_NAV_ROUTE_PROFILE = 0,
APP_NAV_ROUTE_HABITS = 1,
APP_NAV_ROUTE_SETTINGS = 2,
APP_NAV_ROUTE_COUNT = 3,
APP_NAV_ROUTE_PRACTICE = 2,
APP_NAV_ROUTE_PET = 3,
APP_NAV_ROUTE_SETTINGS = 4,
APP_NAV_ROUTE_COUNT = 5,
} AppNavRoute;
#define APP_BOTTOM_NAV_MAX_ITEMS 8
typedef struct WhmPracticeState {
Texture2D image_1;
Texture2D image_2;
@@ -163,6 +181,10 @@ typedef struct MeditationPracticeState {
int duration_seconds;
int remaining_seconds;
int frame_ticks;
int complete_waiting;
int duration_mode;
int custom_minutes;
int show_extend_controls;
int music_enabled;
int music_shuffle;
int music_track;
@@ -187,6 +209,10 @@ typedef struct SunSalutationPracticeState {
int step_ticks;
} SunSalutationPracticeState;
typedef struct PetPreviewState {
Texture2D egg;
} PetPreviewState;
typedef struct HabitSessionEditState {
int scroll;
int active;
@@ -202,8 +228,11 @@ typedef struct HabitEditState {
int is_new;
int index;
int cursor;
int description_cursor;
int focused;
int description_focused;
char text[INBE_HABIT_NAME_SIZE];
char description[INBE_HABIT_DESCRIPTION_SIZE];
Color color;
int sync_mode;
int sync_activity;
@@ -224,6 +253,7 @@ struct InbeApp {
WhmPracticeState whm;
MeditationPracticeState meditation;
SunSalutationPracticeState sun_salutation;
PetPreviewState pet;
Texture2D font_shapes_texture;
Font locale_font;
Font locale_font_8;
@@ -244,7 +274,22 @@ struct InbeApp {
int settings_dirty;
int settings_save_delay_ticks;
int settings_tab;
int settings_data_view;
int profile_view;
int profile_tab;
int profile_tab_scroll;
int profile_scroll;
int profile_leaderboard_practice;
int profile_leaderboard_metric;
int profile_leaderboard_loaded;
int profile_friend_input_cursor;
int profile_friend_input_focused;
int profile_friends_loaded;
char profile_friend_input[80];
char profile_pending_friend_remove_id[80];
char profile_pending_friend_remove_name[96];
char profile_friends_json[8192];
char profile_friend_requests_json[8192];
char profile_leaderboard_json[8192];
int sync_server_url_cursor;
int sync_server_url_focused;
char sync_server_url[256];
@@ -268,7 +313,10 @@ struct InbeApp {
int tutorial_seen;
int habits_guide_step;
int habits_guide_seen;
int profile_guide_step;
int profile_guide_seen;
int exercise_manual_seen_mask;
int practice_visible_mask;
int theme_id;
int dark_mode;
@@ -278,12 +326,6 @@ struct InbeApp {
int transition_mode;
int android_orientation;
int main_tab;
int sidebar_open;
int pending_sidebar_route;
int bottom_nav_count;
int bottom_nav_routes[APP_BOTTOM_NAV_MAX_ITEMS];
int bottom_nav_draft_count;
int bottom_nav_draft_routes[APP_BOTTOM_NAV_MAX_ITEMS];
InbeHabits habits;
int habit_detail_index;
int habit_detail_day;
@@ -327,11 +369,14 @@ void app_update_draw(void *app, Rectangle viewport);
void app_destroy(void *app);
void app_switch_screen(InbeApp *app, int screen);
void app_leave_practice_config(InbeApp *app);
int app_draw_sidebar_toggle(InbeApp *app, int x, int y);
int app_content_top_reserved(const InbeApp *app);
int app_content_bottom_reserved(const InbeApp *app);
int app_toolbar_height(void);
int app_auto_sync(InbeApp *app);
void app_request_social_refresh(InbeApp *app);
void app_request_friend_send(InbeApp *app, const char *target);
void app_request_friend_accept(InbeApp *app, const char *request_id);
void app_request_friend_decline(InbeApp *app, const char *request_id);
void app_request_friend_remove(InbeApp *app, const char *friend_user_id);
int app_should_use_tab_bar(const InbeApp *app);
void app_play_sound(InbeApp *app, Sound sound, float scale);
Texture2D app_load_asset_texture(const char *name);
@@ -353,6 +398,7 @@ void mark_exercise_manual_seen(InbeApp *app, int exercise_type);
void sync_habits_for_activity(InbeApp *app, int exercise_type);
void draw_preview_inbe(Inbe *inbe, int center_x, int center_y);
#include "app_nav.h"
#include "app_settings.h"
#endif
+249
View File
@@ -0,0 +1,249 @@
#include "app_nav.h"
#include "app.h"
#include "flint_locale.h"
#include "flint_ui.h"
#include "screens/settings/settings_screen.h"
extern int view_width;
extern int view_height;
static int android_bottom_nav_height = 0;
void
app_set_android_bottom_nav_height(int height)
{
android_bottom_nav_height = height > 0 ? height : 0;
}
int
app_android_bottom_nav_height(void)
{
return android_bottom_nav_height;
}
static void
app_open_main_tab(InbeApp *app, int main_tab, int persist)
{
if(app == NULL)
return;
if(app->practice_tab == PRACTICE_TAB_CONFIG)
app_leave_practice_config(app);
app->main_tab = clampi(main_tab, APP_MAIN_TAB_HABITS, APP_MAIN_TAB_PRACTICE);
if(app->main_tab == APP_MAIN_TAB_PRACTICE)
app->practice_tab = PRACTICE_TAB_PLAY;
app_switch_screen(app, app->main_tab == APP_MAIN_TAB_HABITS
? InbeScreenHabits
: InbeScreenStart);
if(persist)
save_settings(app);
}
void
app_apply_nav_route(InbeApp *app, int route)
{
if(app == NULL)
return;
switch(route) {
case APP_NAV_ROUTE_PROFILE:
if(app->practice_tab == PRACTICE_TAB_CONFIG)
app_leave_practice_config(app);
app->profile_view = PROFILE_VIEW_MAIN;
app->profile_scroll = 0;
app->sync_server_url_focused = 0;
settings_screen_clear_status();
app_switch_screen(app, InbeScreenProfile);
break;
case APP_NAV_ROUTE_PRACTICE:
app_open_main_tab(app, APP_MAIN_TAB_PRACTICE, 1);
break;
case APP_NAV_ROUTE_HABITS:
app_open_main_tab(app, APP_MAIN_TAB_HABITS, 1);
if(app->habits.tab == HABIT_TAB_STATISTICS || app->habits.tab == HABIT_TAB_EDIT)
app->habits.tab = app->habits.view_mode == HABIT_VIEW_WEEKLY
? HABIT_TAB_WEEKLY
: HABIT_TAB_MONTHLY;
break;
case APP_NAV_ROUTE_SETTINGS:
if(app->practice_tab == PRACTICE_TAB_CONFIG)
app_leave_practice_config(app);
reset_settings_preview(app);
app->settings_tab = SETTINGS_TAB_SESSION;
app->settings_scroll = 0;
app_switch_screen(app, InbeScreenSettings);
break;
case APP_NAV_ROUTE_PET:
if(app->practice_tab == PRACTICE_TAB_CONFIG)
app_leave_practice_config(app);
app_switch_screen(app, InbeScreenPet);
break;
default:
break;
}
}
int
app_content_bottom_reserved(const InbeApp *app)
{
if(app == NULL)
return 0;
if(app_current_nav_route(app) == APP_NAV_ROUTE_NONE)
return 0;
return ui_bottom_nav_height();
}
int
app_page_height(const InbeApp *app, int full_height)
{
int bottom_reserved;
if(full_height <= 0)
return 0;
bottom_reserved = app_fullscreen_bottom_reserved(app);
if(bottom_reserved > 0 && bottom_reserved < full_height)
return full_height - bottom_reserved;
return full_height;
}
static int
app_has_fullscreen_overlay(const InbeApp *app)
{
if(app == NULL || !app->modal.active)
return 0;
return app->modal.type == UIModalPracticeManual ||
app->modal.type == UIModalPracticeConfig ||
app->modal.type == UIModalEditProgressiveStartSpeed;
}
static const char *
app_nav_route_label(int route)
{
switch(route) {
case APP_NAV_ROUTE_PROFILE: return locale_get("tab_profile");
case APP_NAV_ROUTE_HABITS: return locale_get("tab_habits");
case APP_NAV_ROUTE_PRACTICE: return locale_get("tab_practice");
case APP_NAV_ROUTE_PET: return locale_get("tab_pet");
case APP_NAV_ROUTE_SETTINGS: return locale_get("tab_settings");
default: break;
}
return "";
}
static Texture2D
app_nav_route_icon(InbeApp *app, int route)
{
if(app == NULL)
return (Texture2D){0};
switch(route) {
case APP_NAV_ROUTE_PROFILE: return app->icons[UI_ICON_TYPE_PROFILE];
case APP_NAV_ROUTE_HABITS: return app->icons[UI_ICON_TYPE_HABIT];
case APP_NAV_ROUTE_PRACTICE: return app->icons[UI_ICON_TYPE_AMEN];
case APP_NAV_ROUTE_PET: return app->icons[UI_ICON_TYPE_PET];
case APP_NAV_ROUTE_SETTINGS: return app->icons[UI_ICON_TYPE_GEAR];
default: break;
}
return (Texture2D){0};
}
int
app_current_nav_route(const InbeApp *app)
{
if(app == NULL)
return APP_NAV_ROUTE_NONE;
switch(app->inbe.screen) {
case InbeScreenProfile:
return APP_NAV_ROUTE_PROFILE;
case InbeScreenStart:
return APP_NAV_ROUTE_PRACTICE;
case InbeScreenHabits:
return APP_NAV_ROUTE_HABITS;
case InbeScreenPet:
return APP_NAV_ROUTE_PET;
case InbeScreenSettings:
return APP_NAV_ROUTE_SETTINGS;
default:
break;
}
return APP_NAV_ROUTE_NONE;
}
static int
app_nav_route_active(const InbeApp *app, int route)
{
if(app == NULL)
return 0;
if(route == APP_NAV_ROUTE_PROFILE)
return app->inbe.screen == InbeScreenProfile;
if(route == APP_NAV_ROUTE_PRACTICE)
return app->inbe.screen == InbeScreenStart;
if(route == APP_NAV_ROUTE_HABITS)
return app->inbe.screen == InbeScreenHabits ||
app->inbe.screen == InbeScreenHabitEdit ||
app->inbe.screen == InbeScreenHabitSessionEdit;
if(route == APP_NAV_ROUTE_PET)
return app->inbe.screen == InbeScreenPet;
if(route == APP_NAV_ROUTE_SETTINGS)
return app->inbe.screen == InbeScreenSettings;
return 0;
}
static int
app_should_draw_bottom_nav(const InbeApp *app)
{
if(app == NULL)
return 0;
if(app_has_fullscreen_overlay(app))
return 0;
return app_current_nav_route(app) != APP_NAV_ROUTE_NONE;
}
int
app_fullscreen_bottom_reserved(const InbeApp *app)
{
if(app == NULL)
return 0;
return app_android_bottom_nav_height();
}
void
app_draw_bottom_nav(InbeApp *app)
{
enum { BOTTOM_NAV_ROUTE_COUNT = 5 };
const int routes[BOTTOM_NAV_ROUTE_COUNT] = {
APP_NAV_ROUTE_PROFILE,
APP_NAV_ROUTE_HABITS,
APP_NAV_ROUTE_PRACTICE,
APP_NAV_ROUTE_PET,
APP_NAV_ROUTE_SETTINGS
};
FlintUIBottomNavItem items[BOTTOM_NAV_ROUTE_COUNT];
FlintUIBottomNavResult result;
if(app_android_bottom_nav_height() > 0)
DrawRectangle(0, view_height - app_android_bottom_nav_height(),
view_width, app_android_bottom_nav_height(), BLACK);
if(!app_should_draw_bottom_nav(app))
return;
for(int i = 0; i < BOTTOM_NAV_ROUTE_COUNT; i++) {
int route = routes[i];
items[i] = (FlintUIBottomNavItem){
route,
app_nav_route_label(route),
app_nav_route_icon(app, route),
app_nav_route_active(app, route),
app->modal.active
};
}
result = ui_draw_bottom_nav((FlintUIBottomNav){
.view_width = view_width,
.view_height = view_height,
.bottom_margin = app_android_bottom_nav_height(),
.count = BOTTOM_NAV_ROUTE_COUNT,
.items = items
});
if(result.clicked_route != APP_NAV_ROUTE_NONE)
app_apply_nav_route(app, result.clicked_route);
}
+15
View File
@@ -0,0 +1,15 @@
#ifndef INBE_APP_NAV_H
#define INBE_APP_NAV_H
#include "app_fwd.h"
int app_current_nav_route(const InbeApp *app);
int app_page_height(const InbeApp *app, int full_height);
int app_content_bottom_reserved(const InbeApp *app);
int app_fullscreen_bottom_reserved(const InbeApp *app);
void app_set_android_bottom_nav_height(int height);
int app_android_bottom_nav_height(void);
void app_draw_bottom_nav(InbeApp *app);
void app_apply_nav_route(InbeApp *app, int route);
#endif
+16 -27
View File
@@ -160,7 +160,9 @@ save_settings(InbeApp *app)
{"sound_volume", app->sound_volume},
{"tutorial_seen", app->tutorial_seen ? 1 : 0},
{"habits_guide_seen", app->habits_guide_seen ? 1 : 0},
{"profile_guide_seen", app->profile_guide_seen ? 1 : 0},
{"exercise_manual_seen_mask", app->exercise_manual_seen_mask},
{"practice_visible_mask", app->practice_visible_mask},
{"theme", app->theme_id},
{"dark_mode", app->dark_mode},
{"theme_mode", app->theme_mode},
@@ -170,15 +172,6 @@ save_settings(InbeApp *app)
{"main_tab", app->main_tab},
{"fullscreen", app->fullscreen_enabled ? 1 : 0},
{"on_screen_keyboard", app->on_screen_keyboard_enabled ? 1 : 0},
{"bottom_nav_count", app->bottom_nav_count},
{"bottom_nav_slot_0", app->bottom_nav_routes[0]},
{"bottom_nav_slot_1", app->bottom_nav_routes[1]},
{"bottom_nav_slot_2", app->bottom_nav_routes[2]},
{"bottom_nav_slot_3", app->bottom_nav_routes[3]},
{"bottom_nav_slot_4", app->bottom_nav_routes[4]},
{"bottom_nav_slot_5", app->bottom_nav_routes[5]},
{"bottom_nav_slot_6", app->bottom_nav_routes[6]},
{"bottom_nav_slot_7", app->bottom_nav_routes[7]},
{"progressive_speed", app->inbe.progressive_speed},
{"progressive_start_speed", app->inbe.progressive_start_speed},
{"breath_animation", app->inbe.breath_animation},
@@ -190,6 +183,9 @@ save_settings(InbeApp *app)
{"sun_salutation_repetitions", app->sun_salutation.repetitions},
{"sun_salutation_start_seconds", app->sun_salutation.start_seconds},
{"sun_salutation_end_seconds", app->sun_salutation.end_seconds},
{"meditation_duration_mode", app->meditation.duration_mode},
{"meditation_custom_minutes", app->meditation.custom_minutes},
{"meditation_show_extend_controls", app->meditation.show_extend_controls ? 1 : 0},
{"meditation_music_enabled", app->meditation.music_enabled ? 1 : 0},
{"meditation_music_shuffle", app->meditation.music_shuffle ? 1 : 0},
{"meditation_music_track", app->meditation.music_track},
@@ -264,6 +260,7 @@ app_load_settings(InbeApp *app)
LoadedBoolSetting settings[] = {
{&app->tutorial_seen, "tutorial_seen", 0},
{&app->habits_guide_seen, "habits_guide_seen", 0},
{&app->profile_guide_seen, "profile_guide_seen", 0},
{&app->dark_mode, "dark_mode", 0},
{&app->fullscreen_enabled, "fullscreen", 0},
#if ANDROID_BUILD
@@ -275,6 +272,7 @@ app_load_settings(InbeApp *app)
{&app->advanced_session_controls, "advanced_session_controls", 0},
{&app->double_tap_to_breathe, "double_tap_to_breathe", 0},
{&app->show_session_volume_control, "show_session_volume_control", 0},
{&app->meditation.show_extend_controls, "meditation_show_extend_controls", 1},
{&app->meditation.music_enabled, "meditation_music_enabled", 1},
{&app->meditation.music_shuffle, "meditation_music_shuffle", 0},
};
@@ -292,24 +290,6 @@ app_load_settings(InbeApp *app)
APP_ORIENTATION_SYSTEM, APP_ORIENTATION_SENSOR},
{&app->main_tab, "main_tab", APP_MAIN_TAB_PRACTICE,
APP_MAIN_TAB_HABITS, APP_MAIN_TAB_PRACTICE},
{&app->bottom_nav_count, "bottom_nav_count", 3,
0, APP_BOTTOM_NAV_MAX_ITEMS},
{&app->bottom_nav_routes[0], "bottom_nav_slot_0", APP_NAV_ROUTE_HABITS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[1], "bottom_nav_slot_1", APP_NAV_ROUTE_PRACTICE,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[2], "bottom_nav_slot_2", APP_NAV_ROUTE_SETTINGS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[3], "bottom_nav_slot_3", APP_NAV_ROUTE_SETTINGS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[4], "bottom_nav_slot_4", APP_NAV_ROUTE_HABITS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[5], "bottom_nav_slot_5", APP_NAV_ROUTE_PRACTICE,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[6], "bottom_nav_slot_6", APP_NAV_ROUTE_SETTINGS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->bottom_nav_routes[7], "bottom_nav_slot_7", APP_NAV_ROUTE_SETTINGS,
APP_NAV_ROUTE_PRACTICE, APP_NAV_ROUTE_SETTINGS},
{&app->inbe.progressive_start_speed, "progressive_start_speed",
DefaultProgressiveStartSpeed, SETTINGS_SPEED_MIN, SETTINGS_SPEED_MAX},
{&app->inbe.breath_animation, "breath_animation", InbeBreathAnimationLinear,
@@ -324,6 +304,10 @@ app_load_settings(InbeApp *app)
3, 12},
{&app->sun_salutation.end_seconds, "sun_salutation_end_seconds", 5,
3, 12},
{&app->meditation.duration_mode, "meditation_duration_mode", 1,
0, 5},
{&app->meditation.custom_minutes, "meditation_custom_minutes", 20,
1, 240},
{&app->meditation.music_track, "meditation_music_track", 0,
0, MEDITATION_MUSIC_TRACK_COUNT - 1},
{&app->practice_category_tab, "practice_category_tab", PRACTICE_CATEGORY_MIND,
@@ -340,6 +324,11 @@ app_load_settings(InbeApp *app)
if(manual_seen_mask < 0)
manual_seen_mask = app->tutorial_seen ? exercise_manual_bit(EXERCISE_WIM_HOF) : 0;
app->exercise_manual_seen_mask = manual_seen_mask & ((1 << EXERCISE_COUNT) - 1);
app->practice_visible_mask = storage_get_setting_int("practice_visible_mask",
(1 << EXERCISE_COUNT) - 1);
app->practice_visible_mask &= (1 << EXERCISE_COUNT) - 1;
if(app->practice_visible_mask == 0)
app->practice_visible_mask = (1 << EXERCISE_COUNT) - 1;
load_language_setting(app, settings_missing);
+810
View File
@@ -0,0 +1,810 @@
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#define NOGDI
#define NOUSER
#define MMNOSOUND
#define NOMINMAX
#include <windows.h>
#endif
#include "app_sync.h"
#include "profile_social.h"
#include "storage.h"
#include "sync_account.h"
#include "sync_client.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(PLATFORM_WEB)
#include <emscripten.h>
#elif !defined(_WIN32)
#include <pthread.h>
#include <unistd.h>
#endif
#define INBE_SYNC_SERVER_URL_KEY "sync_server_url"
#define INBE_SYNC_SERVER_URL_DEFAULT "https://api.waozi.xyz"
#define INBE_SYNC_INPUT_QUIET_SECONDS 0.45
typedef struct InbeSyncCoordinator {
double dirty_sync_at;
double last_input_at;
int sync_running;
int data_refresh_pending;
int social_refresh_pending;
int social_refresh_running;
int remote_sync_due;
char social_action[16];
char social_action_value[96];
} InbeSyncCoordinator;
static InbeSyncCoordinator g_sync = {0};
#if !defined(PLATFORM_WEB)
typedef struct InbeSyncWorkerArgs {
char url[256];
} InbeSyncWorkerArgs;
typedef struct InbeSocialWorkerArgs {
char url[256];
char practice[32];
char metric[32];
char leaderboard_key[96];
char action[16];
char action_value[96];
} InbeSocialWorkerArgs;
#if defined(_WIN32)
#define sync_thread_return DWORD WINAPI
#define sync_thread_done 0
#define sync_sleep(seconds) Sleep((DWORD)((seconds) * 1000))
#define sync_lock() AcquireSRWLockExclusive(&g_sync_mutex)
#define sync_unlock() ReleaseSRWLockExclusive(&g_sync_mutex)
typedef HANDLE SyncThread;
static SRWLOCK g_sync_mutex = SRWLOCK_INIT;
static int
sync_thread_start(SyncThread *thread, LPTHREAD_START_ROUTINE func, void *arg)
{
*thread = CreateThread(NULL, 0, func, arg, 0, NULL);
return *thread != NULL;
}
static void
sync_thread_detach(SyncThread thread)
{
CloseHandle(thread);
}
#else
#define sync_thread_return void *
#define sync_thread_done NULL
#define sync_sleep(seconds) sleep(seconds)
#define sync_lock() pthread_mutex_lock(&g_sync_mutex)
#define sync_unlock() pthread_mutex_unlock(&g_sync_mutex)
typedef pthread_t SyncThread;
static pthread_mutex_t g_sync_mutex = PTHREAD_MUTEX_INITIALIZER;
static int
sync_thread_start(SyncThread *thread, void *(*func)(void *), void *arg)
{
return pthread_create(thread, NULL, func, arg) == 0;
}
static void
sync_thread_detach(SyncThread thread)
{
pthread_detach(thread);
}
#endif
static int g_sync_finished = 0;
static int g_sync_finished_result = FLINT_LYRA_SYNC_OK;
static int g_sync_finished_changed = 0;
static int g_social_finished = 0;
static int g_social_finished_result = FLINT_LYRA_SYNC_OK;
static char g_social_friend_requests_json[8192];
static char g_social_friends_json[8192];
static char g_social_leaderboard_json[8192];
static char g_social_leaderboard_key[96];
static int g_sync_events_running = 0;
static char g_sync_events_url[256];
#else
static char g_sync_events_url[256];
static double g_sync_events_retry_at = 0.0;
#endif
static int app_sync_url(char *url, size_t url_size);
static int app_background_sync_safe(const InbeApp *app);
static int app_input_active(void);
static int app_sync_now(InbeApp *app);
static const char *app_modal_type_name(UIModalType type);
static const char *app_social_practice_id(int practice);
static const char *app_social_metric_id(int practice, int metric);
static void app_social_leaderboard_key(char *out, size_t out_size,
int practice, int metric);
static void
app_queue_social_refresh(void)
{
g_sync.social_refresh_pending = 1;
}
#if !defined(PLATFORM_WEB)
static sync_thread_return
app_sync_worker(void *userdata)
{
InbeSyncWorkerArgs *args = userdata;
FlintLyraSyncResult result = FLINT_LYRA_SYNC_INVALID_URL;
int changed = 0;
if(args != NULL) {
result = sync_client_sync(args->url);
changed = result == FLINT_LYRA_SYNC_OK && storage_last_sync_changed();
free(args);
}
sync_lock();
g_sync_finished_result = result;
g_sync_finished_changed = changed;
g_sync_finished = 1;
g_sync.sync_running = 0;
sync_unlock();
return sync_thread_done;
}
static sync_thread_return
app_social_worker(void *userdata)
{
InbeSocialWorkerArgs *args = userdata;
FlintLyraSyncResult result = FLINT_LYRA_SYNC_INVALID_URL;
FlintLyraSyncResult friends_result = FLINT_LYRA_SYNC_REQUEST_FAILED;
FlintLyraSyncResult leaderboard_result = FLINT_LYRA_SYNC_REQUEST_FAILED;
char requests_json[8192] = "{\"incoming\":[],\"outgoing\":[]}";
char friends_json[8192] = "{\"friends\":[]}";
char leaderboard_json[8192] = "{\"rows\":[]}";
if(args != NULL) {
if(strcmp(args->action, "send") == 0) {
result = sync_client_send_friend_request(args->url, args->action_value);
if(result != FLINT_LYRA_SYNC_OK)
goto done;
} else if(strcmp(args->action, "accept") == 0) {
result = sync_client_accept_friend_request(args->url, args->action_value);
if(result != FLINT_LYRA_SYNC_OK)
goto done;
} else if(strcmp(args->action, "decline") == 0) {
result = sync_client_decline_friend_request(args->url, args->action_value);
if(result != FLINT_LYRA_SYNC_OK)
goto done;
} else if(strcmp(args->action, "remove") == 0) {
result = sync_client_remove_friend(args->url, args->action_value);
if(result != FLINT_LYRA_SYNC_OK)
goto done;
}
result = sync_client_get_friend_requests(args->url, requests_json,
sizeof(requests_json));
if(result == FLINT_LYRA_SYNC_OK) {
friends_result = sync_client_get_friends(args->url, friends_json,
sizeof(friends_json));
leaderboard_result =
sync_client_get_friend_stats(args->url, "inbe", args->practice,
args->metric, leaderboard_json,
sizeof(leaderboard_json));
if(friends_result != FLINT_LYRA_SYNC_OK)
result = friends_result;
else if(leaderboard_result != FLINT_LYRA_SYNC_OK)
result = leaderboard_result;
}
}
done:
sync_lock();
g_social_finished_result = result;
snprintf(g_social_friend_requests_json, sizeof(g_social_friend_requests_json),
"%s", requests_json);
snprintf(g_social_friends_json, sizeof(g_social_friends_json), "%s",
friends_json);
snprintf(g_social_leaderboard_json, sizeof(g_social_leaderboard_json), "%s",
leaderboard_json);
snprintf(g_social_leaderboard_key, sizeof(g_social_leaderboard_key), "%s",
args != NULL ? args->leaderboard_key : "");
g_social_finished = 1;
g_sync.social_refresh_running = 0;
sync_unlock();
free(args);
return sync_thread_done;
}
static sync_thread_return
app_sync_events_worker(void *userdata)
{
InbeSyncWorkerArgs *args = userdata;
if(args == NULL)
return sync_thread_done;
for(;;) {
FlintLyraSyncResult result;
sync_lock();
if(g_sync.sync_running) {
sync_unlock();
sync_sleep(1);
continue;
}
sync_unlock();
result = sync_client_wait_for_remote_event(args->url);
sync_lock();
if(result == FLINT_LYRA_SYNC_OK)
g_sync.remote_sync_due = 1;
sync_unlock();
if(result != FLINT_LYRA_SYNC_OK)
sync_sleep(2);
}
return sync_thread_done;
}
#endif
static void
app_collect_finished_sync(void)
{
#if !defined(PLATFORM_WEB)
int finished;
int result;
int changed;
sync_lock();
finished = g_sync_finished;
result = g_sync_finished_result;
changed = g_sync_finished_changed;
g_sync_finished = 0;
sync_unlock();
if(!finished)
return;
#else
FlintLyraSyncResult result;
int changed = 0;
if(sync_client_web_poll_remote_event())
g_sync.remote_sync_due = 1;
if(!g_sync.sync_running)
return;
if(!sync_client_web_sync_poll(&result, &changed))
return;
g_sync.sync_running = 0;
#endif
if(result == FLINT_LYRA_SYNC_OK) {
TraceLog(LOG_INFO, "SYNC: background sync complete changed=%d", changed);
app_queue_social_refresh();
if(changed)
g_sync.data_refresh_pending = 1;
} else {
TraceLog(LOG_WARNING, "SYNC: background sync failed result=%d name=%s",
result, flint_lyra_sync_result_name(result));
}
}
static void
app_ensure_sync_events(const char *url)
{
#if !defined(PLATFORM_WEB)
SyncThread thread;
InbeSyncWorkerArgs *args;
if(url == NULL || url[0] == '\0')
return;
sync_lock();
if(g_sync_events_running && strcmp(g_sync_events_url, url) == 0) {
sync_unlock();
return;
}
if(g_sync_events_running) {
sync_unlock();
return;
}
g_sync_events_running = 1;
g_sync.remote_sync_due = 1;
snprintf(g_sync_events_url, sizeof(g_sync_events_url), "%s", url);
sync_unlock();
args = malloc(sizeof(*args));
if(args == NULL) {
sync_lock();
g_sync_events_running = 0;
g_sync_events_url[0] = '\0';
sync_unlock();
return;
}
snprintf(args->url, sizeof(args->url), "%s", url);
if(!sync_thread_start(&thread, app_sync_events_worker, args)) {
free(args);
sync_lock();
g_sync_events_running = 0;
g_sync_events_url[0] = '\0';
sync_unlock();
TraceLog(LOG_WARNING, "SYNC: failed to start websocket event thread");
return;
}
sync_thread_detach(thread);
TraceLog(LOG_INFO, "SYNC: websocket event listener started");
#else
double now;
if(url == NULL || url[0] == '\0')
return;
if(strcmp(g_sync_events_url, url) == 0) {
sync_client_web_start_remote_events(url);
return;
}
now = GetTime();
if(now < g_sync_events_retry_at)
return;
if(!sync_client_web_start_remote_events(url)) {
g_sync_events_retry_at = now + 2.0;
return;
}
g_sync.remote_sync_due = 1;
snprintf(g_sync_events_url, sizeof(g_sync_events_url), "%s", url);
TraceLog(LOG_INFO, "SYNC: websocket event listener started");
#endif
}
static int
app_background_sync_safe(const InbeApp *app)
{
if(app == NULL)
return 0;
if(app->modal.active)
return 0;
if(app->habit_edit.active ||
app->sync_server_url_focused ||
app->sync_alias_focused ||
app->profile_friend_input_focused)
return 0;
if(app->inbe.screen == InbeScreenPracticeSession ||
app->inbe.screen == InbeScreenMeditation ||
app->inbe.screen == InbeScreenSunSalutation)
return 0;
return 1;
}
static const char *
app_modal_type_name(UIModalType type)
{
switch(type) {
case UIModalNone: return "none";
case UIModalConfirmExitSession: return "confirm_exit_session";
case UIModalMeditationSetup: return "meditation_setup";
case UIModalConfirmDeleteData: return "confirm_delete_data";
case UIModalConfirmDeleteHabit: return "confirm_delete_habit";
case UIModalEditProgressiveStartSpeed: return "edit_progressive_start_speed";
case UIModalMeditationNetworkError: return "meditation_network_error";
case UIModalConfirmImportDataSettings: return "confirm_import_data_settings";
case UIModalSyncAccountBackup: return "sync_account_backup";
case UIModalConfirmDeleteSyncAccount: return "confirm_delete_sync_account";
case UIModalHabitPracticeListInfo: return "habit_practice_list_info";
case UIModalHabitCountingInfo: return "habit_counting_info";
case UIModalPracticeManual: return "practice_manual";
case UIModalPracticeConfig: return "practice_config";
case UIModalThemePicker: return "theme_picker";
case UIModalSyncReview: return "sync_review";
case UIModalSyncAlias: return "sync_alias";
case UIModalSyncPublicId: return "sync_public_id";
case UIModalConfirmRemoveFriend: return "confirm_remove_friend";
default: break;
}
return "unknown";
}
static int
app_input_active(void)
{
return IsMouseButtonDown(MOUSE_BUTTON_LEFT) ||
IsMouseButtonPressed(MOUSE_BUTTON_LEFT) ||
IsMouseButtonReleased(MOUSE_BUTTON_LEFT) ||
IsMouseButtonDown(MOUSE_BUTTON_RIGHT) ||
IsMouseButtonPressed(MOUSE_BUTTON_RIGHT) ||
IsMouseButtonReleased(MOUSE_BUTTON_RIGHT);
}
static void
app_apply_pending_sync_refresh(InbeApp *app)
{
if(!g_sync.data_refresh_pending || !app_background_sync_safe(app))
return;
g_sync.data_refresh_pending = 0;
TraceLog(LOG_INFO, "SYNC: applying remote refresh");
app_reload_after_import(app, 0);
}
static int
app_sync_url(char *url, size_t url_size)
{
const char *saved_url;
InbeSyncAccount account;
if(url == NULL || url_size == 0)
return 0;
url[0] = '\0';
if(!sync_account_load(&account))
return 0;
saved_url = storage_get_setting_text(INBE_SYNC_SERVER_URL_KEY);
if(!sync_client_normalize_url(saved_url != NULL && saved_url[0] != '\0'
? saved_url
: INBE_SYNC_SERVER_URL_DEFAULT,
url, url_size))
return 0;
return 1;
}
static const char *
app_social_practice_id(int practice)
{
switch(practice) {
case EXERCISE_MEDITATION:
return "meditation";
case EXERCISE_SUN_SALUTATION:
return "sun_salutation";
case EXERCISE_WIM_HOF:
default:
return "whm";
}
}
static const char *
app_social_metric_id(int practice, int metric)
{
if(metric != 1)
return "streak";
return practice == EXERCISE_MEDITATION ? "avg_time" : "avg_hold";
}
static void
app_social_leaderboard_key(char *out, size_t out_size, int practice, int metric)
{
if(out == NULL || out_size == 0)
return;
snprintf(out, out_size, "leaderboard.inbe.%s.%s",
app_social_practice_id(practice),
app_social_metric_id(practice, metric));
}
static void
app_apply_pending_social_refresh(InbeApp *app)
{
char url[256];
char action[16] = "";
char action_value[96] = "";
if(!g_sync.social_refresh_pending || !app_background_sync_safe(app))
return;
#if !defined(PLATFORM_WEB)
{
SyncThread thread;
InbeSocialWorkerArgs *args;
sync_lock();
if(g_sync.sync_running || g_sync.social_refresh_running) {
sync_unlock();
return;
}
snprintf(action, sizeof(action), "%s", g_sync.social_action);
snprintf(action_value, sizeof(action_value), "%s", g_sync.social_action_value);
g_sync.social_action[0] = '\0';
g_sync.social_action_value[0] = '\0';
g_sync.social_refresh_running = 1;
sync_unlock();
if(!app_sync_url(url, sizeof(url))) {
sync_lock();
g_sync.social_refresh_running = 0;
sync_unlock();
g_sync.social_refresh_pending = 0;
return;
}
args = malloc(sizeof(*args));
if(args == NULL) {
sync_lock();
g_sync.social_refresh_running = 0;
sync_unlock();
return;
}
snprintf(args->url, sizeof(args->url), "%s", url);
snprintf(args->practice, sizeof(args->practice), "%s",
app_social_practice_id(app->profile_leaderboard_practice));
snprintf(args->metric, sizeof(args->metric), "%s",
app_social_metric_id(app->profile_leaderboard_practice,
app->profile_leaderboard_metric));
app_social_leaderboard_key(args->leaderboard_key,
sizeof(args->leaderboard_key),
app->profile_leaderboard_practice,
app->profile_leaderboard_metric);
snprintf(args->action, sizeof(args->action), "%s", action);
snprintf(args->action_value, sizeof(args->action_value), "%s", action_value);
TraceLog(LOG_INFO, "SYNC: starting background social refresh");
if(!sync_thread_start(&thread, app_social_worker, args)) {
free(args);
sync_lock();
g_sync.social_refresh_running = 0;
sync_unlock();
TraceLog(LOG_WARNING, "SYNC: failed to start social refresh thread");
return;
}
sync_thread_detach(thread);
}
#else
TraceLog(LOG_INFO, "SYNC: refreshing social cache");
profile_social_refresh_cache(app);
#endif
g_sync.social_refresh_pending = 0;
}
#if !defined(PLATFORM_WEB)
static void
app_collect_finished_social_refresh(InbeApp *app)
{
int finished;
int result;
char requests_json[8192];
char friends_json[8192];
char leaderboard_json[8192];
char leaderboard_key[96];
sync_lock();
finished = g_social_finished;
result = g_social_finished_result;
if(finished) {
snprintf(requests_json, sizeof(requests_json), "%s",
g_social_friend_requests_json);
snprintf(friends_json, sizeof(friends_json), "%s", g_social_friends_json);
snprintf(leaderboard_json, sizeof(leaderboard_json), "%s",
g_social_leaderboard_json);
snprintf(leaderboard_key, sizeof(leaderboard_key), "%s",
g_social_leaderboard_key);
g_social_finished = 0;
}
sync_unlock();
if(!finished)
return;
if(result != FLINT_LYRA_SYNC_OK) {
TraceLog(LOG_WARNING, "SYNC: social refresh failed result=%d name=%s",
result, flint_lyra_sync_result_name(result));
return;
}
storage_set_social_cache_json("friends.requests", requests_json);
storage_set_social_cache_json("friends.list", friends_json);
if(leaderboard_key[0] != '\0')
storage_set_social_cache_json(leaderboard_key, leaderboard_json);
if(app != NULL) {
snprintf(app->profile_friend_requests_json,
sizeof(app->profile_friend_requests_json), "%s", requests_json);
snprintf(app->profile_friends_json, sizeof(app->profile_friends_json),
"%s", friends_json);
if(leaderboard_key[0] != '\0') {
char current_key[96];
app_social_leaderboard_key(current_key, sizeof(current_key),
app->profile_leaderboard_practice,
app->profile_leaderboard_metric);
if(strcmp(current_key, leaderboard_key) == 0)
snprintf(app->profile_leaderboard_json,
sizeof(app->profile_leaderboard_json), "%s",
leaderboard_json);
}
app->profile_friends_loaded = 1;
app->profile_leaderboard_loaded = 1;
}
TraceLog(LOG_INFO, "SYNC: social cache refreshed");
}
#else
static void
app_collect_finished_social_refresh(InbeApp *app)
{
(void)app;
}
#endif
void
app_request_social_refresh(InbeApp *app)
{
(void)app;
app_queue_social_refresh();
}
static void
app_request_social_action(const char *action, const char *value)
{
if(action == NULL || action[0] == '\0' || value == NULL || value[0] == '\0')
return;
#if !defined(PLATFORM_WEB)
sync_lock();
snprintf(g_sync.social_action, sizeof(g_sync.social_action), "%s", action);
snprintf(g_sync.social_action_value, sizeof(g_sync.social_action_value), "%s", value);
g_sync.social_refresh_pending = 1;
sync_unlock();
#else
g_sync.social_refresh_pending = 1;
#endif
}
void
app_request_friend_send(InbeApp *app, const char *target)
{
(void)app;
app_request_social_action("send", target);
}
void
app_request_friend_accept(InbeApp *app, const char *request_id)
{
(void)app;
app_request_social_action("accept", request_id);
}
void
app_request_friend_decline(InbeApp *app, const char *request_id)
{
(void)app;
app_request_social_action("decline", request_id);
}
void
app_request_friend_remove(InbeApp *app, const char *friend_user_id)
{
(void)app;
app_request_social_action("remove", friend_user_id);
}
static int
app_sync_now(InbeApp *app)
{
char url[256];
if(app == NULL || !app_sync_url(url, sizeof(url)))
return 0;
#if !defined(PLATFORM_WEB)
{
SyncThread thread;
InbeSyncWorkerArgs *args;
sync_lock();
if(g_sync.sync_running) {
sync_unlock();
return 0;
}
g_sync.sync_running = 1;
sync_unlock();
args = malloc(sizeof(*args));
if(args == NULL) {
sync_lock();
g_sync.sync_running = 0;
sync_unlock();
return 0;
}
snprintf(args->url, sizeof(args->url), "%s", url);
TraceLog(LOG_INFO, "SYNC: starting background sync");
if(!sync_thread_start(&thread, app_sync_worker, args)) {
free(args);
sync_lock();
g_sync.sync_running = 0;
sync_unlock();
TraceLog(LOG_WARNING, "SYNC: failed to start background sync thread");
return 0;
}
sync_thread_detach(thread);
return 1;
}
#else
if(g_sync.sync_running)
return 0;
g_sync.sync_running = 1;
TraceLog(LOG_INFO, "SYNC: starting background sync");
if(!sync_client_web_sync_start(url)) {
g_sync.sync_running = 0;
TraceLog(LOG_WARNING, "SYNC: failed to start background sync");
return 0;
}
return 1;
#endif
}
int
app_auto_sync(InbeApp *app)
{
double due;
double now;
char url[256];
if(app == NULL || !app_sync_url(url, sizeof(url)))
return 0;
now = GetTime();
g_sync.last_input_at = now;
due = now + INBE_SYNC_INPUT_QUIET_SECONDS;
if(g_sync.dirty_sync_at <= 0.0 || due < g_sync.dirty_sync_at)
g_sync.dirty_sync_at = due;
TraceLog(LOG_INFO, "SYNC: queued local changes");
return 1;
}
void
app_sync_pump(InbeApp *app)
{
double now;
int should_sync = 0;
int dirty_due = 0;
int repair_due = 0;
char url[256];
InbeStorageSyncStatus sync_status;
if(app == NULL)
return;
app_collect_finished_sync();
app_collect_finished_social_refresh(app);
if(storage_sync_review_pending() && app_background_sync_safe(app)) {
if(storage_sync_review_clear_if_no_visible_diff()) {
app_reload_after_import(app, 0);
} else {
app_open_modal(app, UIModalSyncReview);
}
}
app_apply_pending_sync_refresh(app);
app_apply_pending_social_refresh(app);
if(!app_sync_url(url, sizeof(url)))
return;
app_ensure_sync_events(url);
now = GetTime();
if(app_input_active())
g_sync.last_input_at = now;
if(g_sync.dirty_sync_at > 0.0 && now >= g_sync.dirty_sync_at) {
should_sync = 1;
dirty_due = 1;
}
if(storage_sync_status(&sync_status) && sync_status.has_account && sync_status.repair_pending &&
(g_sync.dirty_sync_at <= 0.0 || now >= g_sync.dirty_sync_at)) {
should_sync = 1;
repair_due = 1;
}
#if !defined(PLATFORM_WEB)
sync_lock();
#endif
if(g_sync.remote_sync_due) {
should_sync = 1;
g_sync.remote_sync_due = 0;
}
#if !defined(PLATFORM_WEB)
sync_unlock();
#endif
if(!should_sync)
return;
if(now < g_sync.last_input_at + INBE_SYNC_INPUT_QUIET_SECONDS) {
if(g_sync.dirty_sync_at <= 0.0)
g_sync.dirty_sync_at = g_sync.last_input_at + INBE_SYNC_INPUT_QUIET_SECONDS;
return;
}
if(!app_background_sync_safe(app)) {
TraceLog(LOG_INFO,
"SYNC: delayed; modal=%d type=%s screen=%d pending_review=%d tutorial_seen=%d habits_guide_seen=%d",
app->modal.active,
app_modal_type_name(app->modal.type),
app->inbe.screen,
storage_sync_review_pending(),
app->tutorial_seen,
app->habits_guide_seen);
if(g_sync.dirty_sync_at <= 0.0 || repair_due)
g_sync.dirty_sync_at = now + 1.0;
return;
}
if(app_sync_now(app)) {
if(dirty_due || repair_due)
g_sync.dirty_sync_at = 0.0;
TraceLog(LOG_INFO, "SYNC: dispatched");
} else if(dirty_due || repair_due) {
g_sync.dirty_sync_at = now + INBE_SYNC_INPUT_QUIET_SECONDS;
}
app_apply_pending_sync_refresh(app);
}
+8
View File
@@ -0,0 +1,8 @@
#ifndef INBE_APP_SYNC_H
#define INBE_APP_SYNC_H
#include "app.h"
void app_sync_pump(InbeApp *app);
#endif
+85
View File
@@ -0,0 +1,85 @@
#ifndef INBE_TEXT_UTILS_H
#define INBE_TEXT_UTILS_H
#include "flint_text.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
static inline void
inbe_text_fit_ellipsis(const char *text, char *out, size_t out_size, int max_w,
int font)
{
if(out == NULL || out_size == 0)
return;
if(text == NULL)
text = "";
snprintf(out, out_size, "%s", text);
if(max_w <= 0)
return;
while(out[0] != '\0' && flint_text_measure(out, font) > max_w) {
size_t len = strlen(out);
size_t cut = len;
if(len <= 3)
break;
if(len > 3 && strcmp(out + len - 3, "...") == 0)
len -= 3;
cut = len;
do {
cut--;
} while(cut > 0 && (((unsigned char)out[cut] & 0xC0) == 0x80));
out[cut] = '\0';
if(cut + 3 < out_size)
strncat(out, "...", out_size - strlen(out) - 1);
}
}
static inline const char *
inbe_text_fit_ellipsis_into(const char *text, char *out, size_t out_size, int max_w,
int font)
{
if(text == NULL)
text = "";
if(max_w > 0 && flint_text_measure(text, font) <= max_w)
return text;
inbe_text_fit_ellipsis(text, out, out_size, max_w, font);
return out;
}
static inline void
inbe_text_short_label(const char *text, int max_codepoints, int append_ellipsis,
char *out, size_t out_size)
{
size_t len;
size_t cut = 0;
int chars = 0;
int truncated = 0;
if(out == NULL || out_size == 0)
return;
if(text == NULL)
text = "";
if(max_codepoints < 0)
max_codepoints = 0;
len = strlen(text);
while(cut < len && chars < max_codepoints) {
cut++;
while(cut < len && (((unsigned char)text[cut] & 0xC0) == 0x80))
cut++;
chars++;
}
truncated = cut < len;
if(cut >= out_size) {
cut = out_size - 1;
while(cut > 0 && (((unsigned char)text[cut] & 0xC0) == 0x80))
cut--;
}
memcpy(out, text, cut);
out[cut] = '\0';
if(append_ellipsis && truncated && strlen(out) + 3 < out_size)
strncat(out, "...", out_size - strlen(out) - 1);
}
#endif
+2
View File
@@ -40,7 +40,9 @@ enum {
InbeScreenPracticeConfig,
InbeScreenLanguage,
InbeScreenManual,
InbeScreenProfile,
InbeScreenHabits,
InbeScreenPet,
InbeScreenHabitEdit,
InbeScreenHabitSessionEdit,
};
+3 -3
View File
@@ -2,8 +2,8 @@
#define INBE_VERSION_H
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 6
#define INBE_VERSION_PATCH 2
#define INBE_VERSION_STRING "1.6.2"
#define INBE_VERSION_MINOR 7
#define INBE_VERSION_PATCH 6
#define INBE_VERSION_STRING "1.7.6"
#endif
+15 -46
View File
@@ -173,9 +173,6 @@ windows_close_logger(void)
#endif
InbeApp* get_global_inbe_app(void) {
if (g_inbe_app_ptr == NULL) {
TraceLog(LOG_WARNING, "WARNING: get_global_inbe_app called with NULL pointer");
}
return g_inbe_app_ptr;
}
@@ -207,12 +204,6 @@ android_clamp_content_size(int size, int leading_inset, int trailing_inset)
return content_size;
}
static int
android_maxi(int a, int b)
{
return a > b ? a : b;
}
static int
android_nonnegative(int value)
{
@@ -224,34 +215,24 @@ android_resolve_viewport(int width, int height, AndroidInsets value)
{
static AndroidViewport last_logged = {-1, -1, -1, -1, -1, -1, -1, -1};
AndroidViewport viewport;
int status = android_nonnegative(value.status_bar);
int nav = android_nonnegative(value.nav_bar);
int cutout_left = android_nonnegative(value.cutout_left);
int cutout_top = android_nonnegative(value.cutout_top);
int cutout_right = android_nonnegative(value.cutout_right);
// cutout_bottom intentionally ignored - Android API is unreliable
int min_content_h = height / 2;
int nav_bar = android_nonnegative(value.nav_bar);
int content_top = android_nonnegative(value.status_bar);
int cutout_top = android_nonnegative(value.cutout_top);
if(cutout_top > content_top)
content_top = cutout_top;
viewport.left = cutout_left;
viewport.right = cutout_right;
viewport.top = android_maxi(cutout_top, status);
// Ignore cutout_bottom - Android's getDisplayCutout() API is unreliable and
// incorrectly reports bottom cutout values. Real cutouts are notches/camera
// holes at the top, not the bottom. The bottom inset should only be nav bar.
viewport.bottom = nav;
if(min_content_h < 1)
min_content_h = 1;
if(viewport.top + viewport.bottom >= height - min_content_h) {
viewport.top = cutout_top;
// Keep nav bar for bottom, don't use unreliable cutout_bottom
viewport.bottom = nav;
}
viewport.top = content_top;
viewport.bottom = 0;
viewport.x = viewport.left;
viewport.y = viewport.top;
viewport.width = android_clamp_content_size(width, viewport.left, viewport.right);
viewport.height = android_clamp_content_size(height, viewport.top, viewport.bottom);
viewport.height = height - viewport.top;
if(viewport.width <= 0) {
viewport.x = 0;
@@ -267,8 +248,9 @@ android_resolve_viewport(int width, int height, AndroidInsets value)
viewport.top != last_logged.top || viewport.bottom != last_logged.bottom ||
viewport.left != last_logged.left || viewport.right != last_logged.right) {
TraceLog(LOG_INFO,
"ANDROID_VIEWPORT: screen=%dx%d viewport=%d,%d %dx%d insets l=%d t=%d r=%d b=%d",
width, height, viewport.x, viewport.y, viewport.width, viewport.height,
"ANDROID_VIEWPORT: surface=%dx%d top=%d nav=%d viewport=%d,%d %dx%d insets l=%d t=%d r=%d b=%d",
width, height, content_top, nav_bar,
viewport.x, viewport.y, viewport.width, viewport.height,
viewport.left, viewport.top, viewport.right, viewport.bottom);
last_logged = viewport;
}
@@ -305,17 +287,7 @@ frame(void)
int width = GetScreenWidth();
int height = GetScreenHeight();
#if ANDROID_BUILD
struct android_app *android_app = GetAndroidApp();
if(android_app != NULL && android_app->window != NULL) {
int window_width = ANativeWindow_getWidth(android_app->window);
int window_height = ANativeWindow_getHeight(android_app->window);
if(window_width > 0)
width = window_width;
if(window_height > 0)
height = window_height;
}
#elif !defined(PLATFORM_WEB)
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
int render_width = GetRenderWidth();
int render_height = GetRenderHeight();
@@ -330,12 +302,10 @@ frame(void)
static AndroidViewport previous_viewport = {-1, -1, -1, -1, -1, -1, -1, -1};
android_insets_get(&insets);
// Safety check: Don't render if insets haven't been initialized yet
// This prevents rendering with incorrect positioning on app start/restart
if (!android_insets_is_initialized()) {
return; // Skip this frame, BeginDrawing() hasn't been called yet
return;
}
app_set_android_bottom_nav_height(android_nonnegative(insets.nav_bar));
viewport = android_resolve_viewport(width, height, insets);
if(viewport.x != previous_viewport.x || viewport.y != previous_viewport.y ||
@@ -620,7 +590,6 @@ int main(int argc, char **argv) {
android_insets_init();
android_device_init();
android_wakelock_init();
android_timer_init();
android_runtime_assets_init();
if(!ChangeDirectory("/data/user/0/xyz.waozi.inbe/files"))
TraceLog(LOG_WARNING, "INBE: failed to switch to Android files directory");
+21 -81
View File
@@ -11,13 +11,10 @@
#include <raylib.h>
#include <pthread.h>
#include <android_native_app_glue.h>
#include <jni.h>
#include <android/log.h>
// External functions from main.c
extern InbeApp* get_global_inbe_app(void);
extern void set_global_inbe_app(InbeApp *app);
extern void app_request_graphics_reload(InbeApp *app);
#define LOG_TAG "INBE_INSETS"
@@ -26,21 +23,15 @@ extern void app_request_graphics_reload(InbeApp *app);
#define JNI_VERSION_1_6 0x10060000
#endif
extern struct android_app *GetAndroidApp(void);
extern void android_wakelock_set_activity(JNIEnv *env, jobject activity);
extern void android_wakelock_set_jvm(JavaVM *vm);
extern void android_timer_activate(void);
extern void android_timer_deactivate(void);
// Called from Java when activity is ready for wake lock
static void android_wakelock_set_activity_impl(JNIEnv *env, jobject thiz) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Wake lock ready callback from Java");
android_wakelock_set_activity(env, thiz);
}
static JavaVM *g_jvm = NULL;
static jobject g_activity = NULL;
static volatile struct {
int status_bar;
int nav_bar;
@@ -52,12 +43,12 @@ static volatile struct {
static pthread_mutex_t insets_mutex = PTHREAD_MUTEX_INITIALIZER;
static volatile int insets_initialized = 0;
// JNI function - Java calls this to push inset values
static void nativeSetInsets(JNIEnv *env, jobject thiz,
jint status_bar, jint nav_bar,
jint cutout_left, jint cutout_top, jint cutout_right, jint cutout_bottom)
{
TraceLog(LOG_INFO, "INBE: Java insets: status=%d, nav=%d, cutout_top=%d",
TraceLog(LOG_INFO,
"INBE: Java insets: status=%d nav=%d cutout_top=%d",
status_bar, nav_bar, cutout_top);
pthread_mutex_lock(&insets_mutex);
@@ -69,29 +60,14 @@ static void nativeSetInsets(JNIEnv *env, jobject thiz,
current_insets.cutout_bottom = cutout_bottom;
insets_initialized = 1;
pthread_mutex_unlock(&insets_mutex);
// Memory barrier to ensure all threads see the updated values
__sync_synchronize();
}
// JNI function - Java calls this to check if play_in_background is enabled
static jint nativeGetPlayInBackground(JNIEnv *env, jobject thiz)
{
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeGetPlayInBackground: called");
void *app = get_global_inbe_app();
char msg[128];
snprintf(msg, sizeof(msg), "nativeGetPlayInBackground: got app pointer %p", app);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
if (app != NULL) {
InbeApp *inbe_app = (InbeApp*)app;
jint result = get_play_in_background(&inbe_app->inbe);
char msg[128];
snprintf(msg, sizeof(msg), "nativeGetPlayInBackground: returning %d", result);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
return result;
}
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeGetPlayInBackground: app is NULL, returning 0");
return 0; // Default to disabled
if(app == NULL)
return 0;
return get_play_in_background(&((InbeApp*)app)->inbe);
}
static void nativeSetBackgroundActive(JNIEnv *env, jobject thiz, jboolean active)
@@ -106,71 +82,45 @@ static void nativeSetBackgroundActive(JNIEnv *env, jobject thiz, jboolean active
}
if (active) {
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeSetBackgroundActive: activating background timer");
android_timer_activate();
} else {
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeSetBackgroundActive: deactivating background timer");
android_timer_deactivate();
}
}
// JNI function - Auto-pause session when app goes to background
static jint nativePauseSession(JNIEnv *env, jobject thiz)
{
(void)env;
(void)thiz;
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativePauseSession: called");
void *app = get_global_inbe_app();
char msg[128];
snprintf(msg, sizeof(msg), "nativePauseSession: got app pointer %p", app);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
if (app != NULL) {
InbeApp *inbe_app = (InbeApp*)app;
char msg[128];
snprintf(msg, sizeof(msg), "nativePauseSession: session_paused before = %d", inbe_app->session_paused);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
if (!inbe_app->session_paused) {
inbe_app->session_paused = 1;
inbe_app->backgrounded = 1;
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativePauseSession: set session_paused = 1");
return 1;
} else {
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativePauseSession: Session already paused, skipping");
}
} else {
InbeApp *inbe_app = get_global_inbe_app();
if (inbe_app == NULL) {
__android_log_write(ANDROID_LOG_ERROR, "INBE_JNI", "nativePauseSession: app is NULL!");
return 0;
}
if (inbe_app->session_paused)
return 0;
return 0;
inbe_app->session_paused = 1;
inbe_app->backgrounded = 1;
return 1;
}
// JNI function - Auto-resume session when app returns to foreground
static void nativeResumeSession(JNIEnv *env, jobject thiz)
{
(void)env;
(void)thiz;
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeResumeSession: called");
void *app = get_global_inbe_app();
char msg[128];
snprintf(msg, sizeof(msg), "nativeResumeSession: got app pointer %p", app);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
if (app != NULL) {
InbeApp *inbe_app = (InbeApp*)app;
char msg[128];
snprintf(msg, sizeof(msg), "nativeResumeSession: session_paused before = %d", inbe_app->session_paused);
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", msg);
if (inbe_app->session_paused) {
inbe_app->session_paused = 0;
inbe_app->backgrounded = 0;
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeResumeSession: set session_paused = 0");
} else {
__android_log_write(ANDROID_LOG_INFO, "INBE_JNI", "nativeResumeSession: Session not paused, skipping");
}
} else {
InbeApp *inbe_app = get_global_inbe_app();
if (inbe_app == NULL) {
__android_log_write(ANDROID_LOG_ERROR, "INBE_JNI", "nativeResumeSession: app is NULL!");
return;
}
if (!inbe_app->session_paused)
return;
inbe_app->session_paused = 0;
inbe_app->backgrounded = 0;
}
static void nativeInvalidateGraphicsResources(JNIEnv *env, jobject thiz)
@@ -183,7 +133,6 @@ static void nativeInvalidateGraphicsResources(JNIEnv *env, jobject thiz)
app_request_graphics_reload(inbe_app);
}
// JNI method table
static const JNINativeMethod g_methods[] = {
{"nativeSetInsets", "(IIIIII)V", (void*)nativeSetInsets},
{"nativeWakeLockReady", "()V", (void*)android_wakelock_set_activity_impl},
@@ -204,15 +153,11 @@ static const JNINativeMethod g_methods[] = {
{"nativeInvalidateGraphicsResources", "()V", (void*)nativeInvalidateGraphicsResources},
};
// JNI_OnLoad - Register native methods
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
JNIEnv *env = NULL;
jint result;
g_jvm = vm;
// Also set JVM for wake lock module
android_wakelock_set_jvm(vm);
result = (*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6);
@@ -221,14 +166,12 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
return result;
}
// Find the MainActivity class
jclass clazz = (*env)->FindClass(env, "xyz/waozi/inbe/MainActivity");
if (clazz == NULL) {
TraceLog(LOG_ERROR, "INBE: Failed to find MainActivity class");
return JNI_ERR;
}
// Register native methods
result = (*env)->RegisterNatives(env, clazz, g_methods, sizeof(g_methods) / sizeof(g_methods[0]));
if (result != JNI_OK) {
TraceLog(LOG_ERROR, "INBE: Failed to register native methods");
@@ -239,18 +182,15 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
}
void android_insets_init(void) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== android_insets_init ===");
pthread_mutex_lock(&insets_mutex);
memset((void *)&current_insets, 0, sizeof(current_insets));
insets_initialized = 0;
pthread_mutex_unlock(&insets_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== android_insets_init DONE ===");
}
void android_insets_get(AndroidInsets *out) {
pthread_mutex_lock(&insets_mutex);
// Simply return the current values
if (out) {
out->status_bar = current_insets.status_bar;
out->nav_bar = current_insets.nav_bar;
+4 -40
View File
@@ -10,7 +10,7 @@
#define LOG_TAG "INBE_TIMER"
#define TARGET_FPS 60
#define FRAME_TIME_US (1000000 / TARGET_FPS) // ~16666 microseconds for 60fps
#define FRAME_TIME_US (1000000 / TARGET_FPS)
static pthread_t timer_thread;
static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -44,47 +44,37 @@ monotonic_elapsed_ms(struct timespec *last_tick)
static void*
timer_thread_func(void *arg) {
(void)arg;
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer thread started");
int frame_count = 0;
struct timespec last_tick = {0};
while (1) {
pthread_mutex_lock(&timer_mutex);
// Check if we should stop
if (!timer_running) {
pthread_mutex_unlock(&timer_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer thread: stopping");
break;
}
// Check if we should run (active and have app pointer)
int should_run = timer_active && g_app != NULL;
pthread_mutex_unlock(&timer_mutex);
if (should_run) {
// Log every 60 frames (1 second)
if (frame_count % 60 == 0) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer: Running background practice step + sounds");
}
frame_count++;
// Update practice state and sounds with mutex protection
pthread_mutex_lock(&inbe_state_mutex);
InbeApp *app = (InbeApp*)g_app;
practice_active_advance_elapsed(app, monotonic_elapsed_ms(&last_tick));
pthread_mutex_unlock(&inbe_state_mutex);
// Sleep for exact frame time (60fps = ~16.666ms)
usleep(FRAME_TIME_US);
} else {
// Not active, sleep a bit before checking again
if (frame_count > 0) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer: Paused (inactive)");
frame_count = 0;
}
last_tick = (struct timespec){0};
usleep(50000); // 50ms
usleep(50000);
}
}
@@ -92,17 +82,11 @@ timer_thread_func(void *arg) {
return NULL;
}
void
android_timer_init(void) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== android_timer_init ===");
}
void
android_timer_set_app(void *app_ptr) {
pthread_mutex_lock(&timer_mutex);
g_app = app_ptr;
pthread_mutex_unlock(&timer_mutex);
TraceLog(LOG_INFO, "INBE: Timer app pointer set");
}
pthread_mutex_t*
@@ -115,24 +99,19 @@ android_timer_start(void) {
pthread_mutex_lock(&timer_mutex);
if (timer_running) {
timer_active = 1; // Activate timer (activity paused)
timer_active = 1;
pthread_mutex_unlock(&timer_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer activated (activity paused)");
return;
}
timer_running = 1;
timer_active = 0; // Start inactive (activity active)
timer_active = 0;
pthread_mutex_unlock(&timer_mutex);
int result = pthread_create(&timer_thread, NULL, timer_thread_func, NULL);
if (result != 0) {
__android_log_write(ANDROID_LOG_ERROR, LOG_TAG, "Failed to create timer thread");
} else {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Timer thread created");
}
TraceLog(LOG_INFO, "INBE: Background timer started");
}
void
@@ -152,7 +131,6 @@ android_timer_stop(void) {
pthread_detach(timer_thread);
else
pthread_join(timer_thread, NULL);
TraceLog(LOG_INFO, "INBE: Background timer stopped");
}
void
@@ -160,8 +138,6 @@ android_timer_activate(void) {
pthread_mutex_lock(&timer_mutex);
timer_active = 1;
pthread_mutex_unlock(&timer_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "ACTIVATE: Timer active");
TraceLog(LOG_INFO, "INBE: Background timer ACTIVATED - screen off");
}
void
@@ -169,16 +145,4 @@ android_timer_deactivate(void) {
pthread_mutex_lock(&timer_mutex);
timer_active = 0;
pthread_mutex_unlock(&timer_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "DEACTIVATE: Timer inactive");
TraceLog(LOG_INFO, "INBE: Background timer DEACTIVATED - screen on");
}
void*
android_timer_get_app(void)
{
void *app;
pthread_mutex_lock(&timer_mutex);
app = g_app;
pthread_mutex_unlock(&timer_mutex);
return app;
}
-6
View File
@@ -4,25 +4,19 @@
#include "platform.h"
#if ANDROID_BUILD
#include <jni.h>
#include <pthread.h>
void android_timer_init(void);
void android_timer_start(void);
void android_timer_stop(void);
void android_timer_set_app(void *app_ptr);
void android_timer_activate(void);
void android_timer_deactivate(void);
void* android_timer_get_app(void);
pthread_mutex_t* android_timer_get_mutex(void);
#else
// Stub functions for non-Android platforms
static inline void android_timer_init(void) {}
static inline void android_timer_start(void) {}
static inline void android_timer_stop(void) {}
static inline void android_timer_set_app(void *app_ptr) {(void)app_ptr;}
static inline void android_timer_activate(void) {}
static inline void android_timer_deactivate(void) {}
static inline void* android_timer_get_app(void) { return NULL; }
static inline void* android_timer_get_mutex(void) { return NULL; }
#endif
+1 -27
View File
@@ -1,11 +1,8 @@
#include "android_wakelock.h"
#include <stdio.h>
#include <string.h>
#include <raylib.h>
#include <pthread.h>
#include <android/log.h>
#include <android_native_app_glue.h>
#include <jni.h>
#define LOG_TAG "INBE_WAKE"
@@ -20,7 +17,6 @@ static jmethodID g_allow_screen_off_method = NULL;
static pthread_mutex_t wakelock_mutex = PTHREAD_MUTEX_INITIALIZER;
void android_wakelock_init(void) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== android_wakelock_init ===");
}
void android_wakelock_set_activity(JNIEnv *env, jobject activity) {
@@ -42,7 +38,6 @@ void android_wakelock_set_activity(JNIEnv *env, jobject activity) {
g_keep_screen_on_method = (*env)->GetMethodID(env, clazz, "keepScreenOn", "()V");
g_allow_screen_off_method = (*env)->GetMethodID(env, clazz, "allowScreenOff", "()V");
(*env)->DeleteLocalRef(env, clazz);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "Wake lock activity set successfully");
}
}
@@ -50,15 +45,8 @@ void android_wakelock_set_activity(JNIEnv *env, jobject activity) {
}
void android_wakelock_acquire(void) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== ACQUIRE START ===");
pthread_mutex_lock(&wakelock_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "ACQUIRE: Checking if g_jvm and g_activity are set");
char msg[128];
snprintf(msg, sizeof(msg), "ACQUIRE: g_jvm=%p, g_activity=%p", g_jvm, g_activity);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, msg);
if (!g_jvm || !g_activity) {
__android_log_write(ANDROID_LOG_ERROR, LOG_TAG, "ACQUIRE: JNI not initialized - skipping wake lock");
pthread_mutex_unlock(&wakelock_mutex);
@@ -73,15 +61,13 @@ void android_wakelock_acquire(void) {
if (env && g_acquire_method) {
(*env)->CallVoidMethod(env, g_activity, g_acquire_method);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "ACQUIRE: SUCCESS");
}
pthread_mutex_unlock(&wakelock_mutex);
TraceLog(LOG_INFO, "INBE: Wake lock acquired");
}
void android_wakelock_update_session_notification(const char *status_text) {
if(status_text == NULL || status_text[0] == '\0')
if(status_text == NULL)
return;
pthread_mutex_lock(&wakelock_mutex);
@@ -109,15 +95,8 @@ void android_wakelock_update_session_notification(const char *status_text) {
}
void android_wakelock_release(void) {
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "=== RELEASE START ===");
pthread_mutex_lock(&wakelock_mutex);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "RELEASE: Checking if g_jvm and g_activity are set");
char msg[128];
snprintf(msg, sizeof(msg), "RELEASE: g_jvm=%p, g_activity=%p", g_jvm, g_activity);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, msg);
if (!g_jvm || !g_activity) {
__android_log_write(ANDROID_LOG_ERROR, LOG_TAG, "RELEASE: JNI not initialized - skipping wake lock");
pthread_mutex_unlock(&wakelock_mutex);
@@ -132,11 +111,9 @@ void android_wakelock_release(void) {
if (env && g_release_method) {
(*env)->CallVoidMethod(env, g_activity, g_release_method);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "RELEASE: SUCCESS");
}
pthread_mutex_unlock(&wakelock_mutex);
TraceLog(LOG_INFO, "INBE: Wake lock released");
}
void android_keep_screen_on(void) {
@@ -156,7 +133,6 @@ void android_keep_screen_on(void) {
if (env && g_keep_screen_on_method) {
(*env)->CallVoidMethod(env, g_activity, g_keep_screen_on_method);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "KEEP_SCREEN_ON: SUCCESS");
}
pthread_mutex_unlock(&wakelock_mutex);
@@ -179,13 +155,11 @@ void android_allow_screen_off(void) {
if (env && g_allow_screen_off_method) {
(*env)->CallVoidMethod(env, g_activity, g_allow_screen_off_method);
__android_log_write(ANDROID_LOG_INFO, LOG_TAG, "ALLOW_SCREEN_OFF: SUCCESS");
}
pthread_mutex_unlock(&wakelock_mutex);
}
// Called from JNI to set the JVM reference
void android_wakelock_set_jvm(JavaVM *vm) {
g_jvm = vm;
}
+136 -10
View File
@@ -7,14 +7,132 @@
#include "flint_ui.h"
#include "raylib.h"
#include <stdio.h>
extern int view_width;
extern int view_height;
static const int meditation_config_preset_count = 5;
static int
meditation_config_duration_height(int content_w)
{
int columns = content_w >= flint_px(520) ? 3 : 2;
int count = meditation_config_preset_count + 1;
int rows = (count + columns - 1) / columns;
return flint_px(30) + rows * flint_px(42) + (rows - 1) * flint_px(8) +
flint_px(96) + flint_px(78) + flint_px(18);
}
static int
meditation_config_content_height(InbeApp *app, int content_w)
{
return meditation_music_measure_settings(app, content_w, 1, 1) +
app_content_bottom_reserved(app) + flint_px(24);
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeConfig;
return meditation_config_duration_height(content_w) +
meditation_music_measure_settings(app, content_w, 1, 1) +
(integrated ? app_content_bottom_reserved(app) : 0) + flint_px(24);
}
static void
meditation_config_save(InbeApp *app)
{
if(app == NULL)
return;
app->settings_dirty = 1;
save_settings(app);
}
static void
meditation_config_draw_duration(InbeApp *app, int x, int w, int *y)
{
const char *labels[] = {
locale_get("duration_5m"),
locale_get("duration_15m"),
locale_get("duration_30m"),
locale_get("duration_1h"),
locale_get("duration_2h"),
locale_get("meditation_duration_custom")
};
int mode;
int columns;
int gap = flint_px(8);
int btn_h = flint_px(36);
int btn_w;
int row_y;
int custom_row_y;
int toggle_value;
int hover = 0;
char custom_text[64];
if(app == NULL || y == NULL)
return;
mode = clampi(app->meditation.duration_mode, 0, meditation_config_preset_count);
app->meditation.duration_mode = mode;
app->meditation.custom_minutes = clampi(app->meditation.custom_minutes, 1, 240);
flint_text_draw(locale_get("meditation_duration_setting"), x, *y,
flint_ui_font(), flint_theme_get_text());
*y += flint_px(30);
columns = w >= flint_px(520) ? 3 : 2;
btn_w = (w - gap * (columns - 1)) / columns;
for(int i = 0; i < meditation_config_preset_count + 1; i++) {
int col = i % columns;
int row = i / columns;
int bx = x + col * (btn_w + gap);
int by = *y + row * (btn_h + gap);
int style = i == mode ? UI_BUTTON_STYLE_PRIMARY : UI_BUTTON_STYLE_SECONDARY;
if(ui_draw_generic_button(bx, by, btn_w, btn_h, labels[i], style, 0, &hover)) {
app->meditation.duration_mode = i;
meditation_config_save(app);
}
}
row_y = *y + ((meditation_config_preset_count + 1 + columns - 1) / columns) *
(btn_h + gap);
*y = row_y + flint_px(8);
custom_row_y = *y;
snprintf(custom_text, sizeof(custom_text), "%s: %d min",
locale_get("meditation_custom_minutes"), app->meditation.custom_minutes);
flint_text_draw(custom_text, x, custom_row_y,
flint_ui_font(), flint_theme_get_text());
{
const char *adjust_labels[] = {"-5", "-1", "+1", "+5"};
const int adjust_values[] = {-5, -1, 1, 5};
int adjust_w = flint_px(50);
int adjust_total = adjust_w * 4 + gap * 3;
int adjust_x = x + (w - adjust_total) / 2;
int adjust_y = custom_row_y + flint_px(34);
for(int i = 0; i < 4; i++) {
if(ui_draw_generic_button(adjust_x + i * (adjust_w + gap), adjust_y,
adjust_w, btn_h, adjust_labels[i],
UI_BUTTON_STYLE_SECONDARY, 0, &hover)) {
app->meditation.custom_minutes =
clampi(app->meditation.custom_minutes + adjust_values[i], 1, 240);
app->meditation.duration_mode = meditation_config_preset_count;
meditation_config_save(app);
}
}
}
*y += flint_px(96);
flint_text_draw(locale_get("meditation_extend_controls_label"), x, *y,
flint_ui_font(), flint_theme_get_text());
toggle_value = app->meditation.show_extend_controls;
if(ui_draw_toggle_switch(x, *y + flint_px(26), flint_px(56), flint_px(30),
&toggle_value, locale_get("toggle_off"),
locale_get("toggle_on"))) {
app->meditation.show_extend_controls = toggle_value;
meditation_config_save(app);
}
*y += flint_px(78);
}
typedef struct MeditationConfigScrollPageContext {
@@ -32,26 +150,33 @@ meditation_config_scroll_page_content_height(int content_w, void *user_data)
void
meditation_config_screen_draw(InbeApp *app)
{
int integrated = app->inbe.screen == InbeScreenStart;
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeConfig;
int title_h = integrated ? app_content_top_reserved(app) : ui_screen_header_height();
int scroll_y;
int scroll_h;
int bottom_reserved = integrated ? app_content_bottom_reserved(app) : 0;
if(!integrated) {
FlintUIHeader header = ui_draw_title_header(title_h, locale_get("practice_config_title"),
(Texture2D){0}, app->icons[UI_ICON_TYPE_X]);
if(header.right_clicked) {
if(app->settings_dirty)
save_settings(app);
meditation_practice_leave_config(app);
app->settings_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
app_switch_screen(app, InbeScreenStart);
if(app->modal.active && app->modal.type == UIModalPracticeConfig) {
app_close_modal(app);
} else {
if(app->settings_dirty)
save_settings(app);
meditation_practice_leave_config(app);
app->settings_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
app_switch_screen(app, InbeScreenStart);
}
}
}
scroll_y = title_h + flint_px(16);
scroll_h = view_height - scroll_y - app_content_bottom_reserved(app) - flint_px(8);
scroll_h = view_height - scroll_y - bottom_reserved -
(integrated ? flint_px(8) : 0);
if(scroll_h < 0)
scroll_h = 0;
@@ -68,6 +193,7 @@ meditation_config_screen_draw(InbeApp *app)
});
int y = page.content_y;
meditation_config_draw_duration(app, page.content_x, page.content_w, &y);
meditation_music_draw_settings(app, page.content_x, page.content_w,
&y, 1, 1);
ui_scroll_page_end(page);
+16 -4
View File
@@ -30,6 +30,10 @@ meditation_manual_close(InbeApp *app, int mark_seen)
return;
if(mark_seen)
mark_exercise_manual_seen(app, EXERCISE_MEDITATION);
if(app->modal.active && app->modal.type == UIModalPracticeManual) {
app_close_modal(app);
return;
}
app->tutorial_step = 0;
app->manual_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
@@ -77,10 +81,12 @@ meditation_manual_scroll_page_content_height(int content_w, void *user_data)
void
meditation_manual_draw(InbeApp *app)
{
int integrated = app->inbe.screen == InbeScreenStart;
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeManual;
int title_h = integrated ? app_content_top_reserved(app) : ui_screen_header_height();
int nav_h = MEDITATION_MANUAL_PAGES > 1 ? manual_screen_guide_nav_height() : 0;
int nav_y = view_height - app_content_bottom_reserved(app) - nav_h;
int bottom_reserved = integrated ? app_content_bottom_reserved(app) : 0;
int nav_y = view_height - bottom_reserved - nav_h;
int content_y = title_h + flint_px(16);
int content_h = nav_y - content_y - flint_px(16);
int responsive_max_w = (int)(view_width * 0.90f);
@@ -95,8 +101,14 @@ meditation_manual_draw(InbeApp *app)
page = manual_screen_guide_update_page(app, MEDITATION_MANUAL_PAGES,
meditation_manual_start,
meditation_manual_close);
if(!integrated && ui_draw_screen_header(locale_get("meditation_manual_title"), 1))
meditation_manual_close(app, 0);
if(!integrated) {
FlintUIHeader header = ui_draw_title_header(title_h,
locale_get("meditation_manual_title"),
(Texture2D){0},
app->icons[UI_ICON_TYPE_X]);
if(header.right_clicked)
meditation_manual_close(app, 0);
}
if(content_h < flint_px(120))
content_h = flint_px(120);
@@ -25,8 +25,7 @@ meditation_practice_start(InbeApp *app)
if(app == NULL)
return;
mark_exercise_manual_seen(app, EXERCISE_MEDITATION);
app_open_modal(app, UIModalMeditationSetup);
app_switch_screen(app, InbeScreenStart);
meditation_start_configured(app);
}
void
@@ -8,6 +8,8 @@ void meditation_practice_destroy(InbeApp *app);
void meditation_practice_start(InbeApp *app);
void meditation_practice_update(InbeApp *app);
void meditation_practice_leave_config(InbeApp *app);
int meditation_configured_duration_seconds(const InbeApp *app);
void meditation_start_configured(InbeApp *app);
void meditation_manual_draw(InbeApp *app);
void meditation_manual_close(InbeApp *app, int mark_seen);
void meditation_config_screen_draw(InbeApp *app);
+120 -3
View File
@@ -16,6 +16,16 @@ extern int view_height;
static int meditation_background_remainder_ms = 0;
static const int meditation_duration_presets[] = {
5 * 60,
15 * 60,
30 * 60,
60 * 60,
2 * 60 * 60
};
static void meditation_timer_complete(InbeApp *app);
static Texture2D
meditation_sound_icon_for_volume(InbeApp *app)
{
@@ -35,9 +45,13 @@ meditation_start(InbeApp *app, int seconds)
if(app == NULL)
return;
if(seconds < 60)
seconds = 60;
app->meditation.duration_seconds = seconds;
app->meditation.remaining_seconds = seconds;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -48,6 +62,28 @@ meditation_start(InbeApp *app, int seconds)
practice_background_start(app, PRACTICE_MEDITATION);
}
int
meditation_configured_duration_seconds(const InbeApp *app)
{
int mode;
if(app == NULL)
return meditation_duration_presets[1];
mode = app->meditation.duration_mode;
if(mode >= 0 && mode < (int)(sizeof(meditation_duration_presets) /
sizeof(meditation_duration_presets[0])))
return meditation_duration_presets[mode];
return clampi(app->meditation.custom_minutes, 1, 240) * 60;
}
void
meditation_start_configured(InbeApp *app)
{
meditation_start(app, meditation_configured_duration_seconds(app));
}
static void
meditation_finish(InbeApp *app)
{
@@ -65,10 +101,12 @@ meditation_finish(InbeApp *app)
app_auto_sync(app);
}
}
app_play_sound(app, app->bell_sound, 1.0f);
if(!app->meditation.complete_waiting)
app_play_sound(app, app->bell_sound, 1.0f);
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -77,6 +115,25 @@ meditation_finish(InbeApp *app)
app_switch_screen(app, InbeScreenStart);
}
static void
meditation_timer_complete(InbeApp *app)
{
if(app == NULL)
return;
if(app->meditation.show_extend_controls) {
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
if(!app->meditation.complete_waiting) {
app->meditation.complete_waiting = 1;
app_play_sound(app, app->bell_sound, 1.0f);
}
return;
}
meditation_finish(app);
}
void
meditation_advance_elapsed(InbeApp *app, int elapsed_ms)
{
@@ -103,7 +160,7 @@ meditation_advance_elapsed(InbeApp *app, int elapsed_ms)
app->meditation.frame_ticks = 0;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
meditation_timer_complete(app);
}
static int
@@ -148,6 +205,7 @@ meditation_exit_to_start(InbeApp *app)
app->meditation.duration_seconds = 0;
app->meditation.remaining_seconds = 0;
app->meditation.frame_ticks = 0;
app->meditation.complete_waiting = 0;
meditation_background_remainder_ms = 0;
app->session_paused = 0;
app->volume_popup_active = 0;
@@ -193,6 +251,18 @@ draw_meditation_duration_button(int x, int y, int w, int h, const char *label)
return ui_draw_generic_button(x, y, w, h, label, UI_BUTTON_STYLE_PRIMARY, 0, &hover);
}
static void
meditation_extend_session(InbeApp *app, int seconds)
{
if(app == NULL || seconds <= 0)
return;
app->meditation.duration_seconds += seconds;
app->meditation.remaining_seconds += seconds;
app->meditation.complete_waiting = 0;
app->meditation.frame_ticks = 0;
}
void
meditation_draw_setup_modal(InbeApp *app)
{
@@ -294,6 +364,49 @@ draw_meditation_sound_controls(InbeApp *app)
}
}
static void
draw_meditation_extend_controls(InbeApp *app, int center_x, int y)
{
static const int add_seconds[] = {60, 5 * 60, 10 * 60};
const char *labels[] = {"+1", "+5", "+10"};
int gap = flint_px(8);
int btn_h = flint_px(34);
int btn_w = flint_px(58);
int finish_w = flint_px(96);
int total_w = btn_w * 3 + gap * 2;
int x = center_x - total_w / 2;
int hover = 0;
if(app == NULL || !app->meditation.show_extend_controls)
return;
if(x < flint_px(12))
x = flint_px(12);
if(x + total_w > view_width - flint_px(12))
x = view_width - flint_px(12) - total_w;
for(int i = 0; i < 3; i++) {
if(ui_draw_generic_button(x + i * (btn_w + gap), y, btn_w, btn_h, labels[i],
UI_BUTTON_STYLE_SECONDARY, 0, &hover))
meditation_extend_session(app, add_seconds[i]);
}
if(app->meditation.complete_waiting) {
int finish_x = center_x - finish_w / 2;
int finish_y = y + btn_h + flint_px(10);
if(finish_x < flint_px(12))
finish_x = flint_px(12);
if(finish_x + finish_w > view_width - flint_px(12))
finish_x = view_width - flint_px(12) - finish_w;
if(ui_draw_generic_button(finish_x, finish_y, finish_w, btn_h,
locale_get("finish_button"), UI_BUTTON_STYLE_PRIMARY,
0, &hover))
meditation_finish(app);
}
}
void
meditation_draw_screen(InbeApp *app, int center_x, int center_y)
{
@@ -352,6 +465,10 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
flint_ui_text_y(time_text, center_y - font, font * 2, font),
font, flint_theme_get_text());
draw_meditation_extend_controls(app, center_x, center_y + flint_px(42));
if(app->meditation.complete_waiting)
return;
if((
#if defined(PLATFORM_WEB)
!app->backgrounded
@@ -365,7 +482,7 @@ meditation_draw_screen(InbeApp *app, int center_x, int center_y)
if(app->meditation.remaining_seconds > 0)
app->meditation.remaining_seconds--;
if(app->meditation.remaining_seconds <= 0)
meditation_finish(app);
meditation_timer_complete(app);
}
}
}
@@ -10,6 +10,7 @@
#include <stdio.h>
extern int view_width;
extern int view_height;
static const int g_sun_salutation_pose_sequence[SUN_SALUTATION_STEP_COUNT] = {
0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0
@@ -208,6 +209,7 @@ sun_salutation_config_screen_draw(InbeApp *app)
int content_x;
int content_w;
int y;
int title_h = app_content_top_reserved(app);
int repetitions;
int start_seconds;
int end_seconds;
@@ -215,9 +217,20 @@ sun_salutation_config_screen_draw(InbeApp *app)
if(app == NULL)
return;
sun_salutation_normalize_settings(app);
if(app->modal.active && app->modal.type == UIModalPracticeConfig) {
FlintUIHeader header = ui_draw_title_header(ui_screen_header_height(),
locale_get("practice_config_title"),
(Texture2D){0},
app->icons[UI_ICON_TYPE_X]);
title_h = ui_screen_header_height();
if(header.right_clicked) {
app_close_modal(app);
return;
}
}
flint_centered_column(CONTENT_MAX_W, CONTENT_SIDE_PAD, &content_x, &content_w);
y = app_content_top_reserved(app) + flint_px(20);
y = title_h + flint_px(20);
draw_sun_salutation_preview(app, content_x, y, content_w);
y += sun_salutation_preview_height(content_w) + flint_px(16);
+18 -8
View File
@@ -295,7 +295,10 @@ whm_config_draw_session_tab(InbeApp *app, int content_x, int content_w, int y)
static int
whm_config_content_height(InbeApp *app, int content_w)
{
int bottom_padding = app_content_bottom_reserved(app) + flint_px(24);
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeConfig;
int bottom_padding = (integrated ? app_content_bottom_reserved(app) : 0) +
flint_px(24);
if(app->practice_config_tab == 0) {
int span = content_w < flint_px(240) ? content_w : flint_px(240);
@@ -337,12 +340,14 @@ whm_config_scroll_page_content_height(int content_w, void *user_data)
void
whm_config_screen_draw(InbeApp *app)
{
int integrated = app->inbe.screen == InbeScreenStart;
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeConfig;
int title_h = integrated ? app_content_top_reserved(app) : ui_screen_header_height();
int config_tab_h = flint_px(40);
int config_tab_gap = flint_px(14);
int scroll_y;
int scroll_h;
int bottom_reserved = integrated ? app_content_bottom_reserved(app) : 0;
int draw_breath_animation_menu = 0;
int clicked_config_tab = -1;
const char *config_tabs[] = {
@@ -359,11 +364,15 @@ whm_config_screen_draw(InbeApp *app)
FlintUIHeader header = ui_draw_title_header(title_h, locale_get("practice_config_title"),
(Texture2D){0}, app->icons[UI_ICON_TYPE_X]);
if(header.right_clicked) {
if(app->settings_dirty)
save_settings(app);
app->settings_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
app_switch_screen(app, InbeScreenStart);
if(app->modal.active && app->modal.type == UIModalPracticeConfig) {
app_close_modal(app);
} else {
if(app->settings_dirty)
save_settings(app);
app->settings_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
app_switch_screen(app, InbeScreenStart);
}
}
}
@@ -374,7 +383,8 @@ whm_config_screen_draw(InbeApp *app)
app->settings_scroll = 0;
}
scroll_y = title_h + config_tab_h + config_tab_gap;
scroll_h = view_height - scroll_y - app_content_bottom_reserved(app) - flint_px(8);
scroll_h = view_height - scroll_y - bottom_reserved -
(integrated ? flint_px(8) : 0);
if(scroll_h < 0)
scroll_h = 0;
+15 -4
View File
@@ -151,6 +151,10 @@ whm_manual_close(InbeApp *app, int mark_seen)
{
if(mark_seen)
mark_exercise_manual_seen(app, EXERCISE_WIM_HOF);
if(app != NULL && app->modal.active && app->modal.type == UIModalPracticeManual) {
app_close_modal(app);
return;
}
app->tutorial_step = 0;
app->manual_scroll = 0;
app->practice_tab = PRACTICE_TAB_PLAY;
@@ -169,10 +173,12 @@ manual_screen_start_exercise(InbeApp *app)
void
whm_manual_draw(InbeApp *app)
{
int integrated = app->inbe.screen == InbeScreenStart;
int integrated = app->inbe.screen == InbeScreenStart &&
app->modal.type != UIModalPracticeManual;
int title_h = integrated ? app_content_top_reserved(app) : ui_screen_header_height();
int nav_h = manual_screen_guide_nav_height();
int nav_y = view_height - app_content_bottom_reserved(app) - nav_h;
int bottom_reserved = integrated ? app_content_bottom_reserved(app) : 0;
int nav_y = view_height - bottom_reserved - nav_h;
int content_y = title_h;
int viewport_h = nav_y - content_y;
int body_font = flint_ui_font();
@@ -193,8 +199,13 @@ whm_manual_draw(InbeApp *app)
default: break;
}
if(!integrated && ui_draw_screen_header(title, 1))
whm_manual_close(app, 0);
if(!integrated) {
FlintUIHeader header = ui_draw_title_header(title_h, title,
(Texture2D){0},
app->icons[UI_ICON_TYPE_X]);
if(header.right_clicked)
whm_manual_close(app, 0);
}
{
int top_padding = flint_px(16);
+12 -4
View File
@@ -165,7 +165,14 @@ session_update_notification(InbeApp *app)
char text[96] = "";
int count;
if(app == NULL || app->inbe.screen != InbeScreenSession)
if(app == NULL)
return;
if(app->inbe.screen == InbeScreenResults) {
locale_format(text, sizeof(text), "notification_results");
goto update;
}
if(app->inbe.screen != InbeScreenSession)
return;
count = int_from_count(app->inbe.count);
@@ -186,13 +193,11 @@ session_update_notification(InbeApp *app)
: 0);
break;
case InbePhaseNext:
locale_format(text, sizeof(text), "notification_next_round");
break;
default:
locale_format(text, sizeof(text), "notification_session_active");
break;
}
update:
if(strcmp(text, whm_last_notification_text) == 0)
return;
@@ -423,6 +428,9 @@ finish_round(InbeApp *app)
stop_android_background_session(app);
#endif
app_switch_screen(app, InbeScreenResults);
#if ANDROID_BUILD
session_update_notification(app);
#endif
} else {
app_init(app);
}
+97 -38
View File
@@ -6,19 +6,23 @@ habit_edit_begin_new(InbeApp *app)
{
const char *default_name;
Color default_color = {99, 196, 165, 255};
int created;
if(app == NULL)
return;
default_name = locale_get("habit_new_default_name");
created = habits_add_custom(&app->habits, default_name, default_color,
INBE_HABIT_SYNC_NONE, 0);
if(created < 0)
return;
app_auto_sync(app);
habit_edit_begin(app, created);
app->habit_edit = (HabitEditState){
.active = 1,
.is_new = 1,
.index = -1,
.color = default_color,
.sync_mode = INBE_HABIT_SYNC_NONE
};
snprintf(app->habit_edit.text, sizeof(app->habit_edit.text), "%s", default_name);
app->habit_edit.cursor = (int)strlen(app->habit_edit.text);
app->habit_edit.focused = 1;
app->habits.tab = HABIT_TAB_EDIT;
app_switch_screen(app, InbeScreenHabits);
}
void
@@ -37,7 +41,10 @@ habit_edit_begin(InbeApp *app, int index)
};
snprintf(app->habit_edit.text, sizeof(app->habit_edit.text), "%s",
app->habits.items[index].name);
snprintf(app->habit_edit.description, sizeof(app->habit_edit.description), "%s",
app->habits.items[index].description);
app->habit_edit.cursor = (int)strlen(app->habit_edit.text);
app->habit_edit.description_cursor = (int)strlen(app->habit_edit.description);
app->habits.tab = HABIT_TAB_EDIT;
app_switch_screen(app, InbeScreenHabits);
}
@@ -85,6 +92,7 @@ habit_edit_info_modal(const char *title, const char *message)
FlintUIScrollArea scroll_area;
int y;
int modal_h;
int modal_w;
int paragraph_h;
int button_w = flint_px(112);
int button_h = flint_px(36);
@@ -93,19 +101,31 @@ habit_edit_info_modal(const char *title, const char *message)
int hover = 0;
int result = 0;
modal_w = view_width - flint_px(36);
if(modal_w > flint_px(420))
modal_w = flint_px(420);
if(modal_w < flint_px(320))
modal_w = flint_px(320);
if(modal_w > view_width - flint_px(24))
modal_w = view_width - flint_px(24);
if(modal_w < flint_px(240))
modal_w = flint_px(240);
paragraph = (FlintUIParagraph){
.text = message,
.width = flint_px(320) - flint_px(36)
.width = modal_w - flint_px(36),
.font = flint_ui_font(),
.line_gap = flint_px(4)
};
modal_h = ui_paragraph_modal_height((FlintUIParagraphModalMeasure){
.message = message,
.width = flint_px(320),
.width = modal_w,
.button_h = button_h,
.extra_lines = 2,
.min_height = flint_px(196)
});
frame = ui_draw_modal_frame(flint_px(320), modal_h, title,
frame = ui_draw_modal_frame(modal_w, modal_h, title,
(Texture2D){0}, (Texture2D){0});
paragraph.width = frame.content_w;
paragraph_h = flint_ui_paragraph_height(paragraph);
@@ -170,6 +190,9 @@ habit_edit_commit(InbeApp *app)
app->habit_edit.sync_activity);
if(created >= 0 && created < app->habits.count) {
app->habits.items[created].counter_enabled = app->habit_edit.counter_enabled != 0;
snprintf(app->habits.items[created].description,
sizeof(app->habits.items[created].description), "%s",
app->habit_edit.description);
habits_save(&app->habits);
}
} else {
@@ -182,6 +205,9 @@ habit_edit_commit(InbeApp *app)
}
snprintf(app->habits.items[index].name,
sizeof(app->habits.items[index].name), "%s", text);
snprintf(app->habits.items[index].description,
sizeof(app->habits.items[index].description), "%s",
app->habit_edit.description);
app->habits.items[index].color = app->habit_edit.color;
app->habits.items[index].color.a = 255;
app->habits.items[index].sync_mode = app->habit_edit.sync_mode;
@@ -200,18 +226,18 @@ habit_edit_commit(InbeApp *app)
}
static void
habit_edit_clamp_cursor(InbeApp *app)
habit_edit_clamp_cursor(char *text, int *cursor)
{
int len;
if(app == NULL)
if(text == NULL || cursor == NULL)
return;
len = (int)strlen(app->habit_edit.text);
if(app->habit_edit.cursor < 0)
app->habit_edit.cursor = 0;
if(app->habit_edit.cursor > len)
app->habit_edit.cursor = len;
len = (int)strlen(text);
if(*cursor < 0)
*cursor = 0;
if(*cursor > len)
*cursor = len;
}
static void
@@ -226,7 +252,8 @@ habit_edit_handle_keyboard(InbeApp *app)
}
static FlintUITextField
habit_edit_text_field(InbeApp *app, int font)
habit_edit_text_field(char *text, size_t text_size, int *cursor, int *focused,
int max_codepoints, int font)
{
FlintUITextInputStyle style = {
.background = flint_darken(flint_theme_get_bg(), 4),
@@ -240,11 +267,11 @@ habit_edit_text_field(InbeApp *app, int font)
return (FlintUITextField){
.bounds = {0},
.text = app->habit_edit.text,
.text_size = sizeof(app->habit_edit.text),
.cursor_position = &app->habit_edit.cursor,
.focused = &app->habit_edit.focused,
.max_codepoints = INBE_HABIT_NAME_SIZE - 1,
.text = text,
.text_size = text_size,
.cursor_position = cursor,
.focused = focused,
.max_codepoints = max_codepoints,
.font = font,
.style = style
};
@@ -289,7 +316,11 @@ habit_edit_scroll_content_height(int content_w, void *user_data)
.label = locale_get("habit_name_label"),
.field_h = flint_px(40)
});
height += flint_px(32) + flint_px(34);
height += ui_label_text_field_height((FlintUILabelTextField){
.label = locale_get("habit_description_label"),
.field_h = flint_px(40)
});
height += flint_px(32) + flint_px(76);
height += ui_section_label_height((FlintUISectionLabel){0});
for(int i = 0; i < EXERCISE_COUNT; i++)
height += ui_checkbox_row_height((FlintUICheckboxRow){0});
@@ -308,7 +339,7 @@ draw_habit_edit_screen(InbeApp *app)
{
const char *title;
const char *activity_options[EXERCISE_COUNT];
Color color_options[6];
Color color_options[12];
int top_h = flint_px(58);
int bottom_reserved;
int content_x;
@@ -425,32 +456,60 @@ draw_habit_edit_screen(InbeApp *app)
}
(void)ui_draw_label_text_field((FlintUILabelTextField){
.label = locale_get("habit_name_label"),
.field = habit_edit_text_field(app, font),
.field = habit_edit_text_field(app->habit_edit.text,
sizeof(app->habit_edit.text),
&app->habit_edit.cursor,
&app->habit_edit.focused,
INBE_HABIT_NAME_SIZE - 1, font),
.field_h = field_h,
.label_font = label_font,
.label_color = flint_darken(flint_theme_get_text(), 34)
}, content_x, y, content_w);
habit_edit_clamp_cursor(app);
habit_edit_clamp_cursor(app->habit_edit.text, &app->habit_edit.cursor);
y += ui_label_text_field_height((FlintUILabelTextField){.field_h = field_h});
(void)ui_draw_label_text_field((FlintUILabelTextField){
.label = locale_get("habit_description_label"),
.field = habit_edit_text_field(app->habit_edit.description,
sizeof(app->habit_edit.description),
&app->habit_edit.description_cursor,
&app->habit_edit.description_focused,
INBE_HABIT_DESCRIPTION_SIZE - 1, font),
.field_h = field_h,
.label_font = label_font,
.label_color = flint_darken(flint_theme_get_text(), 34)
}, content_x, y, content_w);
habit_edit_clamp_cursor(app->habit_edit.description,
&app->habit_edit.description_cursor);
y += ui_label_text_field_height((FlintUILabelTextField){.field_h = field_h});
flint_text_draw(locale_get("habit_underline_label"), content_x, y,
label_font, flint_darken(flint_theme_get_text(), 34));
y += flint_px(32);
color_options[0] = (Color){94, 166, 232, 255};
color_options[1] = (Color){99, 196, 165, 255};
color_options[2] = (Color){210, 180, 72, 255};
color_options[3] = (Color){224, 124, 104, 255};
color_options[4] = (Color){180, 132, 220, 255};
color_options[5] = (Color){216, 116, 164, 255};
for(int i = 0; i < 6; i++) {
int cx = content_x + flint_px(18) + i * flint_px(42);
color_options[0] = (Color){224, 92, 92, 255};
color_options[1] = (Color){224, 124, 104, 255};
color_options[2] = (Color){232, 150, 74, 255};
color_options[3] = (Color){210, 180, 72, 255};
color_options[4] = (Color){160, 196, 82, 255};
color_options[5] = (Color){99, 196, 165, 255};
color_options[6] = (Color){74, 186, 198, 255};
color_options[7] = (Color){94, 166, 232, 255};
color_options[8] = (Color){116, 132, 224, 255};
color_options[9] = (Color){180, 132, 220, 255};
color_options[10] = (Color){216, 116, 164, 255};
color_options[11] = (Color){198, 96, 118, 255};
for(int i = 0; i < 12; i++) {
int row = i / 6;
int col = i % 6;
int cx = content_x + flint_px(18) + col * flint_px(42);
int cy = y + row * flint_px(42);
int selected = app->habit_edit.color.r == color_options[i].r &&
app->habit_edit.color.g == color_options[i].g &&
app->habit_edit.color.b == color_options[i].b;
if(habit_color_button(app, cx, y, color_options[i], selected))
if(habit_color_button(app, cx, cy, color_options[i], selected))
app->habit_edit.color = color_options[i];
}
y += flint_px(34);
y += flint_px(76);
if(ui_draw_section_label((FlintUISectionLabel){
.label = locale_get("habit_practice_list_title"),
+4 -2
View File
@@ -239,7 +239,8 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
if(ctx->count <= 0) {
if(draw)
flint_text_draw("No sessions", content_x, y, flint_ui_font(), flint_theme_get_text());
flint_text_draw(locale_get("no_sessions"), content_x, y,
flint_ui_font(), flint_theme_get_text());
return y + row_h;
}
@@ -277,7 +278,8 @@ draw_habit_session_edit_content(InbeApp *app, HabitLinkedContext *ctx, int conte
snprintf(time_text, sizeof(time_text), "%02d:%02d",
ctx->entries[i].hour, ctx->entries[i].minute);
if(activity == EXERCISE_SUN_SALUTATION)
snprintf(summary_text, sizeof(summary_text), "1 session");
locale_format(summary_text, sizeof(summary_text),
"session_count_singular", 1);
else if(activity == EXERCISE_MEDITATION)
habit_format_duration(ctx->entries[i].total_seconds,
summary_text, sizeof(summary_text));
+89 -17
View File
@@ -7,6 +7,7 @@
#include "data.h"
#include "storage.h"
#include "app.h"
#include "text_utils.h"
#include "flint_theme.h"
#include "flint_runtime_assets.h"
#include "flint_locale.h"
@@ -328,6 +329,40 @@ habits_delete(InbeHabits *habits, int index)
habits_save(habits);
}
int
habits_move(InbeHabits *habits, int from_index, int to_index)
{
InbeHabit moved;
if(habits == NULL || from_index < 0 || to_index < 0 ||
from_index >= habits->count || to_index >= habits->count ||
from_index == to_index)
return 0;
moved = habits->items[from_index];
if(from_index < to_index) {
for(int i = from_index; i < to_index; i++)
habits->items[i] = habits->items[i + 1];
} else {
for(int i = from_index; i > to_index; i--)
habits->items[i] = habits->items[i - 1];
}
habits->items[to_index] = moved;
if(habits->selected == from_index) {
habits->selected = to_index;
} else if(from_index < to_index &&
habits->selected > from_index && habits->selected <= to_index) {
habits->selected--;
} else if(from_index > to_index &&
habits->selected >= to_index && habits->selected < from_index) {
habits->selected++;
}
habits_save(habits);
return 1;
}
int
habits_name_exists(const InbeHabits *habits, const char *name, int exclude_index)
{
@@ -424,8 +459,12 @@ habits_init(InbeHabits *habits)
{
if(habits == NULL)
return;
if(habits->hold_stats_range_days != 31)
habits->hold_stats_range_days = 7;
data_init();
if(storage_habits_load(habits)) {
if(habits->hold_stats_range_days != 31)
habits->hold_stats_range_days = 7;
if(habits->count <= 0) {
habits_add_default_set(habits);
return;
@@ -443,6 +482,8 @@ habits_init(InbeHabits *habits)
return;
}
habits_add_default_set(habits);
if(habits->hold_stats_range_days != 31)
habits->hold_stats_range_days = 7;
}
void
@@ -802,6 +843,7 @@ habits_screen_draw_desktop_tab_bar(InbeApp *app, int y)
{
FlintUITab tabs[INBE_HABIT_MAX + 1];
int tab_count = 0;
int selected_index;
if(app == NULL)
return -1;
@@ -825,11 +867,14 @@ habits_screen_draw_desktop_tab_bar(InbeApp *app, int y)
.disabled = app->modal.active
};
selected_index = app->habit_edit.active && app->habit_edit.is_new
? -1
: app->habits.selected;
int clicked = ui_draw_tab_bar((FlintUITabBar){
.bounds = {0, (float)y, (float)view_width, (float)ui_tab_bar_height()},
.tabs = tabs,
.count = tab_count,
.selected_index = app->habits.selected,
.selected_index = selected_index,
.min_tab_width = flint_px(100),
.max_tab_width = flint_px(160),
.scroll_offset = &app->habits.tab_scroll,
@@ -855,10 +900,13 @@ habits_screen_top_reserved(InbeApp *app)
static void
draw_habits_top_bar(InbeApp *app, int draw_menu)
{
static const char *options[INBE_HABIT_MAX + 1];
static const char *options[INBE_HABIT_MAX + 2];
static int dropdown_selected = 0;
FlintUISubtab tabs[HABIT_TAB_COUNT];
int option_count;
int habit_offset = 0;
int add_option_index;
int draft_new;
int selected;
int top_h = flint_px(58);
int tab_h = flint_px(40);
@@ -869,15 +917,19 @@ draw_habits_top_bar(InbeApp *app, int draw_menu)
if(app == NULL)
return;
option_count = app->habits.count;
if(option_count > INBE_HABIT_MAX)
option_count = INBE_HABIT_MAX;
for(int i = 0; i < option_count; i++)
options[i] = app->habits.items[i].name;
options[option_count++] = locale_get("habit_add_new_option");
draft_new = app->habit_edit.active && app->habit_edit.is_new;
option_count = 0;
if(draft_new) {
options[option_count++] = "";
habit_offset = 1;
}
for(int i = 0; i < app->habits.count && i < INBE_HABIT_MAX; i++)
options[option_count++] = app->habits.items[i].name;
add_option_index = option_count;
options[option_count++] = "+ Habit";
selected = app->habits.selected;
if(selected < 0 || selected >= app->habits.count)
selected = draft_new ? 0 : app->habits.selected + habit_offset;
if(!draft_new && (app->habits.selected < 0 || app->habits.selected >= app->habits.count))
selected = 0;
if(!draw_menu) {
@@ -988,15 +1040,20 @@ draw_habits_top_bar(InbeApp *app, int draw_menu)
.selected_index = &dropdown_selected
});
if(toolbar_result.selected_menu_item >= 0) {
if(dropdown_selected == app->habits.count) {
int selected_habit = dropdown_selected - habit_offset;
if(draft_new && dropdown_selected == 0)
return;
if(dropdown_selected == add_option_index) {
habit_edit_begin_new(app);
return;
}
if(app->habits.selected != dropdown_selected) {
if(selected_habit >= 0 && selected_habit < app->habits.count &&
app->habits.selected != selected_habit) {
int was_edit_tab = app->habits.tab == HABIT_TAB_EDIT;
if(was_edit_tab && app->habit_edit.active)
habit_edit_commit(app);
app->habits.selected = dropdown_selected;
app->habits.selected = selected_habit;
app->habits.scroll = 0;
app->habits.weekly_days = HABIT_WEEKLY_INITIAL_DAYS;
if(was_edit_tab) {
@@ -1039,7 +1096,8 @@ habits_screen_prepare_first_run_guide(InbeApp *app)
app->habits.tab = HABIT_TAB_EDIT;
app->habits.scroll = 0;
if(app->habits.count > 0) {
if(!app->habit_edit.active || app->habit_edit.index != app->habits.selected)
if(!app->habit_edit.active ||
(!app->habit_edit.is_new && app->habit_edit.index != app->habits.selected))
habit_edit_begin(app, app->habits.selected);
} else if(!app->habit_edit.active) {
habit_edit_begin_new(app);
@@ -1131,6 +1189,7 @@ habits_screen_practice_list_anchor(InbeApp *app)
flint_centered_column(flint_px(CONTENT_MAX_W), flint_page_side_padding(),
&content_x, &content_w);
y += ui_label_text_field_height((FlintUILabelTextField){.field_h = field_h});
y += ui_label_text_field_height((FlintUILabelTextField){.field_h = field_h});
y += flint_px(32);
y += flint_px(34);
@@ -1246,11 +1305,20 @@ habit_weekly_draw_text_line(const char *text, int x, int y, int w, int h,
int text_size, Color color)
{
int font_size;
const char *draw_text = text;
char fitted[128];
if(text == NULL || text[0] == '\0' || w <= 0 || h <= 0)
return;
font_size = text_size;
flint_text_draw(text, x, flint_text_y(text, y, h, font_size), font_size, color);
while(font_size > FLINT_TEXT_8 && flint_text_measure(text, font_size) > w)
font_size -= flint_px(1);
if(flint_text_measure(text, font_size) > w) {
inbe_text_fit_ellipsis(text, fitted, sizeof(fitted), w, font_size);
draw_text = fitted;
}
flint_text_draw(draw_text, x + (w - flint_text_measure(draw_text, font_size)) / 2,
flint_text_y(draw_text, y, h, font_size), font_size, color);
}
static int
@@ -1290,7 +1358,10 @@ habit_weekly_summary(const HabitLinkedContext *ctx, int day_index,
mixed ? "Mixed practice" : practice_activity_label(first_activity));
}
if(secondary != NULL && secondary_size > 0)
snprintf(secondary, secondary_size, "%d session%s", count, count == 1 ? "" : "s");
locale_format(secondary, secondary_size,
count == 1 ? "session_count_singular"
: "session_count_plural",
count);
return count;
}
@@ -1674,7 +1745,8 @@ draw_habits_screen(InbeApp *app)
}
if(app->habits.tab == HABIT_TAB_EDIT) {
if(!app->habit_edit.active || app->habit_edit.index != app->habits.selected)
if(!app->habit_edit.active ||
(!app->habit_edit.is_new && app->habit_edit.index != app->habits.selected))
habit_edit_begin(app, app->habits.selected);
draw_habit_edit_screen(app);
draw_habits_top_bar(app, 0);
+4
View File
@@ -17,6 +17,7 @@ enum {
INBE_HABIT_MAX = 10,
INBE_HABIT_ID_SIZE = 32,
INBE_HABIT_NAME_SIZE = 40,
INBE_HABIT_DESCRIPTION_SIZE = 256,
HABIT_LINKED_ENTRY_MAX = 128,
HABIT_LINKED_PATH_SIZE = 80
};
@@ -50,6 +51,7 @@ typedef struct InbeHabitDay {
typedef struct InbeHabit {
char id[INBE_HABIT_ID_SIZE];
char name[INBE_HABIT_NAME_SIZE];
char description[INBE_HABIT_DESCRIPTION_SIZE];
Color color;
int sync_mode;
int sync_activity;
@@ -73,6 +75,7 @@ typedef struct InbeHabits {
int view_mode;
int tab;
int weekly_days;
int hold_stats_range_days;
int loaded;
int dirty;
} InbeHabits;
@@ -122,6 +125,7 @@ void habit_toggle_today(InbeHabits *habits, int index);
void habits_add_default(InbeHabits *habits);
void habits_add_default_set(InbeHabits *habits);
void habits_delete(InbeHabits *habits, int index);
int habits_move(InbeHabits *habits, int from_index, int to_index);
int habits_name_exists(const InbeHabits *habits, const char *name, int exclude_index);
void habits_generate_unique_name(InbeHabits *habits, char *name_buffer, size_t buffer_size, const char *base_name);
int habits_add_custom(InbeHabits *habits, const char *name, Color color,
+93
View File
@@ -0,0 +1,93 @@
#include "pet_screen.h"
#include "app.h"
#include "flint_color.h"
#include "flint_scaling.h"
#include "flint_text.h"
#include "flint_theme.h"
#include "flint_ui.h"
#include "raylib.h"
#include <math.h>
extern int view_height;
extern int view_width;
static void
pet_screen_ensure_assets(InbeApp *app)
{
if(app != NULL && app->pet.egg.id == 0)
app->pet.egg = app_load_asset_texture("pet/egg1.png");
}
void
pet_screen_draw(InbeApp *app)
{
const char *text = "Gamification in progress...";
const char *subtext = "Preview only. This tab is not implemented yet.";
FlintUIParagraph paragraph;
int reserved_bottom;
int content_h;
int center_x = view_width / 2;
int center_y;
int egg_size;
int text_w;
int text_x;
int text_y;
float t;
float scale;
Color muted = flint_darken(flint_theme_get_text(), 34);
if(app == NULL)
return;
reserved_bottom = app_content_bottom_reserved(app);
content_h = view_height - reserved_bottom;
if(content_h < flint_px(120))
content_h = flint_px(120);
center_y = content_h / 2 - flint_px(18);
pet_screen_ensure_assets(app);
egg_size = view_width < view_height ? view_width : view_height;
egg_size = egg_size * 42 / 100;
if(egg_size < flint_px(120))
egg_size = flint_px(120);
if(egg_size > flint_px(240))
egg_size = flint_px(240);
t = (float)app->inbe.frame / 60.0f;
scale = 1.0f + 0.035f * sinf(t * 2.0f);
if(app->pet.egg.id != 0) {
Rectangle src = {0, 0, (float)app->pet.egg.width, (float)app->pet.egg.height};
Rectangle dst = {(float)center_x, (float)center_y,
(float)egg_size * scale, (float)egg_size * scale};
Vector2 origin = {dst.width / 2.0f, dst.height / 2.0f};
DrawTexturePro(app->pet.egg, src, dst, origin, 0.0f, WHITE);
}
text_w = view_width - flint_px(48);
if(text_w > flint_px(360))
text_w = flint_px(360);
if(text_w < flint_px(160))
text_w = flint_px(160);
text_x = center_x - text_w / 2;
text_y = center_y + egg_size / 2 + flint_px(28);
paragraph = (FlintUIParagraph){
.text = text,
.width = text_w,
.font = FLINT_TEXT_16,
.line_gap = flint_px(3),
.color = flint_theme_get_text()
};
flint_ui_paragraph_draw(paragraph, text_x, &text_y);
text_y += flint_px(6);
paragraph = (FlintUIParagraph){
.text = subtext,
.width = text_w,
.font = FLINT_TEXT_12,
.line_gap = flint_px(3),
.color = muted
};
flint_ui_paragraph_draw(paragraph, text_x, &text_y);
}
+8
View File
@@ -0,0 +1,8 @@
#ifndef INBE_PET_SCREEN_H
#define INBE_PET_SCREEN_H
#include "app_fwd.h"
void pet_screen_draw(InbeApp *app);
#endif
+178 -108
View File
@@ -1,16 +1,69 @@
#include "practice_screen.h"
#include "app.h"
#include "screens/manual_screen.h"
#include "practices/practice_registry.h"
#include "flint_locale.h"
#include "flint_theme.h"
#include "flint_ui.h"
extern int view_width;
extern int view_height;
enum {
PRACTICE_GUIDE_STEPS = 4
PRACTICE_GUIDE_STEPS = 3
};
int
practice_visible_mask_all(void)
{
return (1 << EXERCISE_COUNT) - 1;
}
static int
practice_sanitize_visible_mask(int mask)
{
mask &= practice_visible_mask_all();
return mask != 0 ? mask : practice_visible_mask_all();
}
int
practice_is_visible(const InbeApp *app, int exercise)
{
int mask;
if(exercise < 0 || exercise >= EXERCISE_COUNT)
return 0;
mask = practice_sanitize_visible_mask(app != NULL ? app->practice_visible_mask : 0);
return (mask & (1 << exercise)) != 0;
}
static int
practice_first_visible(const InbeApp *app)
{
for(int i = 0; i < EXERCISE_COUNT; i++) {
if(practice_is_visible(app, i))
return i;
}
return EXERCISE_WIM_HOF;
}
void
practice_set_visible(InbeApp *app, int exercise, int visible)
{
int mask;
if(app == NULL || exercise < 0 || exercise >= EXERCISE_COUNT)
return;
mask = practice_sanitize_visible_mask(app->practice_visible_mask);
if(visible)
mask |= 1 << exercise;
else if((mask & ~(1 << exercise)) != 0)
mask &= ~(1 << exercise);
app->practice_visible_mask = practice_sanitize_visible_mask(mask);
practice_clamp_activity_to_tab(app);
save_settings(app);
}
int
practice_activity_count_for_tab(int tab)
{
@@ -29,17 +82,6 @@ practice_activity_for_tab(int tab, int index)
return index;
}
static int
practice_screen_play_only(InbeApp *app)
{
const PracticeDefinition *practice;
if(app == NULL)
return 0;
practice = practice_get(app->exercise_type);
return practice->draw_manual == NULL && practice->draw_config == NULL;
}
const char *
practice_activity_label(int exercise)
{
@@ -52,70 +94,10 @@ practice_clamp_activity_to_tab(InbeApp *app)
{
if(app == NULL)
return;
app->practice_visible_mask = practice_sanitize_visible_mask(app->practice_visible_mask);
app->exercise_type = practice_clamp_id(app->exercise_type);
}
static int
practice_screen_draw_tab_bar(InbeApp *app, int y)
{
FlintUISubtab tabs[PRACTICE_TAB_COUNT];
int tab_values[PRACTICE_TAB_COUNT];
const PracticeDefinition *practice;
int tab_h = flint_px(PRACTICE_CATEGORY_TAB_H);
int tab_count = 0;
int selected_index = 0;
int clicked;
if(app == NULL)
return -1;
practice = practice_get(app->exercise_type);
if(practice_screen_play_only(app)) {
app->practice_tab = PRACTICE_TAB_PLAY;
return -1;
}
if(practice->draw_manual != NULL) {
tabs[tab_count] = (FlintUISubtab){
.icon = app->icons[UI_ICON_TYPE_MANUAL],
.icon_size = flint_px(20),
.disabled = app->modal.active
};
tab_values[tab_count++] = PRACTICE_TAB_MANUAL;
}
tabs[tab_count] = (FlintUISubtab){
.icon = app->icons[UI_ICON_TYPE_SUN],
.icon_size = flint_px(20),
.disabled = app->modal.active
};
tab_values[tab_count++] = PRACTICE_TAB_PLAY;
if(practice->draw_config != NULL) {
tabs[tab_count] = (FlintUISubtab){
.icon = app->icons[UI_ICON_TYPE_WRENCH],
.icon_size = flint_px(20),
.disabled = app->modal.active
};
tab_values[tab_count++] = PRACTICE_TAB_CONFIG;
}
if(app->practice_tab < 0 || app->practice_tab >= PRACTICE_TAB_COUNT)
app->practice_tab = PRACTICE_TAB_PLAY;
for(int i = 0; i < tab_count; i++) {
if(tab_values[i] == app->practice_tab) {
selected_index = i;
break;
}
}
if(tab_values[selected_index] != app->practice_tab)
app->practice_tab = PRACTICE_TAB_PLAY;
clicked = ui_draw_subtab_bar((FlintUISubtabBar){
.bounds = {0, (float)y, (float)view_width, (float)tab_h},
.tabs = tabs,
.count = tab_count,
.selected_index = selected_index
});
return clicked >= 0 && clicked < tab_count ? tab_values[clicked] : -1;
if(!practice_is_visible(app, app->exercise_type))
app->exercise_type = practice_first_visible(app);
}
void
@@ -128,6 +110,9 @@ practice_screen_open_tab(InbeApp *app, int tab)
if(app->practice_tab == PRACTICE_TAB_CONFIG)
app_leave_practice_config(app);
app->practice_tab = PRACTICE_TAB_PLAY;
if(app->modal.type == UIModalPracticeManual ||
app->modal.type == UIModalPracticeConfig)
app_close_modal(app);
app_switch_screen(app, InbeScreenStart);
} else if(tab == PRACTICE_TAB_MANUAL) {
if(practice_get(app->exercise_type)->draw_manual == NULL)
@@ -137,6 +122,7 @@ practice_screen_open_tab(InbeApp *app, int tab)
app->practice_tab = PRACTICE_TAB_MANUAL;
app->tutorial_step = 0;
app->manual_scroll = 0;
app_open_modal(app, UIModalPracticeManual);
app_switch_screen(app, InbeScreenStart);
} else if(tab == PRACTICE_TAB_CONFIG) {
if(practice_get(app->exercise_type)->draw_config == NULL)
@@ -147,6 +133,7 @@ practice_screen_open_tab(InbeApp *app, int tab)
app->practice_config_tab = 0;
}
app->practice_tab = PRACTICE_TAB_CONFIG;
app_open_modal(app, UIModalPracticeConfig);
app_switch_screen(app, InbeScreenStart);
}
}
@@ -155,13 +142,20 @@ static int
practice_screen_draw_desktop_tab_bar(InbeApp *app, int y)
{
FlintUITab tabs[EXERCISE_COUNT];
int values[EXERCISE_COUNT];
int tab_count = 0;
int selected_index = 0;
int clicked;
if(app == NULL)
return -1;
// Create tab for each exercise type
for(int i = 0; i < EXERCISE_COUNT; i++) {
if(!practice_is_visible(app, i))
continue;
if(i == app->exercise_type)
selected_index = tab_count;
values[tab_count] = i;
tabs[tab_count++] = (FlintUITab){
.label = practice_activity_label(i),
.icon = (Texture2D){0},
@@ -169,15 +163,18 @@ practice_screen_draw_desktop_tab_bar(InbeApp *app, int y)
.disabled = app->modal.active
};
}
if(tab_count <= 0)
return -1;
return ui_draw_tab_bar((FlintUITabBar){
clicked = ui_draw_tab_bar((FlintUITabBar){
.bounds = {0, (float)y, (float)view_width, (float)ui_tab_bar_height()},
.tabs = tabs,
.count = tab_count,
.selected_index = app->exercise_type,
.selected_index = selected_index,
.min_tab_width = flint_px(120),
.max_tab_width = flint_px(180)
});
return clicked >= 0 && clicked < tab_count ? values[clicked] : -1;
}
static int
@@ -198,12 +195,20 @@ practice_screen_draw_top_bar(InbeApp *app, int draw_menu)
if(app == NULL)
return;
activity_count = EXERCISE_COUNT;
for(int i = 0; i < activity_count; i++) {
exercise_values[i] = i;
exercise_options[i] = practice_activity_label(exercise_values[i]);
practice_clamp_activity_to_tab(app);
activity_count = 0;
activity_index = 0;
for(int i = 0; i < EXERCISE_COUNT; i++) {
if(!practice_is_visible(app, i))
continue;
if(i == app->exercise_type)
activity_index = activity_count;
exercise_values[activity_count] = i;
exercise_options[activity_count] = practice_activity_label(i);
activity_count++;
}
activity_index = clampi(app->exercise_type, 0, EXERCISE_COUNT - 1);
if(activity_count <= 0)
return;
if(draw_menu) {
FlintUIToolbarResult menu_result = ui_draw_toolbar_header((FlintUIToolbarHeader){
@@ -258,14 +263,68 @@ practice_screen_draw_top_bar(InbeApp *app, int draw_menu)
});
}
// Keep existing subtab bar for Play/Manual/Config (works in both modes)
if(!practice_screen_play_only(app)) {
int clicked = practice_screen_draw_tab_bar(app,
practice_screen_selector_height(app));
if(clicked >= 0 && clicked != app->practice_tab)
practice_screen_open_tab(app, clicked);
} else {
if(!app->modal.active)
app->practice_tab = PRACTICE_TAB_PLAY;
}
void
practice_screen_draw_floating_actions(InbeApp *app)
{
const PracticeDefinition *practice;
int icon_size = flint_px(22);
int icon_padding = flint_px(9);
int button_w = icon_size + icon_padding * 2;
int gap = flint_px(10);
int margin = flint_px(14);
int y = app_content_top_reserved(app) + flint_px(10);
int x = view_width - margin;
if(app == NULL || app->modal.active || app->inbe.screen != InbeScreenStart)
return;
practice = practice_get(app->exercise_type);
if(practice->draw_config != NULL) {
int hover = 0;
x -= button_w;
if(ui_draw_icon_btn_padded(x, y, icon_size, icon_padding,
app->icons[UI_ICON_TYPE_WRENCH], &hover))
practice_screen_open_tab(app, PRACTICE_TAB_CONFIG);
x -= gap;
}
if(practice->draw_manual != NULL) {
int hover = 0;
x -= button_w;
if(ui_draw_icon_btn_padded(x, y, icon_size, icon_padding,
app->icons[UI_ICON_TYPE_MANUAL], &hover))
practice_screen_open_tab(app, PRACTICE_TAB_MANUAL);
}
}
void
practice_screen_draw_modal(InbeApp *app)
{
if(app == NULL || !app->modal.active)
return;
if(app->modal.type != UIModalPracticeManual &&
app->modal.type != UIModalPracticeConfig &&
app->modal.type != UIModalEditProgressiveStartSpeed)
return;
DrawRectangle(0, 0, view_width, view_height, flint_theme_get_bg());
if(app->modal.type == UIModalEditProgressiveStartSpeed) {
const PracticeDefinition *practice = practice_get(app->exercise_type);
if(practice->draw_config != NULL)
practice->draw_config(app);
return;
}
if(app->modal.type == UIModalPracticeManual) {
app->practice_tab = PRACTICE_TAB_MANUAL;
manual_screen_draw(app);
} else {
const PracticeDefinition *practice = practice_get(app->exercise_type);
app->practice_tab = PRACTICE_TAB_CONFIG;
if(practice->draw_config != NULL)
practice->draw_config(app);
}
}
@@ -290,19 +349,34 @@ practice_screen_dropdown_anchor(void)
}
static Rectangle
practice_screen_tab_anchor(InbeApp *app, int tab)
practice_screen_floating_action_anchor(InbeApp *app, int tab)
{
int tab_h = flint_px(PRACTICE_CATEGORY_TAB_H);
int tab_w = view_width / PRACTICE_TAB_COUNT;
int x = tab * tab_w;
int w = tab == PRACTICE_TAB_COUNT - 1 ? view_width - x : tab_w;
int icon_size = flint_px(22);
int icon_padding = flint_px(9);
int size = icon_size + icon_padding * 2;
int gap = flint_px(10);
int margin = flint_px(14);
int x = view_width - margin;
int y = app_content_top_reserved(app) + flint_px(10);
const PracticeDefinition *practice;
return (Rectangle){
(float)x,
(float)practice_screen_selector_height(app),
(float)w,
(float)tab_h
};
if(app == NULL)
return (Rectangle){0};
practice = practice_get(app->exercise_type);
if(practice->draw_config != NULL) {
x -= size;
if(tab == PRACTICE_TAB_CONFIG)
return (Rectangle){(float)x, (float)y, (float)size, (float)size};
x -= gap;
}
if(practice->draw_manual != NULL) {
x -= size;
if(tab == PRACTICE_TAB_MANUAL)
return (Rectangle){(float)x, (float)y, (float)size, (float)size};
}
return (Rectangle){(float)(view_width - margin - size), (float)y,
(float)size, (float)size};
}
static Rectangle
@@ -366,15 +440,11 @@ practice_screen_draw_first_run_guide(InbeApp *app)
locale_get("practice_guide_dropdown")
};
steps[1] = (FlintUIGuideStep){
practice_screen_tab_anchor(app, PRACTICE_TAB_MANUAL),
practice_screen_floating_action_anchor(app, PRACTICE_TAB_MANUAL),
locale_get("practice_guide_manual")
};
steps[2] = (FlintUIGuideStep){
practice_screen_tab_anchor(app, PRACTICE_TAB_PLAY),
locale_get("practice_guide_sun")
};
steps[3] = (FlintUIGuideStep){
practice_screen_tab_anchor(app, PRACTICE_TAB_CONFIG),
practice_screen_floating_action_anchor(app, PRACTICE_TAB_CONFIG),
locale_get("practice_guide_config")
};
@@ -384,7 +454,7 @@ practice_screen_draw_first_run_guide(InbeApp *app)
.step = &app->tutorial_step,
.view_width = view_width,
.view_height = view_height,
.reserved_top = practice_screen_selector_height(app) + flint_px(PRACTICE_CATEGORY_TAB_H),
.reserved_top = practice_screen_selector_height(app),
.reserved_bottom = ui_bottom_nav_height(),
.max_width = flint_px(300),
.close_icon = app->icons[UI_ICON_TYPE_X],
+5
View File
@@ -11,9 +11,14 @@
int practice_activity_count_for_tab(int tab);
int practice_activity_for_tab(int tab, int index);
const char *practice_activity_label(int exercise);
int practice_visible_mask_all(void);
int practice_is_visible(const InbeApp *app, int exercise);
void practice_set_visible(InbeApp *app, int exercise, int visible);
void practice_clamp_activity_to_tab(InbeApp *app);
void practice_screen_open_tab(InbeApp *app, int tab);
void practice_screen_draw_top_bar(InbeApp *app, int draw_menu);
void practice_screen_draw_floating_actions(InbeApp *app);
void practice_screen_draw_modal(InbeApp *app);
int practice_screen_first_run_guide_active(const InbeApp *app);
void practice_screen_prepare_first_run_guide(InbeApp *app);
void practice_screen_draw_first_run_guide(InbeApp *app);
+804
View File
@@ -0,0 +1,804 @@
#include "profile_screen.h"
#include "app.h"
#include "text_utils.h"
#include "flint_locale.h"
#include "flint_theme.h"
#include "flint_ui.h"
#include "profile_social.h"
#include "practice_screen.h"
#include "settings/settings_data.h"
#include "settings/settings_screen.h"
#include "settings/settings_sync_account.h"
#include "storage.h"
#include "sync_account.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
extern int view_height;
extern int view_width;
#define INBE_SYNC_SERVER_URL_KEY "sync_server_url"
enum {
PROFILE_GUIDE_STEPS = 3
};
static void
profile_format_size(char *out, size_t out_size, long long bytes)
{
if(bytes >= 1024LL * 1024LL)
snprintf(out, out_size, "%lld MB",
(bytes + 1024LL * 1024LL / 2) / (1024LL * 1024LL));
else if(bytes >= 1024)
snprintf(out, out_size, "%lld KB", (bytes + 1024 / 2) / 1024);
else
snprintf(out, out_size, "%lld B", bytes);
}
static int
profile_main_content_height(int content_w)
{
(void)content_w;
return flint_px(700);
}
static int
profile_data_content_height(int content_w)
{
int height = settings_data_content_height(content_w) + flint_px(104);
if(sync_account_load(&(InbeSyncAccount){0}))
height += flint_px(86);
return height;
}
static int
profile_sync_content_height(int content_w)
{
(void)content_w;
return flint_px(430);
}
static int
profile_habits_content_height(int content_w)
{
int row_h = content_w < flint_px(260) ? flint_px(78) : flint_px(48);
return flint_px(90) + row_h * INBE_HABIT_MAX;
}
static int
profile_habits_overview_label_width(int content_w)
{
int min_label_w = flint_px(52);
int max_label_w = flint_px(128);
int gap = flint_px(4);
int cell = flint_px(26);
int label_w = content_w - gap * 7 - cell * 7;
if(label_w < min_label_w)
label_w = min_label_w;
if(label_w > max_label_w)
label_w = max_label_w;
return label_w;
}
static int
profile_habits_overview_cell_size(int content_w)
{
int label_w = profile_habits_overview_label_width(content_w);
int gap = flint_px(4);
int cell = (content_w - label_w - gap * 7) / 7;
if(cell > flint_px(26))
cell = flint_px(26);
if(cell < flint_px(16))
cell = flint_px(16);
return cell;
}
static int
profile_habits_overview_stack_header(int content_w)
{
return content_w < flint_px(300);
}
static int
profile_habits_overview_height(const InbeApp *app, int content_w)
{
int count = app != NULL ? app->habits.count : 0;
int rows = count > 0 ? count : 1;
int cell = profile_habits_overview_cell_size(content_w);
int header_h = flint_px(32) + flint_px(8);
if(profile_habits_overview_stack_header(content_w))
header_h += flint_px(38);
return header_h + flint_px(20) + rows * (cell + flint_px(6)) +
flint_px(18);
}
static int
profile_practices_content_height(int content_w)
{
(void)content_w;
return flint_px(92) + flint_px(46) * EXERCISE_COUNT;
}
static int
profile_content_height(int content_w, void *user_data)
{
InbeApp *app = user_data;
if(app != NULL && app->profile_view == PROFILE_VIEW_DATA)
return profile_data_content_height(content_w);
if(app != NULL && app->profile_view == PROFILE_VIEW_SYNC_ACCOUNT)
return profile_sync_content_height(content_w);
if(app != NULL && app->profile_view == PROFILE_VIEW_HABITS)
return profile_habits_content_height(content_w);
if(app != NULL && app->profile_view == PROFILE_VIEW_PRACTICES)
return profile_practices_content_height(content_w);
if(app != NULL && app->profile_tab == PROFILE_TAB_FRIENDS)
return flint_px(740);
if(app != NULL && app->profile_tab == PROFILE_TAB_LEADERBOARD)
return flint_px(660);
if(app != NULL && app->profile_tab == PROFILE_TAB_DATA)
return profile_data_content_height(content_w);
return profile_main_content_height(content_w) +
profile_habits_overview_height(app, content_w);
}
static const char *
profile_practice_label(int index)
{
switch(index) {
case EXERCISE_MEDITATION:
return locale_get("exercise_meditation");
case EXERCISE_SUN_SALUTATION:
return locale_get("exercise_sun_salutation");
case EXERCISE_WIM_HOF:
default:
return locale_get("exercise_wim_hof");
}
}
static void
profile_draw_stat_row(int x, int w, int *y, const char *label, const char *value)
{
int font = flint_ui_font();
int small_font = flint_ui_font_small();
int value_w;
flint_text_draw(label, x, *y, small_font, flint_darken(flint_theme_get_text(), 35));
value_w = flint_text_measure(value, font);
flint_text_draw(value, x + w - value_w, *y - flint_px(2), font, flint_theme_get_text());
*y += flint_px(28);
}
static void
profile_draw_data_summary(int x, int w, int *y)
{
char value[64];
snprintf(value, sizeof(value), "%d", storage_habit_count());
profile_draw_stat_row(x, w, y, locale_get("profile_habits_label"), value);
snprintf(value, sizeof(value), "%d", storage_session_count());
profile_draw_stat_row(x, w, y, locale_get("profile_sessions_label"), value);
profile_format_size(value, sizeof(value), storage_total_size());
profile_draw_stat_row(x, w, y, locale_get("profile_storage_label"), value);
}
static void
profile_draw_divider(int x, int w, int y)
{
DrawLine(x, y, x + w, y, flint_darken(flint_theme_get_bg(), 28));
}
static const char *
profile_tab_title(int tab)
{
switch(tab) {
case PROFILE_TAB_FRIENDS:
return locale_get("profile_friends_title");
case PROFILE_TAB_LEADERBOARD:
return locale_get("profile_leaderboard_title");
case PROFILE_TAB_DATA:
return locale_get("profile_data_title");
case PROFILE_TAB_OVERVIEW:
default:
return locale_get("tab_profile");
}
}
static void
profile_overview_column(int *x, int *w)
{
flint_centered_column(flint_px(CONTENT_MAX_W), flint_page_side_padding(), x, w);
}
static Rectangle
profile_guide_account_anchor(void)
{
int x;
int w;
profile_overview_column(&x, &w);
return (Rectangle){(float)(x - flint_px(6)), (float)flint_px(8),
(float)(w + flint_px(12)), (float)flint_px(70)};
}
static Rectangle
profile_guide_data_anchor(InbeApp *app)
{
int x;
int w;
profile_overview_column(&x, &w);
return (Rectangle){(float)(x - flint_px(6)),
(float)(flint_px(82) +
profile_habits_overview_height(app, w) - flint_px(6)),
(float)(w + flint_px(12)), (float)flint_px(190)};
}
static Rectangle
profile_guide_social_anchor(InbeApp *app)
{
int x;
int w;
profile_overview_column(&x, &w);
return (Rectangle){(float)(x - flint_px(6)),
(float)(flint_px(278) +
profile_habits_overview_height(app, w) - flint_px(6)),
(float)(w + flint_px(12)), (float)flint_px(102)};
}
static void
profile_screen_finish_first_run_guide(InbeApp *app)
{
if(app == NULL)
return;
app->profile_guide_seen = 1;
app->profile_guide_step = 0;
save_settings(app);
}
int
profile_screen_first_run_guide_active(const InbeApp *app)
{
return app != NULL && !app->profile_guide_seen && !app->modal.active &&
app->inbe.screen == InbeScreenProfile;
}
void
profile_screen_prepare_first_run_guide(InbeApp *app)
{
if(!profile_screen_first_run_guide_active(app))
return;
app->profile_guide_step = clampi(app->profile_guide_step, 0, PROFILE_GUIDE_STEPS - 1);
app->profile_view = PROFILE_VIEW_MAIN;
app->profile_tab = PROFILE_TAB_OVERVIEW;
app->profile_scroll = 0;
}
void
profile_screen_draw_first_run_guide(InbeApp *app)
{
FlintUIGuideStep steps[PROFILE_GUIDE_STEPS];
FlintUIGuideResult result;
if(!profile_screen_first_run_guide_active(app))
return;
steps[0] = (FlintUIGuideStep){
.anchor = profile_guide_account_anchor(),
.text = locale_get("profile_guide_account")
};
steps[1] = (FlintUIGuideStep){
.anchor = profile_guide_data_anchor(app),
.text = locale_get("profile_guide_data")
};
steps[2] = (FlintUIGuideStep){
.anchor = profile_guide_social_anchor(app),
.text = locale_get(sync_account_load(&(InbeSyncAccount){0})
? "profile_guide_social"
: "profile_guide_social_no_account")
};
result = flint_ui_draw_guide_overlay((FlintUIGuideOverlay){
.steps = steps,
.count = PROFILE_GUIDE_STEPS,
.step = &app->profile_guide_step,
.view_width = view_width,
.view_height = view_height,
.reserved_top = 0,
.reserved_bottom = ui_bottom_nav_height(),
.max_width = flint_px(300),
.paragraph_font = flint_ui_font_small(),
.close_icon = app->icons[UI_ICON_TYPE_X],
.back_icon = app->icons[UI_ICON_TYPE_BACKWARD],
.next_icon = app->icons[UI_ICON_TYPE_FORWARD],
.done_icon = app->icons[UI_ICON_TYPE_CHECK]
});
if(result.closed || result.finished)
profile_screen_finish_first_run_guide(app);
}
static void
profile_draw_summary_columns(int x, int w, int *y)
{
char habits[32];
char sessions[32];
char storage[64];
const char *labels[3] = {
locale_get("profile_habits_label"),
locale_get("profile_sessions_label"),
locale_get("profile_storage_label")
};
const char *values[3] = {habits, sessions, storage};
int col_w = w / 3;
int value_font = FLINT_TEXT_16;
int label_font = flint_ui_font_small();
snprintf(habits, sizeof(habits), "%d", storage_habit_count());
snprintf(sessions, sizeof(sessions), "%d", storage_session_count());
profile_format_size(storage, sizeof(storage), storage_total_size());
for(int i = 0; i < 3; i++) {
int cx = x + i * col_w;
int cw = i == 2 ? x + w - cx : col_w;
flint_text_draw(values[i], cx, *y, value_font, flint_theme_get_text());
flint_text_draw(labels[i], cx, *y + flint_px(24), label_font,
flint_darken(flint_theme_get_text(), 32));
if(i < 2)
DrawLine(cx + cw - flint_px(10), *y - flint_px(2),
cx + cw - flint_px(10), *y + flint_px(42),
flint_darken(flint_theme_get_bg(), 24));
}
*y += flint_px(58);
}
static void
profile_draw_fitted_text(const char *text, int x, int y, int max_w, int font, Color color)
{
char fitted[INBE_HABIT_NAME_SIZE + 4];
if(text == NULL || max_w <= 0)
return;
inbe_text_fit_ellipsis(text, fitted, sizeof(fitted), max_w, font);
flint_text_draw(fitted, x, y, font, color);
}
static int
profile_week_day_index(int offset)
{
time_t now = time(NULL);
struct tm week;
struct tm *local = localtime(&now);
int sunday_delta;
if(local == NULL)
return habits_today_index();
week = *local;
sunday_delta = week.tm_wday;
week.tm_hour = 12;
week.tm_min = 0;
week.tm_sec = 0;
week.tm_mday += offset - sunday_delta;
if(mktime(&week) == (time_t)-1)
return habits_today_index();
return (week.tm_year + 1900) * 10000 + (week.tm_mon + 1) * 100 +
week.tm_mday;
}
static void
profile_draw_habits_overview(InbeApp *app, int x, int w, int *y)
{
int font = flint_ui_font();
int small = flint_ui_font_small();
int btn_h = flint_px(32);
int btn_w = flint_px(132);
int label_w = profile_habits_overview_label_width(w);
int gap = flint_px(8);
int cell_gap = flint_px(4);
int cell = profile_habits_overview_cell_size(w);
int grid_total_w = label_w + cell_gap * 7 + cell * 7;
int overview_x = x + (w - grid_total_w) / 2;
int grid_x = overview_x + label_w;
int grid_y;
int today_index = habits_today_index();
int completed_count = 0;
int manage_hover = 0;
int stack_header = profile_habits_overview_stack_header(w);
char progress_text[64];
const char *day_labels[7] = {"S", "M", "T", "W", "T", "F", "S"};
if(app == NULL)
return;
for(int i = 0; i < app->habits.count; i++) {
if(habit_completed_today(&app->habits.items[i]))
completed_count++;
}
locale_format(progress_text, sizeof(progress_text), "profile_habits_today_format",
completed_count, app->habits.count);
if(stack_header) {
profile_draw_fitted_text(progress_text, x, *y + flint_px(2), w, font,
flint_theme_get_text());
*y += flint_px(28);
if(ui_draw_generic_button(x, *y, w, btn_h,
locale_get("profile_manage_habits_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &manage_hover)) {
app->profile_view = PROFILE_VIEW_HABITS;
app->profile_scroll = 0;
settings_screen_clear_status();
}
} else {
int progress_w = w - btn_w - gap;
profile_draw_fitted_text(progress_text, x, *y + flint_px(7), progress_w, font,
flint_theme_get_text());
if(ui_draw_generic_button(x + w - btn_w, *y, btn_w, btn_h,
locale_get("profile_manage_habits_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &manage_hover)) {
app->profile_view = PROFILE_VIEW_HABITS;
app->profile_scroll = 0;
settings_screen_clear_status();
}
}
*y += btn_h + flint_px(8);
if(app->habits.count <= 0) {
flint_text_draw(locale_get("habit_empty_title"), x, *y + flint_px(6), small,
flint_darken(flint_theme_get_text(), 35));
*y += cell + flint_px(6);
} else {
grid_y = *y;
for(int day = 0; day < 7; day++) {
int day_x = grid_x + day * (cell + cell_gap);
int label_w_px = flint_text_measure(day_labels[day], small);
flint_text_draw(day_labels[day], day_x + (cell - label_w_px) / 2,
grid_y, small, flint_darken(flint_theme_get_text(), 34));
}
*y += flint_px(20);
for(int i = 0; i < app->habits.count; i++) {
InbeHabit *habit = &app->habits.items[i];
int row_y = *y;
char short_name[8];
int swatch = flint_px(8);
const char *label = habit->name;
char fitted_label[INBE_HABIT_NAME_SIZE + 4];
int label_text_w = label_w - swatch - flint_px(7);
if(label_w <= flint_px(60)) {
inbe_text_short_label(habit->name, 3, 1, short_name, sizeof(short_name));
label = short_name;
} else if(flint_text_measure(label, small) > label_text_w) {
inbe_text_fit_ellipsis(habit->name, fitted_label, sizeof(fitted_label),
label_text_w, small);
label = fitted_label;
}
DrawRectangle(overview_x, row_y + (cell - swatch) / 2, swatch, swatch,
habit->color);
flint_text_draw(label, overview_x + swatch + flint_px(5),
flint_ui_text_y(label, row_y, cell, small),
small,
flint_theme_get_text());
for(int day = 0; day < 7; day++) {
int day_index = profile_week_day_index(day);
int completed = habit_completed_day(habit, day_index);
int day_x = grid_x + day * (cell + cell_gap);
Color fill = completed ? habit->color : flint_darken(flint_theme_get_bg(), 7);
Color border = day_index == today_index
? flint_theme_get_text()
: flint_darken(flint_theme_get_text(), 46);
DrawRectangle(day_x, row_y, cell, cell, fill);
DrawRectangleLines(day_x, row_y, cell, cell, border);
}
*y += cell + flint_px(6);
}
}
profile_draw_divider(x, w, *y);
*y += flint_px(18);
}
static void
profile_draw_overview(InbeApp *app, int x, int w, int *y)
{
int font = flint_ui_font();
int small = flint_ui_font_small();
int btn_h = flint_px(34);
int hover_account = 0;
int hover_data = 0;
int hover_habits = 0;
int hover_practices = 0;
int hover_friends = 0;
int hover_leaderboard = 0;
int half_w = (w - flint_px(8)) / 2;
InbeSyncAccount account;
int has_account;
const char *alias;
char account_text[96];
char pending_text[64];
char friend_text[64];
*y += flint_px(14);
has_account = sync_account_load(&account);
alias = storage_get_setting_text("sync_account_alias");
account_text[0] = '\0';
if(has_account) {
if(alias != NULL && alias[0] != '\0') {
snprintf(account_text, sizeof(account_text), "@%s", alias);
} else {
snprintf(account_text, sizeof(account_text), "%.12s...", account.public_id);
}
} else {
snprintf(account_text, sizeof(account_text), "%s", locale_get("profile_no_account"));
}
flint_text_draw(locale_get("profile_account_section"), x, *y, small,
flint_darken(flint_theme_get_text(), 35));
*y += flint_px(18);
flint_text_draw(account_text, x, *y, font, flint_theme_get_text());
if(ui_draw_generic_button(x + w - flint_px(132), *y - flint_px(8), flint_px(132),
btn_h, locale_get("profile_configure_button"),
UI_BUTTON_STYLE_SECONDARY, 0,
&hover_account))
settings_data_open_sync_account_config(app);
*y += flint_px(38);
profile_draw_divider(x, w, *y);
*y += flint_px(18);
profile_draw_habits_overview(app, x, w, y);
flint_text_draw(locale_get("profile_data_section"), x, *y, small,
flint_darken(flint_theme_get_text(), 35));
*y += flint_px(24);
profile_draw_summary_columns(x, w, y);
if(ui_draw_generic_button(x, *y, w, btn_h, locale_get("profile_data_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &hover_data)) {
app->profile_tab = PROFILE_TAB_DATA;
app->profile_scroll = 0;
settings_screen_clear_status();
}
*y += btn_h + flint_px(8);
if(ui_draw_generic_button(x, *y, half_w, btn_h, locale_get("profile_my_habits_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &hover_habits)) {
app->profile_view = PROFILE_VIEW_HABITS;
app->profile_scroll = 0;
settings_screen_clear_status();
}
if(ui_draw_generic_button(x + half_w + flint_px(8), *y, half_w, btn_h,
locale_get("profile_my_practices_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &hover_practices)) {
app->profile_view = PROFILE_VIEW_PRACTICES;
app->profile_scroll = 0;
settings_screen_clear_status();
}
*y += btn_h + flint_px(20);
profile_draw_divider(x, w, *y);
*y += flint_px(18);
snprintf(friend_text, sizeof(friend_text), locale_get("profile_friends_count_format"),
profile_social_friends_count(app));
snprintf(pending_text, sizeof(pending_text), locale_get("profile_pending_count_format"),
profile_social_pending_count(app));
flint_text_draw(locale_get("profile_social_section"), x, *y, small,
flint_darken(flint_theme_get_text(), 35));
*y += flint_px(20);
flint_text_draw(friend_text, x, *y, font, flint_theme_get_text());
flint_text_draw(pending_text, x + w - flint_text_measure(pending_text, font), *y,
font, flint_theme_get_text());
*y += flint_px(34);
if(ui_draw_generic_button(x, *y, half_w, btn_h, locale_get("profile_friends_title"),
UI_BUTTON_STYLE_PRIMARY, !has_account, &hover_friends)) {
app->profile_tab = PROFILE_TAB_FRIENDS;
app->profile_scroll = 0;
}
if(ui_draw_generic_button(x + half_w + flint_px(8), *y, half_w, btn_h,
locale_get("profile_leaderboard_title"), UI_BUTTON_STYLE_PRIMARY,
!has_account, &hover_leaderboard)) {
app->profile_tab = PROFILE_TAB_LEADERBOARD;
app->profile_scroll = 0;
}
*y += btn_h + flint_px(16);
}
static void
profile_draw_data(InbeApp *app, int x, int w, int *y)
{
int font = flint_ui_font();
*y += flint_px(12);
flint_text_draw(locale_get("profile_data_title"), x, *y, font, flint_theme_get_text());
*y += flint_px(28);
profile_draw_data_summary(x, w, y);
settings_data_draw_sync_status(x, w, y);
*y += flint_px(10);
settings_data_draw_actions(app, x, w, y);
}
static void
profile_draw_habits(InbeApp *app, int x, int w, int *y)
{
int font = flint_ui_font();
int small = flint_ui_font_small();
int btn_h = flint_px(32);
int btn_w = flint_px(74);
int gap = flint_px(8);
int stack_rows = w < flint_px(260);
*y += flint_px(16);
for(int i = 0; i < app->habits.count; i++) {
int row_y = *y;
int up_hover = 0;
int down_hover = 0;
int controls_w = btn_w * 2 + gap;
int name_w = stack_rows ? w : w - controls_w - gap;
profile_draw_fitted_text(app->habits.items[i].name, x, row_y + flint_px(7),
name_w, font, flint_theme_get_text());
if(stack_rows)
row_y += flint_px(36);
if(ui_draw_generic_button(stack_rows ? x : x + w - btn_w * 2 - gap,
row_y, btn_w, btn_h,
locale_get("move_up_button"),
UI_BUTTON_STYLE_SECONDARY, i == 0, &up_hover)) {
if(habits_move(&app->habits, i, i - 1))
app_auto_sync(app);
return;
}
if(ui_draw_generic_button(stack_rows ? x + btn_w + gap : x + w - btn_w,
row_y, btn_w, btn_h,
locale_get("move_down_button"),
UI_BUTTON_STYLE_SECONDARY,
i == app->habits.count - 1, &down_hover)) {
if(habits_move(&app->habits, i, i + 1))
app_auto_sync(app);
return;
}
*y += stack_rows ? flint_px(78) : flint_px(46);
profile_draw_divider(x, w, *y - flint_px(6));
}
if(app->habits.count <= 0)
flint_text_draw(locale_get("habit_empty_title"), x, *y, small,
flint_darken(flint_theme_get_text(), 35));
}
static void
profile_draw_practices(InbeApp *app, int x, int w, int *y)
{
int font = flint_ui_font();
(void)w;
*y += flint_px(16);
flint_text_draw(locale_get("profile_my_practices_title"), x, *y, font,
flint_theme_get_text());
*y += flint_px(34);
for(int i = 0; i < EXERCISE_COUNT; i++) {
int enabled = practice_is_visible(app, i);
if(ui_draw_checkbox_row((FlintUICheckboxRow){
.label = profile_practice_label(i),
.value = &enabled
}, x, *y)) {
practice_set_visible(app, i, enabled);
}
*y += ui_checkbox_row_height((FlintUICheckboxRow){0});
}
}
int
profile_screen_draw(InbeApp *app)
{
int is_profile_subpage = app->profile_view == PROFILE_VIEW_MAIN &&
app->profile_tab != PROFILE_TAB_OVERVIEW;
int header_h = (app->profile_view != PROFILE_VIEW_MAIN || is_profile_subpage)
? flint_px(58)
: 0;
int content_y = header_h;
int content_h = view_height - content_y - app_content_bottom_reserved(app);
FlintUIScrollPage page;
int y;
#if ANDROID_BUILD
settings_data_handle_android_import(app);
#elif defined(PLATFORM_WEB)
settings_data_handle_web_import(app);
#endif
if(settings_data_draw_pending_file_dialog(app))
return 1;
if(app->profile_tab < 0 || app->profile_tab >= PROFILE_TAB_COUNT)
app->profile_tab = PROFILE_TAB_OVERVIEW;
if((app->profile_tab == PROFILE_TAB_FRIENDS ||
app->profile_tab == PROFILE_TAB_LEADERBOARD) &&
!sync_account_load(&(InbeSyncAccount){0})) {
app->profile_tab = PROFILE_TAB_OVERVIEW;
app->profile_scroll = 0;
}
if(app->profile_view != PROFILE_VIEW_MAIN) {
const char *title = locale_get("profile_data_title");
if(app->profile_view == PROFILE_VIEW_SYNC_ACCOUNT)
title = locale_get("sync_configure_account_button");
else if(app->profile_view == PROFILE_VIEW_HABITS)
title = locale_get("profile_my_habits_title");
else if(app->profile_view == PROFILE_VIEW_PRACTICES)
title = locale_get("profile_my_practices_title");
FlintUIHeader header = ui_draw_title_header(header_h, title,
app->icons[UI_ICON_TYPE_RETURN],
(Texture2D){0});
if(header.left_clicked) {
app->profile_view = PROFILE_VIEW_MAIN;
app->profile_scroll = 0;
app->sync_server_url_focused = 0;
settings_screen_clear_status();
}
} else if(is_profile_subpage) {
FlintUIHeader header = ui_draw_title_header(header_h,
profile_tab_title(app->profile_tab),
app->icons[UI_ICON_TYPE_RETURN],
(Texture2D){0});
if(header.left_clicked) {
app->profile_tab = PROFILE_TAB_OVERVIEW;
app->profile_scroll = 0;
settings_screen_clear_status();
}
}
if(content_h < 0)
content_h = 0;
page = ui_scroll_page_begin((FlintUIScrollPageSpec){
.y = content_y,
.height = content_h,
.max_content_width = flint_px(CONTENT_MAX_W),
.min_content_width = flint_px(320),
.scroll_offset = &app->profile_scroll,
.content_height = profile_content_height,
.user_data = app
});
y = page.content_y;
if(app->profile_view == PROFILE_VIEW_SYNC_ACCOUNT)
settings_sync_account_draw_config(app, page.content_x, page.content_w, &y);
else if(app->profile_view == PROFILE_VIEW_DATA)
profile_draw_data(app, page.content_x, page.content_w, &y);
else if(app->profile_view == PROFILE_VIEW_HABITS)
profile_draw_habits(app, page.content_x, page.content_w, &y);
else if(app->profile_view == PROFILE_VIEW_PRACTICES)
profile_draw_practices(app, page.content_x, page.content_w, &y);
else if(app->profile_tab == PROFILE_TAB_FRIENDS)
profile_social_draw_friends(app, page.content_x, page.content_w, &y);
else if(app->profile_tab == PROFILE_TAB_LEADERBOARD)
profile_social_draw_leaderboard(app, page.content_x, page.content_w, &y);
else if(app->profile_tab == PROFILE_TAB_DATA)
profile_draw_data(app, page.content_x, page.content_w, &y);
else
profile_draw_overview(app, page.content_x, page.content_w, &y);
ui_scroll_page_end(page);
if(app->profile_view == PROFILE_VIEW_MAIN &&
app->profile_tab == PROFILE_TAB_LEADERBOARD) {
ui_set_dropdown_clip_top(content_y);
ui_set_dropdown_clip_bottom(view_height - app_content_bottom_reserved(app));
if(ui_draw_dropdown_menu(811)) {
profile_social_load_leaderboard_cache(app);
app->profile_scroll = 0;
}
ui_set_dropdown_clip_top(0);
ui_set_dropdown_clip_bottom(0);
}
return 0;
}
Loaded 100 of 137 files, more files were not shown because too many files have changed in this diff. Show more