Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9cf77d05a | ||
|
|
8315898d00 | ||
|
|
f61a9e9094 | ||
|
|
f7cb61cf57 | ||
|
|
407e4fa2a0 | ||
|
|
7093dd1a51 | ||
|
|
f78cd854c8 | ||
|
|
44725b5bf6 | ||
|
|
894552e1b6 | ||
|
|
2695cf99a1 | ||
|
|
62317fa294 | ||
|
|
b492e59c90 | ||
|
|
86e529db36 |
No files matched your search
@@ -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,125 @@ 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 Alpha
|
||||
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 Closed Testing Alpha
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_JSON_KEY }}
|
||||
packageName: xyz.waozi.inbe
|
||||
releaseFiles: build/release/android/*.aab
|
||||
tracks: alpha
|
||||
status: completed
|
||||
|
||||
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
|
||||
@@ -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
|
||||
@@ -1,10 +1,40 @@
|
||||
# Changelog
|
||||
## [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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -148,6 +174,7 @@ APP_SRCS := \
|
||||
src/main.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,6 +192,8 @@ APP_SRCS := \
|
||||
src/screens/statistics_screen.c \
|
||||
src/screens/habits/edit.c \
|
||||
src/screens/habits/session.c \
|
||||
src/screens/profile_screen.c \
|
||||
src/screens/pet_screen.c \
|
||||
src/practices/meditation/meditation_music.c \
|
||||
src/storage/data.c \
|
||||
src/storage/db.c \
|
||||
@@ -182,11 +211,12 @@ APP_SRCS := \
|
||||
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
|
||||
@@ -294,7 +324,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)
|
||||
@@ -353,12 +383,12 @@ $(SYNC_URL_TEST): tests/sync_url_test.c src/storage/sync_client.c src/storage/sy
|
||||
tests/sync_url_test.c src/storage/sync_client.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/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/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)
|
||||
$(CC) -Wall -Wextra -std=c99 -D_DEFAULT_SOURCE -D_GNU_SOURCE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES -ffunction-sections -fdata-sections \
|
||||
@@ -453,6 +483,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 +539,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 +570,23 @@ $(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_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 +618,23 @@ $(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_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 +643,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 +658,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 +676,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 +717,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 +734,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 +757,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 +839,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 \
|
||||
|
||||
@@ -106,6 +106,10 @@ The AVD is configured with:
|
||||
|
||||
When updating other projects that vendor Flint as a submodule, this keeps UI behavior and API docs aligned.
|
||||
|
||||
## Sync model
|
||||
|
||||
Inbe is offline-first. User-owned app data moves through the storage sync chain; social data is server-authorized. Friends, requests, and leaderboard snapshots are cached locally for fast/offline UI, but Lyra owns the authoritative social state and refreshes those caches through authenticated sync.
|
||||
|
||||
## License
|
||||
|
||||
MIT - see [LICENSE](LICENSE)
|
||||
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -35,8 +35,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 35
|
||||
versionCode 58
|
||||
versionName "1.6.2"
|
||||
versionCode 63
|
||||
versionName "1.7.0"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
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:theme="@android:style/Theme.DeviceDefault.NoActionBar"
|
||||
android:windowLayoutInDisplayCutoutMode="never">
|
||||
|
||||
@@ -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
|
||||
@@ -107,6 +111,7 @@ add_library(main SHARED
|
||||
"${SRC_DIR}/main.c"
|
||||
"${SRC_DIR}/core/breath_engine.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,6 +129,8 @@ 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/pet_screen.c"
|
||||
"${SRC_DIR}/practices/meditation/meditation_music.c"
|
||||
"${SRC_DIR}/storage/data.c"
|
||||
"${SRC_DIR}/storage/db.c"
|
||||
@@ -145,6 +152,7 @@ add_library(main SHARED
|
||||
"${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 +193,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
|
||||
|
||||
@@ -11,16 +11,17 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Color;
|
||||
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 java.io.File;
|
||||
@@ -28,15 +29,10 @@ 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,7 +45,7 @@ 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;
|
||||
@@ -305,224 +301,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 +407,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 +432,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++) {
|
||||
@@ -670,10 +454,45 @@ public class MainActivity extends NativeActivity {
|
||||
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);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
getWindow().setDecorFitsSystemWindows(false);
|
||||
}
|
||||
getWindow().setNavigationBarColor(Color.BLACK);
|
||||
getWindow().setStatusBarColor(Color.BLACK);
|
||||
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) {
|
||||
getWindow().setNavigationBarContrastEnforced(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void pushDeviceConfiguration() {
|
||||
Configuration config = getResources().getConfiguration();
|
||||
int nightMask = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
@@ -740,38 +559,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 +570,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 +580,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();
|
||||
@@ -868,6 +658,7 @@ public class MainActivity extends NativeActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
activityPaused = false;
|
||||
configureSystemBars();
|
||||
nativeInvalidateGraphicsResources();
|
||||
requestInsetRefresh();
|
||||
syncLifecycleState("onResume");
|
||||
@@ -877,6 +668,10 @@ public class MainActivity extends NativeActivity {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 511 B |
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 511 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 559 B |
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 559 B |
|
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 657 B |
|
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 657 B |
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
@@ -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.
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Historie
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Návyky
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Označit
|
||||
[tab_manual]
|
||||
Návod
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Nastavení
|
||||
---
|
||||
@@ -157,6 +178,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,14 +286,11 @@ Vzhled
|
||||
[settings_section_language]
|
||||
Jazyk
|
||||
---
|
||||
[settings_tab_data]
|
||||
Data
|
||||
---
|
||||
[settings_section_data]
|
||||
Data
|
||||
---
|
||||
[settings_tab_about]
|
||||
O aplikaci
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Motiv
|
||||
@@ -305,10 +338,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 +365,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 +591,7 @@ Oceán
|
||||
Les
|
||||
---
|
||||
[theme_sunset]
|
||||
Západ slunce
|
||||
Soumrak
|
||||
---
|
||||
[theme_lavender]
|
||||
Levandule
|
||||
@@ -738,10 +780,10 @@ Název
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -871,13 +885,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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Relace je aktivni
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Zadrz: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Nadech: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Dalsi kolo
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Verlauf
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Gewohnheiten
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Markieren
|
||||
[tab_manual]
|
||||
Anleitung
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Einstellungen
|
||||
---
|
||||
@@ -157,6 +178,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 +286,11 @@ Darstellung
|
||||
[settings_section_language]
|
||||
Sprache
|
||||
---
|
||||
[settings_tab_data]
|
||||
Daten
|
||||
---
|
||||
[settings_section_data]
|
||||
Daten
|
||||
---
|
||||
[settings_tab_about]
|
||||
Über
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Thema
|
||||
@@ -305,10 +338,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 +365,7 @@ Kreis
|
||||
Lautstärke
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Lautstaerkeregler anzeigen
|
||||
Lautstärkeregler anzeigen
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Auf Standard zurücksetzen
|
||||
@@ -549,7 +591,7 @@ Ozean
|
||||
Wald
|
||||
---
|
||||
[theme_sunset]
|
||||
Sonnenuntergang
|
||||
Abendrot
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavendel
|
||||
@@ -738,10 +780,10 @@ Bezeichnung
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -864,20 +878,20 @@ Sieh dir hier deine Gewohnheitsstatistiken an.
|
||||
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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sitzung aktiv
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Halten: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Einatmen: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Naechste Runde
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
History
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Habits
|
||||
---
|
||||
@@ -22,6 +25,24 @@ 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
|
||||
---
|
||||
[tab_settings]
|
||||
Settings
|
||||
---
|
||||
@@ -160,6 +181,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 +292,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 +403,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
|
||||
---
|
||||
@@ -780,7 +822,7 @@ Name
|
||||
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 +860,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 +887,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.
|
||||
@@ -923,9 +937,6 @@ Fade
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
---
|
||||
[notification_session_active]
|
||||
Session active
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Starting: %ds
|
||||
---
|
||||
@@ -938,6 +949,6 @@ Hold: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Breath in: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Next round
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Historial
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Hábitos
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Marcar
|
||||
[tab_manual]
|
||||
Manual
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Configuración
|
||||
---
|
||||
@@ -157,6 +178,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,14 +286,11 @@ Apariencia
|
||||
[settings_section_language]
|
||||
Idioma
|
||||
---
|
||||
[settings_tab_data]
|
||||
Datos
|
||||
---
|
||||
[settings_section_data]
|
||||
Datos
|
||||
---
|
||||
[settings_tab_about]
|
||||
Acerca de
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Tema
|
||||
@@ -305,10 +338,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
|
||||
@@ -738,10 +780,10 @@ Nombre
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -871,13 +885,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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesion activa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Retencion: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inhala: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Siguiente ronda
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Historique
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Habitudes
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Marquer
|
||||
[tab_manual]
|
||||
Tutoriel
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Réglages
|
||||
---
|
||||
@@ -157,6 +178,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 +289,11 @@ Apparence
|
||||
[settings_section_language]
|
||||
Langue
|
||||
---
|
||||
[settings_tab_data]
|
||||
Données
|
||||
---
|
||||
[settings_section_data]
|
||||
Données
|
||||
---
|
||||
[settings_tab_about]
|
||||
À propos
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Thème
|
||||
@@ -308,10 +341,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 +368,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 +594,7 @@ Océan
|
||||
Forêt
|
||||
---
|
||||
[theme_sunset]
|
||||
Coucher de soleil
|
||||
Crépuscule
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavande
|
||||
@@ -780,10 +822,10 @@ Nom
|
||||
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 +860,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 +887,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 +901,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.
|
||||
---
|
||||
@@ -913,16 +927,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 +947,6 @@ Retention : %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspirez : %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Tour suivant
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Riwayat
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Kebiasaan
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Tandai
|
||||
[tab_manual]
|
||||
Manual
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Pengaturan
|
||||
---
|
||||
@@ -157,6 +178,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,14 +286,11 @@ Tampilan
|
||||
[settings_section_language]
|
||||
Bahasa
|
||||
---
|
||||
[settings_tab_data]
|
||||
Data
|
||||
---
|
||||
[settings_section_data]
|
||||
Data
|
||||
---
|
||||
[settings_tab_about]
|
||||
Tentang
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Tema
|
||||
@@ -305,10 +338,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
|
||||
@@ -738,10 +780,10 @@ Nama
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -864,20 +878,20 @@ Lihat statistik kebiasaan Anda di sini.
|
||||
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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesi aktif
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Mulai: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Tahan: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Tarik napas: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Ronde berikutnya
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Cronologia
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Abitudini
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Segna Come Fatto
|
||||
[tab_manual]
|
||||
Manuale
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Impostazioni
|
||||
---
|
||||
@@ -157,6 +178,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 +286,11 @@ Aspetto
|
||||
[settings_section_language]
|
||||
Lingua
|
||||
---
|
||||
[settings_tab_data]
|
||||
Dati
|
||||
---
|
||||
[settings_section_data]
|
||||
Dati
|
||||
---
|
||||
[settings_tab_about]
|
||||
Info
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Tema
|
||||
@@ -359,10 +392,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 +419,7 @@ Cerchio
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Mostra il controllo volume
|
||||
Mostra controllo volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Ripristina predefiniti
|
||||
@@ -738,10 +780,10 @@ Nome
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -864,20 +878,20 @@ Visualizza qui le statistiche delle abitudini.
|
||||
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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessione attiva
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Avvio: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Trattieni: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspira: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Round successivo
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@
|
||||
[tab_history]
|
||||
履歴
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
習慣
|
||||
---
|
||||
@@ -22,6 +25,24 @@
|
||||
[tab_manual]
|
||||
チュートリアル
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
設定
|
||||
---
|
||||
@@ -157,6 +178,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 +286,11 @@ OK
|
||||
[settings_section_language]
|
||||
言語
|
||||
---
|
||||
[settings_tab_data]
|
||||
データ
|
||||
---
|
||||
[settings_section_data]
|
||||
データ
|
||||
---
|
||||
[settings_tab_about]
|
||||
情報
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
テーマ
|
||||
@@ -305,10 +338,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]
|
||||
ホールド表示
|
||||
@@ -738,10 +780,10 @@ https:// または localhost:8080 のようなループバックを使用して
|
||||
下線
|
||||
---
|
||||
[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 +818,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 +845,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 +859,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
|
||||
[practice_guide_manual]
|
||||
練習を始める前にチュートリアルを読んで、エクササイズ全体を理解してください。
|
||||
---
|
||||
[practice_guide_sun]
|
||||
エクササイズを始める準備ができたら、太陽タブを使います。
|
||||
---
|
||||
[practice_guide_config]
|
||||
自分に合うように練習の設定を変更できます。
|
||||
---
|
||||
@@ -871,13 +885,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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
セッション中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
開始: %d秒
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
吸う: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
次のラウンド
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
기록
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
습관
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Inner Breeze
|
||||
[tab_manual]
|
||||
튜토리얼
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
설정
|
||||
---
|
||||
@@ -157,6 +178,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 +286,11 @@ Sun Salutation
|
||||
[settings_section_language]
|
||||
언어
|
||||
---
|
||||
[settings_tab_data]
|
||||
데이터
|
||||
---
|
||||
[settings_section_data]
|
||||
데이터
|
||||
---
|
||||
[settings_tab_about]
|
||||
정보
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
테마
|
||||
@@ -359,10 +392,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]
|
||||
홀드 표시
|
||||
@@ -737,10 +779,10 @@ https:// 또는 localhost:8080 같은 루프백을 사용하세요
|
||||
밑줄
|
||||
---
|
||||
[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 +817,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 +844,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 +858,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
|
||||
[practice_guide_manual]
|
||||
연습을 시작하기 전에 튜토리얼을 읽고 전체 운동을 이해하세요.
|
||||
---
|
||||
[practice_guide_sun]
|
||||
운동을 시작할 준비가 되면 태양 탭을 사용하세요.
|
||||
---
|
||||
[practice_guide_config]
|
||||
필요에 맞게 연습 설정을 변경하세요.
|
||||
---
|
||||
@@ -870,13 +884,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 +933,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
세션 진행 중
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
시작: %d초
|
||||
---
|
||||
@@ -934,7 +945,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
들이쉬기: %d초
|
||||
---
|
||||
[notification_next_round]
|
||||
다음 라운드
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
Histórico
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Hábitos
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Marcar
|
||||
[tab_manual]
|
||||
Manual
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Configurações
|
||||
---
|
||||
@@ -157,6 +178,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,14 +286,11 @@ Aparência
|
||||
[settings_section_language]
|
||||
Idioma
|
||||
---
|
||||
[settings_tab_data]
|
||||
Dados
|
||||
---
|
||||
[settings_section_data]
|
||||
Dados
|
||||
---
|
||||
[settings_tab_about]
|
||||
Sobre
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Tema
|
||||
@@ -305,10 +338,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 +591,7 @@ Oceano
|
||||
Floresta
|
||||
---
|
||||
[theme_sunset]
|
||||
Pôr do sol
|
||||
Poente
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavanda
|
||||
@@ -738,10 +780,10 @@ Nome
|
||||
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 +818,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 +845,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 +859,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.
|
||||
---
|
||||
@@ -864,20 +878,20 @@ Veja suas estatisticas de habitos aqui.
|
||||
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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessao ativa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Segure: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspire: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Proxima rodada
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@ Inner Breeze
|
||||
[tab_history]
|
||||
История
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
Привычки
|
||||
---
|
||||
@@ -22,6 +25,24 @@ Inner Breeze
|
||||
[tab_manual]
|
||||
Обучение
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
Настройки
|
||||
---
|
||||
@@ -160,6 +181,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,14 +289,11 @@ OK
|
||||
[settings_section_language]
|
||||
Язык
|
||||
---
|
||||
[settings_tab_data]
|
||||
Данные
|
||||
---
|
||||
[settings_section_data]
|
||||
Данные
|
||||
---
|
||||
[settings_tab_about]
|
||||
О приложении
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
Тема
|
||||
@@ -362,10 +395,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]
|
||||
Отображение задержки
|
||||
@@ -738,10 +780,10 @@ liboqs не собран для этой платформы.
|
||||
Подчеркивание
|
||||
---
|
||||
[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 +818,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 +845,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 +859,6 @@ Choose which practice sessions count for this habit. Matching days show as compl
|
||||
[practice_guide_manual]
|
||||
Прочитайте руководство перед началом практики, чтобы понять упражнение полностью.
|
||||
---
|
||||
[practice_guide_sun]
|
||||
Используйте вкладку с солнцем, когда будете готовы начать упражнение.
|
||||
---
|
||||
[practice_guide_config]
|
||||
Измените настройки практики под свои требования.
|
||||
---
|
||||
@@ -871,13 +885,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 +934,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Сессия активна
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Старт: %dс
|
||||
---
|
||||
@@ -935,7 +946,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
Вдох: %dс
|
||||
---
|
||||
[notification_next_round]
|
||||
Следующий раунд
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -4,6 +4,9 @@
|
||||
[tab_history]
|
||||
历史
|
||||
---
|
||||
[tab_profile]
|
||||
Profile
|
||||
---
|
||||
[tab_habits]
|
||||
习惯
|
||||
---
|
||||
@@ -22,6 +25,24 @@
|
||||
[tab_manual]
|
||||
教程
|
||||
---
|
||||
[tab_pet]
|
||||
Pet
|
||||
---
|
||||
[profile_data_title]
|
||||
Data
|
||||
---
|
||||
[profile_data_button]
|
||||
Configure Data
|
||||
---
|
||||
[profile_habits_label]
|
||||
Habits
|
||||
---
|
||||
[profile_sessions_label]
|
||||
Sessions
|
||||
---
|
||||
[profile_storage_label]
|
||||
Storage
|
||||
---
|
||||
[tab_settings]
|
||||
设置
|
||||
---
|
||||
@@ -157,6 +178,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 +286,11 @@ Sun Salutation
|
||||
[settings_section_language]
|
||||
语言
|
||||
---
|
||||
[settings_tab_data]
|
||||
数据
|
||||
---
|
||||
[settings_section_data]
|
||||
数据
|
||||
---
|
||||
[settings_tab_about]
|
||||
关于
|
||||
About
|
||||
---
|
||||
[about_text]
|
||||
A quiet breathing companion for practice, habits, and sync.
|
||||
---
|
||||
[theme_label]
|
||||
主题
|
||||
@@ -305,10 +338,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]
|
||||
屏息显示
|
||||
@@ -736,10 +778,10 @@ liboqs 未为此目标构建。
|
||||
下划线
|
||||
---
|
||||
[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 +816,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 +843,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 +857,6 @@ Wim Hof 屏息轮次
|
||||
[practice_guide_manual]
|
||||
开始练习前请先阅读教程,了解完整的练习流程。
|
||||
---
|
||||
[practice_guide_sun]
|
||||
准备开始练习时,请使用太阳标签。
|
||||
---
|
||||
[practice_guide_config]
|
||||
根据你的需要调整练习配置。
|
||||
---
|
||||
@@ -869,13 +883,13 @@ Wim Hof 屏息轮次
|
||||
---
|
||||
|
||||
[transition_label]
|
||||
Transition
|
||||
过渡
|
||||
[transition_none]
|
||||
None
|
||||
无
|
||||
[transition_fade]
|
||||
Fade
|
||||
淡入淡出
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
选择主题
|
||||
[skip_button]
|
||||
Skip
|
||||
---
|
||||
@@ -918,9 +932,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
练习进行中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
开始: %d秒
|
||||
---
|
||||
@@ -933,7 +944,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
吸气: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
下一轮
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
|
Before Width: | Height: | Size: 523 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 285 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
@@ -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 14, punch-hole test profile)"
|
||||
|
||||
# Check for Android SDK location
|
||||
if [ -z "$ANDROID_SDK_ROOT" ] && [ -z "$ANDROID_HOME" ]; then
|
||||
@@ -177,5 +177,6 @@ echo "✅ Done!"
|
||||
echo " Device: Pixel 8 Pro"
|
||||
echo " Android: 14 (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"
|
||||
@@ -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"
|
||||
@@ -86,6 +94,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
|
||||
|
||||
|
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 718 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 285 B |
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
|
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 1008 B |
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 683 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -44,10 +44,24 @@ 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,
|
||||
};
|
||||
|
||||
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,7 +89,8 @@ typedef enum {
|
||||
UIModalConfirmDeleteSyncAccount,
|
||||
UIModalHabitPracticeListInfo,
|
||||
UIModalHabitCountingInfo,
|
||||
UIModalBottomNavConfig,
|
||||
UIModalPracticeManual,
|
||||
UIModalPracticeConfig,
|
||||
UIModalThemePicker,
|
||||
UIModalSyncReview,
|
||||
UIModalSyncAlias,
|
||||
@@ -145,14 +160,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 +178,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 +206,10 @@ typedef struct SunSalutationPracticeState {
|
||||
int step_ticks;
|
||||
} SunSalutationPracticeState;
|
||||
|
||||
typedef struct PetPreviewState {
|
||||
Texture2D egg;
|
||||
} PetPreviewState;
|
||||
|
||||
typedef struct HabitSessionEditState {
|
||||
int scroll;
|
||||
int active;
|
||||
@@ -224,6 +247,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 +268,20 @@ 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_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];
|
||||
@@ -278,12 +315,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 +358,13 @@ 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);
|
||||
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 +386,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
|
||||
@@ -0,0 +1,216 @@
|
||||
#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() + app_android_bottom_nav_height();
|
||||
}
|
||||
|
||||
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;
|
||||
return app_current_nav_route(app) != APP_NAV_ROUTE_NONE;
|
||||
}
|
||||
|
||||
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_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
|
||||
};
|
||||
}
|
||||
if(app_android_bottom_nav_height() > 0)
|
||||
DrawRectangle(0, view_height - app_android_bottom_nav_height(),
|
||||
view_width, app_android_bottom_nav_height(), BLACK);
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef INBE_APP_NAV_H
|
||||
#define INBE_APP_NAV_H
|
||||
|
||||
#include "app_fwd.h"
|
||||
|
||||
int app_current_nav_route(const InbeApp *app);
|
||||
int app_content_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
|
||||
@@ -170,15 +170,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 +181,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},
|
||||
@@ -275,6 +269,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 +287,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 +301,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,
|
||||
|
||||
@@ -40,7 +40,9 @@ enum {
|
||||
InbeScreenPracticeConfig,
|
||||
InbeScreenLanguage,
|
||||
InbeScreenManual,
|
||||
InbeScreenProfile,
|
||||
InbeScreenHabits,
|
||||
InbeScreenPet,
|
||||
InbeScreenHabitEdit,
|
||||
InbeScreenHabitSessionEdit,
|
||||
};
|
||||
|
||||
@@ -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 0
|
||||
#define INBE_VERSION_STRING "1.7.0"
|
||||
|
||||
#endif
|
||||
@@ -207,12 +207,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 +218,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 +251,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 +290,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 +305,12 @@ 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
|
||||
}
|
||||
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 ||
|
||||
|
||||
@@ -57,7 +57,8 @@ 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);
|
||||
|
||||
@@ -81,7 +81,7 @@ void android_wakelock_acquire(void) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -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,32 @@ 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 - flint_px(8);
|
||||
if(scroll_h < 0)
|
||||
scroll_h = 0;
|
||||
|
||||
@@ -68,6 +192,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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,7 @@ 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 - flint_px(8);
|
||||
if(scroll_h < 0)
|
||||
scroll_h = 0;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -420,9 +425,12 @@ finish_round(InbeApp *app)
|
||||
if(session_ensure_results_saved(app)) {
|
||||
#if ANDROID_BUILD
|
||||
android_allow_screen_off();
|
||||
stop_android_background_session(app);
|
||||
android_timer_stop();
|
||||
#endif
|
||||
app_switch_screen(app, InbeScreenResults);
|
||||
#if ANDROID_BUILD
|
||||
session_update_notification(app);
|
||||
#endif
|
||||
} else {
|
||||
app_init(app);
|
||||
}
|
||||
|
||||
@@ -85,6 +85,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 +94,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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -424,8 +424,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 +447,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
|
||||
@@ -1246,11 +1252,36 @@ 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) {
|
||||
snprintf(fitted, sizeof(fitted), "%s", text);
|
||||
while(fitted[0] != '\0' && flint_text_measure(fitted, font_size) > w) {
|
||||
size_t len = strlen(fitted);
|
||||
size_t cut = len;
|
||||
|
||||
if(len <= 3)
|
||||
break;
|
||||
if(len > 3 && strcmp(fitted + len - 3, "...") == 0)
|
||||
len -= 3;
|
||||
cut = len;
|
||||
do {
|
||||
cut--;
|
||||
} while(cut > 0 && (((unsigned char)fitted[cut] & 0xC0) == 0x80));
|
||||
fitted[cut] = '\0';
|
||||
if(cut + 3 < sizeof(fitted))
|
||||
strncat(fitted, "...", sizeof(fitted) - strlen(fitted) - 1);
|
||||
}
|
||||
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 +1321,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ typedef struct InbeHabits {
|
||||
int view_mode;
|
||||
int tab;
|
||||
int weekly_days;
|
||||
int hold_stats_range_days;
|
||||
int loaded;
|
||||
int dirty;
|
||||
} InbeHabits;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
@@ -1,14 +1,16 @@
|
||||
#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
|
||||
@@ -29,17 +31,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)
|
||||
{
|
||||
@@ -55,69 +46,6 @@ practice_clamp_activity_to_tab(InbeApp *app)
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
practice_screen_open_tab(InbeApp *app, int tab)
|
||||
{
|
||||
@@ -128,6 +56,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 +68,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 +79,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);
|
||||
}
|
||||
}
|
||||
@@ -258,14 +191,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 +277,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 +368,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 +382,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],
|
||||
|
||||
@@ -14,6 +14,8 @@ const char *practice_activity_label(int exercise);
|
||||
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);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef INBE_PROFILE_SCREEN_H
|
||||
#define INBE_PROFILE_SCREEN_H
|
||||
|
||||
#include "app_fwd.h"
|
||||
|
||||
int profile_screen_draw(InbeApp *app);
|
||||
void profile_screen_refresh_social_cache(InbeApp *app);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,136 @@
|
||||
#include "settings_about.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "flint_locale.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
#include "version.h"
|
||||
#include "raylib.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static int
|
||||
about_link_icon_columns(int content_w)
|
||||
{
|
||||
int link_count = 5;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int icon_spacing = flint_px(20);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
int max_columns = link_count;
|
||||
int min_columns = content_w >= flint_px(240) ? 3 : 2;
|
||||
|
||||
for(int columns = max_columns; columns >= min_columns; columns--) {
|
||||
int total_w = icon_btn_w * columns + icon_spacing * (columns - 1);
|
||||
if(total_w <= content_w)
|
||||
return columns;
|
||||
}
|
||||
|
||||
return min_columns;
|
||||
}
|
||||
|
||||
static int
|
||||
about_link_icons_height(int content_w)
|
||||
{
|
||||
int link_count = 5;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int row_spacing = flint_px(16);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
int columns = about_link_icon_columns(content_w);
|
||||
int rows = (link_count + columns - 1) / columns;
|
||||
|
||||
return rows * icon_btn_w + (rows - 1) * row_spacing;
|
||||
}
|
||||
|
||||
int
|
||||
settings_about_content_height(int content_w)
|
||||
{
|
||||
FlintUIParagraph description = {
|
||||
.text = locale_get("about_text"),
|
||||
.width = content_w,
|
||||
.font = flint_ui_font(),
|
||||
.line_gap = flint_px(4),
|
||||
.color = flint_darken(flint_theme_get_text(), 35)
|
||||
};
|
||||
return flint_px(194) + flint_ui_paragraph_height(description) +
|
||||
about_link_icons_height(content_w);
|
||||
}
|
||||
|
||||
static void
|
||||
about_draw_link_icons(InbeApp *app, int content_x, int content_w, int *y)
|
||||
{
|
||||
int link_count = 5;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int icon_spacing = flint_px(20);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
int columns = about_link_icon_columns(content_w);
|
||||
int grid_w = icon_btn_w * columns + icon_spacing * (columns - 1);
|
||||
int links_start_x = content_x + (content_w - grid_w) / 2;
|
||||
int row_spacing = flint_px(16);
|
||||
Texture2D icons[5] = {
|
||||
app->icons[UI_ICON_TYPE_DISCORD],
|
||||
app->icons[UI_ICON_TYPE_TELEGRAM],
|
||||
app->icons[UI_ICON_TYPE_GITHUB],
|
||||
app->icons[UI_ICON_TYPE_BTC],
|
||||
app->icons[UI_ICON_TYPE_MONERO]
|
||||
};
|
||||
const char *urls[5] = {
|
||||
"https://discord.com/invite/JbGZ4yENDt",
|
||||
"https://t.me/lotusinbe",
|
||||
"https://github.com/waozixyz/inbe",
|
||||
"https://trocador.app/en/anonpay/?ticker_to=btc&network_to=Mainnet&address=bc1qxzcetg50f6epgddc09n82xqn3zswlmk44235y5&donation=True&simple_mode=True&amount=0.001&name=Inner+Breeze&[email protected]&ticker_from=btc&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff",
|
||||
"https://trocador.app/en/anonpay/?ticker_to=xmr&network_to=Mainnet&address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&donation=True&simple_mode=True&amount=0.1&name=Inner+Breeze&[email protected]&ticker_from=xmr&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff"
|
||||
};
|
||||
|
||||
for(int i = 0; i < link_count; i++) {
|
||||
int col = i % columns;
|
||||
int row = i / columns;
|
||||
int icon_x = links_start_x + col * (icon_btn_w + icon_spacing) + icon_padding;
|
||||
int icon_y = *y + row * (icon_btn_w + row_spacing);
|
||||
ui_draw_icon_link(icon_x, icon_y, icon_size, icons[i], urls[i]);
|
||||
}
|
||||
*y += about_link_icons_height(content_w);
|
||||
}
|
||||
|
||||
void
|
||||
settings_about_draw(InbeApp *app, int x, int w, int *y)
|
||||
{
|
||||
char version_text[32];
|
||||
int title_font = flint_ui_title_font(locale_get("app_title"), w);
|
||||
int font = flint_ui_font();
|
||||
int small_font = flint_ui_font_small();
|
||||
int logo_size = flint_px(56);
|
||||
int text_w;
|
||||
Color muted = flint_darken(flint_theme_get_text(), 35);
|
||||
FlintUIParagraph description;
|
||||
|
||||
*y += flint_px(16);
|
||||
ui_draw_icon_texture(x + (w - logo_size) / 2, *y, logo_size,
|
||||
app->icons[UI_ICON_TYPE_INBE], WHITE);
|
||||
*y += logo_size + flint_px(12);
|
||||
|
||||
text_w = flint_text_measure(locale_get("app_title"), title_font);
|
||||
flint_text_draw(locale_get("app_title"), x + (w - text_w) / 2, *y, title_font,
|
||||
flint_theme_get_text());
|
||||
*y += flint_px(34);
|
||||
|
||||
snprintf(version_text, sizeof(version_text), "v%s", INBE_VERSION_STRING);
|
||||
text_w = flint_text_measure(version_text, small_font);
|
||||
flint_text_draw(version_text, x + (w - text_w) / 2, *y, small_font, muted);
|
||||
*y += flint_px(28);
|
||||
|
||||
description = (FlintUIParagraph){
|
||||
.text = locale_get("about_text"),
|
||||
.width = w,
|
||||
.font = font,
|
||||
.line_gap = flint_px(4),
|
||||
.color = muted
|
||||
};
|
||||
flint_ui_paragraph_draw(description, x, y);
|
||||
*y += flint_px(18);
|
||||
|
||||
about_draw_link_icons(app, x, w, y);
|
||||
*y += flint_px(32);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef INBE_SETTINGS_ABOUT_H
|
||||
#define INBE_SETTINGS_ABOUT_H
|
||||
|
||||
#include "app_fwd.h"
|
||||
|
||||
int settings_about_content_height(int content_w);
|
||||
void settings_about_draw(InbeApp *app, int x, int w, int *y);
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "storage.h"
|
||||
#include "sync_account.h"
|
||||
#include "flint_theme.h"
|
||||
#include "version.h"
|
||||
#include "flint_theme_meta.h"
|
||||
#include "flint_ui.h"
|
||||
#if !ANDROID_BUILD && !defined(_WIN32) && !defined(PLATFORM_WEB)
|
||||
@@ -34,11 +33,6 @@ enum {
|
||||
SETTINGS_DATA_ACTION_SYNC_KEY_IMPORT
|
||||
};
|
||||
|
||||
enum {
|
||||
SETTINGS_DATA_VIEW_MAIN = 0,
|
||||
SETTINGS_DATA_VIEW_SYNC_ACCOUNT = 1
|
||||
};
|
||||
|
||||
#define INBE_SYNC_SERVER_URL_KEY "sync_server_url"
|
||||
#define INBE_SYNC_SERVER_URL_DEFAULT "https://api.waozi.xyz"
|
||||
#define SETTINGS_DATA_IMPORT_FILTER ".db,.zip"
|
||||
@@ -57,8 +51,9 @@ typedef struct SettingsFileDialogOrigin {
|
||||
int active;
|
||||
int screen;
|
||||
int settings_tab;
|
||||
int settings_data_view;
|
||||
int settings_scroll;
|
||||
int profile_view;
|
||||
int profile_scroll;
|
||||
} SettingsFileDialogOrigin;
|
||||
|
||||
static SettingsFileDialogOrigin file_dialog_origin;
|
||||
@@ -70,6 +65,8 @@ static void settings_export_data(InbeApp *app);
|
||||
static void settings_request_delete_all_data(InbeApp *app);
|
||||
static void settings_sync_server_load(InbeApp *app);
|
||||
static int settings_import_sync_key_path(InbeApp *app, const char *path);
|
||||
static int settings_start_sync_key_export_dialog(InbeApp *app, const char *filename);
|
||||
static int settings_start_sync_key_import_dialog(InbeApp *app);
|
||||
|
||||
static void
|
||||
settings_clear_pending_import(void)
|
||||
@@ -87,8 +84,9 @@ settings_file_dialog_begin(InbeApp *app, int action)
|
||||
file_dialog_origin.active = 1;
|
||||
file_dialog_origin.screen = app->inbe.screen;
|
||||
file_dialog_origin.settings_tab = app->settings_tab;
|
||||
file_dialog_origin.settings_data_view = app->settings_data_view;
|
||||
file_dialog_origin.settings_scroll = app->settings_scroll;
|
||||
file_dialog_origin.profile_view = app->profile_view;
|
||||
file_dialog_origin.profile_scroll = app->profile_scroll;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -98,8 +96,9 @@ settings_file_dialog_finish(InbeApp *app)
|
||||
if(app != NULL && file_dialog_origin.active) {
|
||||
app->inbe.screen = file_dialog_origin.screen;
|
||||
app->settings_tab = file_dialog_origin.settings_tab;
|
||||
app->settings_data_view = file_dialog_origin.settings_data_view;
|
||||
app->settings_scroll = file_dialog_origin.settings_scroll;
|
||||
app->profile_view = file_dialog_origin.profile_view;
|
||||
app->profile_scroll = file_dialog_origin.profile_scroll;
|
||||
}
|
||||
file_dialog_origin.active = 0;
|
||||
data_file_dialog_action = SETTINGS_DATA_ACTION_NONE;
|
||||
@@ -306,60 +305,69 @@ settings_draw_sync_review_modal(InbeApp *app)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
settings_link_icon_columns(int content_w)
|
||||
{
|
||||
int max_columns = 5;
|
||||
int min_columns = 2;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int icon_spacing = flint_px(20);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
|
||||
for(int columns = max_columns; columns > min_columns; columns--) {
|
||||
int total_w = icon_btn_w * columns + icon_spacing * (columns - 1);
|
||||
if(total_w <= content_w)
|
||||
return columns;
|
||||
}
|
||||
|
||||
return min_columns;
|
||||
}
|
||||
|
||||
static int
|
||||
settings_link_icons_height(int content_w)
|
||||
{
|
||||
int link_count = 5;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int row_spacing = flint_px(16);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
int columns = settings_link_icon_columns(content_w);
|
||||
int rows = (link_count + columns - 1) / columns;
|
||||
|
||||
return flint_px(8) + rows * icon_btn_w + (rows - 1) * row_spacing;
|
||||
}
|
||||
|
||||
int
|
||||
settings_data_content_height(int content_w)
|
||||
{
|
||||
int data_button_h = flint_px(36);
|
||||
(void)content_w;
|
||||
|
||||
return flint_px(SETTINGS_DATA_TOP_PADDING) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
flint_px(42) +
|
||||
settings_link_icons_height(content_w) +
|
||||
flint_px(8) + flint_px(22) +
|
||||
flint_px(40);
|
||||
}
|
||||
|
||||
int
|
||||
settings_data_is_configuring(const InbeApp *app)
|
||||
void
|
||||
settings_data_draw_sync_status(int x, int w, int *y)
|
||||
{
|
||||
return app != NULL && app->settings_tab == SETTINGS_TAB_DATA &&
|
||||
app->settings_data_view == SETTINGS_DATA_VIEW_SYNC_ACCOUNT;
|
||||
InbeStorageSyncStatus status;
|
||||
char line[160];
|
||||
int font = flint_ui_font_small();
|
||||
int label_font = flint_ui_font();
|
||||
Color label_color = flint_theme_get_text();
|
||||
Color text_color = flint_darken(flint_theme_get_text(), 25);
|
||||
Color warn_color = (Color){196, 126, 45, 255};
|
||||
Color ok_color = (Color){70, 150, 96, 255};
|
||||
int row_y;
|
||||
int left_w;
|
||||
|
||||
if(!storage_sync_status(&status) || !status.has_account)
|
||||
return;
|
||||
|
||||
flint_text_draw("Sync status", x, *y, label_font, label_color);
|
||||
*y += flint_px(24);
|
||||
|
||||
left_w = w / 2;
|
||||
row_y = *y;
|
||||
snprintf(line, sizeof(line), "Account: %s", status.has_account ? "connected" : "not set");
|
||||
flint_text_draw(line, x, row_y, font, status.has_account ? ok_color : text_color);
|
||||
snprintf(line, sizeof(line), "Queued: %lld", status.queued_changes);
|
||||
flint_text_draw(line, x + left_w, row_y, font,
|
||||
status.queued_changes > 0 ? warn_color : text_color);
|
||||
|
||||
row_y += flint_px(22);
|
||||
snprintf(line, sizeof(line), "Server: %lld", status.server_version);
|
||||
flint_text_draw(line, x, row_y, font, text_color);
|
||||
snprintf(line, sizeof(line), "Clock: %lld", status.server_clock);
|
||||
flint_text_draw(line, x + left_w, row_y, font, text_color);
|
||||
|
||||
row_y += flint_px(22);
|
||||
if(status.review_pending)
|
||||
snprintf(line, sizeof(line), "Review pending");
|
||||
else if(status.repair_pending)
|
||||
snprintf(line, sizeof(line), "Repair sync pending");
|
||||
else if(status.queued_changes > 0)
|
||||
snprintf(line, sizeof(line), "Local changes queued");
|
||||
else if(!status.full_upload_done)
|
||||
snprintf(line, sizeof(line), "Initial upload pending");
|
||||
else
|
||||
snprintf(line, sizeof(line), "Ready");
|
||||
flint_text_draw(line, x, row_y, font,
|
||||
(status.review_pending || status.repair_pending) ? warn_color : text_color);
|
||||
|
||||
*y += flint_px(74);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -377,14 +385,16 @@ settings_sync_server_load(InbeApp *app)
|
||||
app->sync_server_url_cursor = (int)strlen(app->sync_server_url);
|
||||
}
|
||||
|
||||
static void
|
||||
settings_open_sync_account_config(InbeApp *app)
|
||||
void
|
||||
settings_data_open_sync_account_config(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
settings_sync_account_set_save_dialog(settings_start_sync_key_export_dialog);
|
||||
settings_sync_account_set_import_dialog(settings_start_sync_key_import_dialog);
|
||||
settings_sync_server_load(app);
|
||||
app->settings_data_view = SETTINGS_DATA_VIEW_SYNC_ACCOUNT;
|
||||
app->settings_scroll = 0;
|
||||
app->profile_view = PROFILE_VIEW_SYNC_ACCOUNT;
|
||||
app->profile_scroll = 0;
|
||||
app->sync_server_url_focused = 0;
|
||||
settings_screen_clear_status();
|
||||
}
|
||||
@@ -483,64 +493,11 @@ settings_start_sync_key_import_dialog(InbeApp *app)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
settings_draw_link_icons(InbeApp *app, int content_x, int content_w, int *y)
|
||||
{
|
||||
int link_count = 5;
|
||||
int icon_size = flint_px(32);
|
||||
int icon_padding = flint_px(4);
|
||||
int icon_spacing = flint_px(20);
|
||||
int icon_btn_w = icon_size + icon_padding * 2;
|
||||
int columns = settings_link_icon_columns(content_w);
|
||||
int grid_w = icon_btn_w * columns + icon_spacing * (columns - 1);
|
||||
int links_start_x = content_x + (content_w - grid_w) / 2;
|
||||
int row_spacing = flint_px(16);
|
||||
Texture2D icons[5] = {
|
||||
app->icons[UI_ICON_TYPE_DISCORD],
|
||||
app->icons[UI_ICON_TYPE_TELEGRAM],
|
||||
app->icons[UI_ICON_TYPE_GITHUB],
|
||||
app->icons[UI_ICON_TYPE_BTC],
|
||||
app->icons[UI_ICON_TYPE_MONERO]
|
||||
};
|
||||
const char *urls[5] = {
|
||||
"https://discord.com/invite/JbGZ4yENDt",
|
||||
"https://t.me/lotusinbe",
|
||||
"https://github.com/waozixyz/inbe",
|
||||
"https://trocador.app/en/anonpay/?ticker_to=btc&network_to=Mainnet&address=bc1qxzcetg50f6epgddc09n82xqn3zswlmk44235y5&donation=True&simple_mode=True&amount=0.001&name=Inner+Breeze&[email protected]&ticker_from=btc&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff",
|
||||
"https://trocador.app/en/anonpay/?ticker_to=xmr&network_to=Mainnet&address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&donation=True&simple_mode=True&amount=0.1&name=Inner+Breeze&[email protected]&ticker_from=xmr&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff"
|
||||
};
|
||||
|
||||
*y += flint_px(8);
|
||||
for(int i = 0; i < link_count; i++) {
|
||||
int col = i % columns;
|
||||
int row = i / columns;
|
||||
int icon_x = links_start_x + col * (icon_btn_w + icon_spacing) + icon_padding;
|
||||
int icon_y = *y + row * (icon_btn_w + row_spacing);
|
||||
ui_draw_icon_link(icon_x, icon_y, icon_size, icons[i], urls[i]);
|
||||
}
|
||||
*y += settings_link_icons_height(content_w) - flint_px(8);
|
||||
}
|
||||
|
||||
static void
|
||||
settings_draw_version_centered(int x, int w, int *y)
|
||||
{
|
||||
char version_text[32];
|
||||
int font = flint_ui_font_small();
|
||||
int text_w;
|
||||
|
||||
snprintf(version_text, sizeof(version_text), "v%s", INBE_VERSION_STRING);
|
||||
text_w = flint_text_measure(version_text, font);
|
||||
flint_text_draw(version_text, x + (w - text_w) / 2, *y, font,
|
||||
flint_darken(flint_theme_get_text(), 40));
|
||||
*y += flint_px(22);
|
||||
}
|
||||
|
||||
void
|
||||
settings_data_draw(InbeApp *app, int x, int w, int *y)
|
||||
settings_data_draw_actions(InbeApp *app, int x, int w, int *y)
|
||||
{
|
||||
InbeSyncAccount account;
|
||||
int data_button_h = flint_px(36);
|
||||
int hover_account = 0;
|
||||
int hover_import = 0;
|
||||
int hover_export = 0;
|
||||
int hover_delete = 0;
|
||||
@@ -548,18 +505,8 @@ settings_data_draw(InbeApp *app, int x, int w, int *y)
|
||||
|
||||
settings_sync_account_set_save_dialog(settings_start_sync_key_export_dialog);
|
||||
settings_sync_account_set_import_dialog(settings_start_sync_key_import_dialog);
|
||||
if(app != NULL && app->settings_data_view == SETTINGS_DATA_VIEW_SYNC_ACCOUNT) {
|
||||
settings_sync_account_draw_config(app, x, w, y);
|
||||
return;
|
||||
}
|
||||
|
||||
*y += flint_px(SETTINGS_DATA_TOP_PADDING);
|
||||
if(ui_draw_generic_button(x, *y, w, data_button_h,
|
||||
locale_get("sync_configure_account_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover_account))
|
||||
settings_open_sync_account_config(app);
|
||||
*y += data_button_h + flint_px(12);
|
||||
|
||||
if(ui_draw_generic_button(x, *y, w, data_button_h,
|
||||
locale_get("import_data_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover_import))
|
||||
@@ -580,9 +527,6 @@ settings_data_draw(InbeApp *app, int x, int w, int *y)
|
||||
*y += data_button_h + flint_px(12);
|
||||
}
|
||||
settings_screen_draw_status_reserved(x, y, flint_px(42));
|
||||
settings_draw_link_icons(app, x, w, y);
|
||||
*y += flint_px(8);
|
||||
settings_draw_version_centered(x, w, y);
|
||||
}
|
||||
|
||||
#if ANDROID_BUILD
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include "app_fwd.h"
|
||||
|
||||
int settings_data_content_height(int content_w);
|
||||
int settings_data_is_configuring(const InbeApp *app);
|
||||
void settings_data_draw(InbeApp *app, int x, int w, int *y);
|
||||
void settings_data_draw_actions(InbeApp *app, int x, int w, int *y);
|
||||
void settings_data_draw_sync_status(int x, int w, int *y);
|
||||
void settings_data_open_sync_account_config(InbeApp *app);
|
||||
int settings_data_draw_pending_file_dialog(InbeApp *app);
|
||||
int settings_data_draw_modals(InbeApp *app);
|
||||
void settings_data_handle_android_import(InbeApp *app);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "app.h"
|
||||
#include "app_settings.h"
|
||||
#include "flint_locale.h"
|
||||
#include "settings_about.h"
|
||||
#include "settings_data.h"
|
||||
#include "settings_device.h"
|
||||
#include "settings_session.h"
|
||||
@@ -127,9 +128,8 @@ settings_tab_content_height(InbeApp *app, int tab, int content_w)
|
||||
return settings_session_content_height(content_w);
|
||||
if(tab == SETTINGS_TAB_DEVICE)
|
||||
return settings_device_content_height(content_w);
|
||||
if(settings_data_is_configuring(app))
|
||||
return flint_px(430);
|
||||
return settings_data_content_height(content_w);
|
||||
(void)app;
|
||||
return settings_about_content_height(content_w);
|
||||
}
|
||||
|
||||
typedef struct SettingsScrollPageContext {
|
||||
@@ -162,7 +162,7 @@ settings_screen_draw(InbeApp *app)
|
||||
locale_get("settings_section_session"),
|
||||
locale_get("settings_tab_device"),
|
||||
locale_get("settings_section_appearance"),
|
||||
locale_get("settings_tab_data"),
|
||||
locale_get("settings_tab_about"),
|
||||
};
|
||||
SettingsDeviceState device_state = {0};
|
||||
|
||||
@@ -176,19 +176,7 @@ settings_screen_draw(InbeApp *app)
|
||||
if(settings_data_draw_pending_file_dialog(app))
|
||||
return 1;
|
||||
|
||||
detail_header_h = settings_data_is_configuring(app) ? flint_px(58) : 0;
|
||||
if(detail_header_h > 0) {
|
||||
FlintUIHeader header = ui_draw_title_header(detail_header_h,
|
||||
locale_get("sync_configure_account_button"),
|
||||
app->icons[UI_ICON_TYPE_RETURN],
|
||||
(Texture2D){0});
|
||||
if(header.left_clicked) {
|
||||
app->settings_data_view = 0;
|
||||
app->settings_scroll = 0;
|
||||
app->sync_server_url_focused = 0;
|
||||
settings_screen_clear_status();
|
||||
}
|
||||
}
|
||||
detail_header_h = 0;
|
||||
|
||||
selector_h = detail_header_h > 0 ? 0 : ui_tab_bar_height();
|
||||
tab_content_start_y = detail_header_h + selector_h;
|
||||
@@ -233,7 +221,6 @@ settings_screen_draw(InbeApp *app)
|
||||
if(selected_tab != app->settings_tab) {
|
||||
app->settings_tab = selected_tab;
|
||||
app->settings_scroll = 0;
|
||||
app->settings_data_view = 0;
|
||||
if(app->modal.type == UIModalThemePicker) {
|
||||
app_close_modal(app);
|
||||
}
|
||||
@@ -260,7 +247,7 @@ settings_screen_draw(InbeApp *app)
|
||||
else if(app->settings_tab == SETTINGS_TAB_DEVICE)
|
||||
settings_device_draw(app, page.content_x, page.content_w, &y, &device_state);
|
||||
else
|
||||
settings_data_draw(app, page.content_x, page.content_w, &y);
|
||||
settings_about_draw(app, page.content_x, page.content_w, &y);
|
||||
|
||||
ui_scroll_page_end(page);
|
||||
}
|
||||
@@ -270,7 +257,6 @@ settings_screen_draw(InbeApp *app)
|
||||
if(ui_draw_dropdown_menu(302) && selected_tab != app->settings_tab) {
|
||||
app->settings_tab = selected_tab;
|
||||
app->settings_scroll = 0;
|
||||
app->settings_data_view = 0;
|
||||
if(app->modal.type == UIModalThemePicker) {
|
||||
app_close_modal(app);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ settings_backup_filename(char *out, size_t out_size)
|
||||
{
|
||||
if(out == NULL || out_size == 0)
|
||||
return;
|
||||
snprintf(out, out_size, "inbe-sync.key");
|
||||
snprintf(out, out_size, "account.key");
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -279,6 +279,9 @@ settings_sync_run_connect(InbeApp *app)
|
||||
if(storage_sync_review_clear_if_no_visible_diff()) {
|
||||
app_reload_after_import(app, 0);
|
||||
settings_screen_set_status_success(locale_get(settings_sync_result_key(result)), NULL);
|
||||
} else if(storage_sync_review_apply_remote_if_local_empty()) {
|
||||
app_reload_after_import(app, 0);
|
||||
settings_screen_set_status_success(locale_get(settings_sync_result_key(result)), NULL);
|
||||
} else if(storage_sync_review_pending()) {
|
||||
app_open_modal(app, UIModalSyncReview);
|
||||
settings_screen_set_status_error("Sync needs review");
|
||||
@@ -354,13 +357,6 @@ settings_sync_account_draw(InbeApp *app, int x, int w, int *y)
|
||||
flint_text_draw(locale_get("sync_account_title"), x, *y, font, flint_theme_get_text());
|
||||
*y += flint_px(26);
|
||||
|
||||
if(!sync_account_available()) {
|
||||
flint_text_draw(locale_get("sync_liboqs_unavailable"), x, *y, small_font,
|
||||
flint_darken(flint_theme_get_text(), 35));
|
||||
*y += flint_px(32);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!has_account) {
|
||||
if(ui_draw_generic_button(x, *y, w, btn_h, locale_get("sync_create_account_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover)) {
|
||||
@@ -423,13 +419,6 @@ settings_sync_account_draw_config(InbeApp *app, int x, int w, int *y)
|
||||
int commit = 0;
|
||||
FlintUITextInputStyle input_style = settings_sync_text_style();
|
||||
|
||||
if(!sync_account_available()) {
|
||||
flint_text_draw(locale_get("sync_liboqs_unavailable"), x, *y, small_font,
|
||||
flint_darken(flint_theme_get_text(), 35));
|
||||
*y += flint_px(32);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!has_account) {
|
||||
FlintUIButtonRowItem buttons[2] = {
|
||||
{locale_get("sync_create_account_button"), UI_BUTTON_STYLE_PRIMARY, 0},
|
||||
@@ -711,7 +700,6 @@ settings_sync_account_draw_public_id_modal(InbeApp *app)
|
||||
int btn_h = flint_px(36);
|
||||
int gap = flint_px(10);
|
||||
int y;
|
||||
int hover = 0;
|
||||
int result = 0;
|
||||
|
||||
(void)app;
|
||||
@@ -719,7 +707,7 @@ settings_sync_account_draw_public_id_modal(InbeApp *app)
|
||||
if(!sync_account_load(&account))
|
||||
return 1;
|
||||
|
||||
frame = ui_draw_modal_frame(flint_px(356), flint_px(274),
|
||||
frame = ui_draw_modal_frame(flint_px(356), flint_px(218),
|
||||
locale_get("sync_public_id_full_title"),
|
||||
(Texture2D){0}, (Texture2D){0});
|
||||
y = frame.content_y;
|
||||
@@ -754,12 +742,5 @@ settings_sync_account_draw_public_id_modal(InbeApp *app)
|
||||
}
|
||||
}
|
||||
|
||||
if(ui_draw_generic_button(frame.content_x, frame.y + frame.h - btn_h - flint_px(18),
|
||||
frame.content_w, btn_h,
|
||||
locale_get("sync_alias_button"), UI_BUTTON_STYLE_SECONDARY,
|
||||
0, &hover)) {
|
||||
app_close_modal(app);
|
||||
settings_sync_open_alias_modal(app, 0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -80,7 +80,8 @@ settings_theme_draw(InbeApp *app, int x, int w, int *y, SettingsThemeState *stat
|
||||
(float)(circle_size * 2),
|
||||
(float)(circle_size * 2)
|
||||
};
|
||||
int is_hovered = CheckCollisionPointRec(GetMousePosition(), circle_bounds);
|
||||
Vector2 mouse_world = GetScreenToWorld2D(GetMousePosition(), app->camera);
|
||||
int is_hovered = CheckCollisionPointRec(mouse_world, circle_bounds);
|
||||
|
||||
// Draw circle with hover effect
|
||||
int draw_size = is_hovered ? circle_size + flint_px(4) : circle_size;
|
||||
@@ -90,7 +91,7 @@ settings_theme_draw(InbeApp *app, int x, int w, int *y, SettingsThemeState *stat
|
||||
|
||||
// Check for click to open modal (skip if modal is active or just closed)
|
||||
if(is_hovered && !app->modal.active &&
|
||||
!ui_input_captures_click(GetMousePosition()) &&
|
||||
!ui_input_captures_click(mouse_world) &&
|
||||
app->inbe.frame - app->modal_open_frame > 1) {
|
||||
ui_mark_clickable();
|
||||
if(IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) {
|
||||
@@ -143,6 +144,10 @@ settings_screen_draw_theme_picker_modal(InbeApp *app)
|
||||
int modal_h = flint_px(360);
|
||||
const char *title = locale_get("theme_picker_title");
|
||||
FlintUIPanelFrame frame;
|
||||
FlintUIScrollArea scroll_area;
|
||||
FlintUIScrollView scroll_view;
|
||||
int picker_h;
|
||||
int draw_w;
|
||||
|
||||
frame = ui_draw_modal_frame(modal_w, modal_h, title,
|
||||
(Texture2D){0},
|
||||
@@ -153,13 +158,40 @@ settings_screen_draw_theme_picker_modal(InbeApp *app)
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw theme picker in modal content area
|
||||
if(ui_draw_theme_picker(frame.content_x, frame.content_y,
|
||||
frame.content_w, app->dark_mode, &app->theme_id)) {
|
||||
draw_w = frame.content_w;
|
||||
picker_h = ui_theme_picker_height(draw_w);
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {
|
||||
(float)frame.content_x,
|
||||
(float)frame.content_y,
|
||||
(float)frame.content_w,
|
||||
(float)frame.content_h
|
||||
},
|
||||
.content_height = picker_h,
|
||||
.content_x = frame.content_x,
|
||||
.content_width = frame.content_w,
|
||||
.scroll_offset = &app->theme_state.theme_picker_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = frame.content_x + frame.content_w - flint_px(8)
|
||||
};
|
||||
for(int i = 0; i < 3; i++) {
|
||||
FlintUIScrollView measured = ui_scroll_container_measure(scroll_area);
|
||||
if(measured.content_w == draw_w)
|
||||
break;
|
||||
draw_w = measured.content_w;
|
||||
scroll_area.content_height = ui_theme_picker_height(draw_w);
|
||||
}
|
||||
picker_h = ui_theme_picker_height(draw_w);
|
||||
scroll_area.content_height = picker_h;
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
|
||||
if(ui_draw_theme_picker(scroll_view.content_x, scroll_view.content_y,
|
||||
scroll_view.content_w, app->dark_mode, &app->theme_id)) {
|
||||
app->theme_id = clampi(app->theme_id, 0, FLINT_THEME_COUNT - 1);
|
||||
app_refresh_theme(app);
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
app_close_modal(app);
|
||||
}
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ typedef struct SettingsThemeState {
|
||||
int draw_nav_mode_menu;
|
||||
int draw_transition_menu;
|
||||
int theme_picker_modal_open;
|
||||
int theme_picker_scroll;
|
||||
} SettingsThemeState;
|
||||
|
||||
int settings_theme_content_height(int content_w);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "habits/habits.h"
|
||||
#include "flint_locale.h"
|
||||
#include "flint_theme.h"
|
||||
#include "flint_ui.h"
|
||||
|
||||
extern int view_width;
|
||||
extern int view_height;
|
||||
@@ -11,7 +12,7 @@ extern int view_height;
|
||||
static int
|
||||
statistics_content_height(int linked_count)
|
||||
{
|
||||
return flint_px(linked_count > 0 ? 660 : 420);
|
||||
return flint_px(linked_count > 0 ? 710 : 420);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -62,10 +63,30 @@ statistics_draw_metric(int x, int y, int w, int h, const char *label,
|
||||
value_font, flint_theme_get_text());
|
||||
}
|
||||
|
||||
static void
|
||||
statistics_draw_section_title(const char *title, int x, int y)
|
||||
static int
|
||||
statistics_draw_section_title(const char *title, int x, int y, int w)
|
||||
{
|
||||
flint_text_draw(title, x, y, FLINT_TEXT_16, flint_theme_get_text());
|
||||
FlintUIParagraph paragraph = {
|
||||
.text = title,
|
||||
.width = w,
|
||||
.font = FLINT_TEXT_16,
|
||||
.line_gap = flint_px(3),
|
||||
.color = flint_theme_get_text()
|
||||
};
|
||||
int title_y = y;
|
||||
int height = flint_ui_paragraph_height(paragraph);
|
||||
|
||||
flint_ui_paragraph_draw(paragraph, x, &title_y);
|
||||
return height;
|
||||
}
|
||||
|
||||
static void
|
||||
statistics_format_day_count(char *out, size_t out_size, int count)
|
||||
{
|
||||
locale_format(out, out_size,
|
||||
count == 1 ? "habit_stats_day_singular"
|
||||
: "habit_stats_day_plural",
|
||||
count);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -111,17 +132,68 @@ statistics_day_offset_from_today(int day_index, const struct tm *today_tm)
|
||||
today_time = mktime(&today_copy);
|
||||
day_time = mktime(&day_tm);
|
||||
diff_days = difftime(today_time, day_time) / 86400.0;
|
||||
if(diff_days < -0.5 || diff_days > 6.5)
|
||||
if(diff_days < -0.5 || diff_days > 30.5)
|
||||
return -1;
|
||||
return (int)(diff_days + 0.5);
|
||||
}
|
||||
|
||||
static int
|
||||
statistics_draw_hold_range_selector(InbeApp *app, int x, int y, int w)
|
||||
{
|
||||
const char *labels[2] = {"1W", "1M"};
|
||||
const int values[2] = {7, 31};
|
||||
int selected = app->habits.hold_stats_range_days == 31 ? 1 : 0;
|
||||
int h = flint_px(34);
|
||||
int segment_w = w / 2;
|
||||
int clicked = 0;
|
||||
Vector2 mouse_world = GetScreenToWorld2D(GetMousePosition(), app->camera);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
int segment_x = x + i * segment_w;
|
||||
int current_w = i == 1 ? x + w - segment_x : segment_w;
|
||||
Rectangle rect = {segment_x, y, current_w, h};
|
||||
int active_hit = CheckCollisionPointRec(mouse_world, rect) &&
|
||||
!ui_input_captures_click(mouse_world);
|
||||
int hovered = active_hit && ui_hover_effects_enabled();
|
||||
int active = i == selected;
|
||||
Color fill = active ? flint_theme_get_button() : flint_darken(flint_theme_get_bg(), 10);
|
||||
Color top = flint_lighten(fill, 35);
|
||||
Color bottom = flint_darken(fill, 45);
|
||||
int font = flint_ui_font();
|
||||
int text_w;
|
||||
|
||||
if(active_hit) {
|
||||
app->cursor_clickable = 1;
|
||||
if(hovered && !active) {
|
||||
fill = flint_theme_get_button_hover();
|
||||
top = flint_darken(flint_theme_get_button_hover(), 40);
|
||||
bottom = flint_lighten(flint_theme_get_button_hover(), 40);
|
||||
}
|
||||
}
|
||||
|
||||
DrawRectangle(segment_x, y, current_w, h, fill);
|
||||
ui_draw_bevel(segment_x, y, current_w, h, top, bottom);
|
||||
text_w = flint_text_measure(labels[i], font);
|
||||
flint_text_draw(labels[i], segment_x + (current_w - text_w) / 2,
|
||||
flint_ui_text_y(labels[i], y, h, font), font,
|
||||
flint_theme_get_text());
|
||||
|
||||
if(active_hit && IsMouseButtonReleased(MOUSE_BUTTON_LEFT) &&
|
||||
!ui_input_captures_click(mouse_world) && selected != i) {
|
||||
app->habits.hold_stats_range_days = values[i];
|
||||
clicked = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return clicked;
|
||||
}
|
||||
|
||||
static void
|
||||
statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
int content_x, int y, int content_w,
|
||||
const struct tm *today_tm, int filter, Color accent)
|
||||
{
|
||||
enum { GRAPH_DAYS = 7, MAX_POINTS = 256 };
|
||||
enum { MAX_GRAPH_DAYS = 31, MAX_POINTS = 256 };
|
||||
typedef struct {
|
||||
int time_key;
|
||||
int round_index;
|
||||
@@ -132,8 +204,9 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
} GraphPoint;
|
||||
GraphPoint points[MAX_POINTS];
|
||||
int point_count = 0;
|
||||
int day_points[GRAPH_DAYS] = {0};
|
||||
int day_totals[GRAPH_DAYS] = {0};
|
||||
int graph_days = app->habits.hold_stats_range_days == 31 ? 31 : 7;
|
||||
int day_points[MAX_GRAPH_DAYS] = {0};
|
||||
int day_totals[MAX_GRAPH_DAYS] = {0};
|
||||
int max_hold = 1;
|
||||
int graph_h = flint_px(170);
|
||||
int axis_w = flint_px(48);
|
||||
@@ -141,7 +214,6 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
int plot_y = y + flint_px(8);
|
||||
int plot_w = content_w - axis_w - flint_px(10);
|
||||
int plot_h = graph_h - flint_px(36);
|
||||
const char *labels[GRAPH_DAYS] = {"6d", "5d", "4d", "3d", "2d", "1d", "Now"};
|
||||
char axis_label[32];
|
||||
|
||||
DrawRectangle(content_x, y, content_w, graph_h, flint_darken(flint_theme_get_bg(), 7));
|
||||
@@ -154,10 +226,10 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
continue;
|
||||
day_index = entry->year * 10000 + entry->month * 100 + entry->day;
|
||||
day_offset = statistics_day_offset_from_today(day_index, today_tm);
|
||||
if(day_offset < 0 || day_offset >= GRAPH_DAYS)
|
||||
if(day_offset < 0 || day_offset >= graph_days)
|
||||
continue;
|
||||
for(int r = 0; r < entry->round_count && point_count < MAX_POINTS; r++) {
|
||||
int day_slot = GRAPH_DAYS - 1 - day_offset;
|
||||
int day_slot = graph_days - 1 - day_offset;
|
||||
if(entry->rounds[r] > max_hold)
|
||||
max_hold = entry->rounds[r];
|
||||
day_points[day_slot]++;
|
||||
@@ -186,9 +258,11 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
points[j + 1] = point;
|
||||
}
|
||||
|
||||
for(int i = 1; i < GRAPH_DAYS; i++) {
|
||||
int x = plot_x + (plot_w * i) / GRAPH_DAYS;
|
||||
DrawLine(x, plot_y, x, plot_y + plot_h, flint_darken(flint_theme_get_bg(), 22));
|
||||
for(int i = 1; i < graph_days; i++) {
|
||||
if(graph_days == 7 || i % 5 == 0) {
|
||||
int x = plot_x + (plot_w * i) / graph_days;
|
||||
DrawLine(x, plot_y, x, plot_y + plot_h, flint_darken(flint_theme_get_bg(), 22));
|
||||
}
|
||||
}
|
||||
for(int i = 0; i <= 2; i++) {
|
||||
int line_y = plot_y + (plot_h * i) / 2;
|
||||
@@ -204,11 +278,11 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
flint_darken(flint_theme_get_text(), 42));
|
||||
|
||||
{
|
||||
int day_seen[GRAPH_DAYS] = {0};
|
||||
int day_first_x[GRAPH_DAYS];
|
||||
int day_last_x[GRAPH_DAYS];
|
||||
int day_seen[MAX_GRAPH_DAYS] = {0};
|
||||
int day_first_x[MAX_GRAPH_DAYS];
|
||||
int day_last_x[MAX_GRAPH_DAYS];
|
||||
|
||||
for(int i = 0; i < GRAPH_DAYS; i++) {
|
||||
for(int i = 0; i < graph_days; i++) {
|
||||
day_first_x[i] = -1;
|
||||
day_last_x[i] = -1;
|
||||
}
|
||||
@@ -216,8 +290,8 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
int day_slot = points[i].day_slot;
|
||||
int count = day_points[day_slot] > 0 ? day_points[day_slot] : 1;
|
||||
int ordinal = day_seen[day_slot]++;
|
||||
int x0 = plot_x + (plot_w * day_slot) / GRAPH_DAYS;
|
||||
int x1 = plot_x + (plot_w * (day_slot + 1)) / GRAPH_DAYS;
|
||||
int x0 = plot_x + (plot_w * day_slot) / graph_days;
|
||||
int x1 = plot_x + (plot_w * (day_slot + 1)) / graph_days;
|
||||
points[i].x = x0 + ((ordinal + 1) * (x1 - x0)) / (count + 1);
|
||||
points[i].y = plot_y + plot_h -
|
||||
(points[i].hold_seconds * (plot_h - flint_px(10))) / max_hold;
|
||||
@@ -232,7 +306,7 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
int prev_y = 0;
|
||||
int has_prev = 0;
|
||||
|
||||
for(int i = 0; i < GRAPH_DAYS; i++) {
|
||||
for(int i = 0; i < graph_days; i++) {
|
||||
int avg_seconds;
|
||||
int avg_y;
|
||||
|
||||
@@ -253,20 +327,30 @@ statistics_draw_hold_graph(InbeApp *app, const HabitLinkedContext *linked_ctx,
|
||||
for(int i = 0; i < point_count; i++)
|
||||
DrawCircle(points[i].x, points[i].y, flint_px(3), accent);
|
||||
if(point_count <= 0) {
|
||||
const char *empty = locale_get("habit_stats_no_rounds_week");
|
||||
const char *empty = locale_get(graph_days == 31 ? "habit_stats_no_rounds_month"
|
||||
: "habit_stats_no_rounds_week");
|
||||
int text_w = flint_text_measure(empty, FLINT_TEXT_12);
|
||||
flint_text_draw(empty, content_x + (content_w - text_w) / 2,
|
||||
y + graph_h / 2 - flint_px(8), FLINT_TEXT_12,
|
||||
flint_darken(flint_theme_get_text(), 24));
|
||||
}
|
||||
for(int i = 0; i < GRAPH_DAYS; i++) {
|
||||
int day_x = plot_x + (plot_w * i) / GRAPH_DAYS;
|
||||
flint_text_draw(labels[i], day_x + flint_px(2),
|
||||
for(int i = 0; i < graph_days; i++) {
|
||||
int day_offset = graph_days - 1 - i;
|
||||
int show_label = graph_days == 7 || day_offset == 0 || day_offset % 5 == 0;
|
||||
char label[8];
|
||||
int day_x;
|
||||
|
||||
if(!show_label)
|
||||
continue;
|
||||
if(day_offset == 0)
|
||||
snprintf(label, sizeof(label), "%s", "Now");
|
||||
else
|
||||
snprintf(label, sizeof(label), "%dd", day_offset);
|
||||
day_x = plot_x + (plot_w * i) / graph_days;
|
||||
flint_text_draw(label, day_x + flint_px(2),
|
||||
y + graph_h - flint_px(20), FLINT_TEXT_12,
|
||||
flint_darken(flint_theme_get_text(), 24));
|
||||
}
|
||||
|
||||
(void)app;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -330,8 +414,7 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
|
||||
}
|
||||
|
||||
metric_w = (content_w - metrics_gap) / 2;
|
||||
snprintf(value, sizeof(value), "%d day%s", current_streak,
|
||||
current_streak == 1 ? "" : "s");
|
||||
statistics_format_day_count(value, sizeof(value), current_streak);
|
||||
statistics_draw_metric(content_x, y, metric_w, metric_h,
|
||||
locale_get("habit_stats_current_streak"), value, active->color);
|
||||
snprintf(value, sizeof(value), "%d/%d", last_30_done, last_30_total);
|
||||
@@ -341,16 +424,18 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
|
||||
y += metric_h + flint_px(22);
|
||||
|
||||
if(has_wim_hof_rounds) {
|
||||
statistics_draw_section_title(locale_get("habit_stats_wim_hof_hold_rounds"), content_x, y);
|
||||
y += flint_px(28);
|
||||
y += statistics_draw_section_title(locale_get("habit_stats_wim_hof_hold_rounds"),
|
||||
content_x, y, content_w) + flint_px(10);
|
||||
statistics_draw_hold_range_selector(app, content_x, y, flint_px(118));
|
||||
y += flint_px(42);
|
||||
statistics_draw_hold_graph(app, linked_ctx, content_x, y, content_w,
|
||||
&today_tm, EXERCISE_WIM_HOF,
|
||||
active->color);
|
||||
y += flint_px(194);
|
||||
}
|
||||
|
||||
statistics_draw_section_title(locale_get("habit_stats_weekday_pattern"), content_x, y);
|
||||
y += flint_px(28);
|
||||
y += statistics_draw_section_title(locale_get("habit_stats_weekday_pattern"),
|
||||
content_x, y, content_w) + flint_px(10);
|
||||
DrawRectangle(content_x, y, content_w, chart_h, flint_darken(flint_theme_get_bg(), 7));
|
||||
{
|
||||
const char *labels[7] = {"S", "M", "T", "W", "T", "F", "S"};
|
||||
@@ -378,8 +463,8 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
|
||||
if(linked_ctx != NULL && linked_ctx->count > 0) {
|
||||
char best[32];
|
||||
char total[32];
|
||||
statistics_draw_section_title(locale_get("habit_stats_practice_time"), content_x, y);
|
||||
y += flint_px(28);
|
||||
y += statistics_draw_section_title(locale_get("habit_stats_practice_time"),
|
||||
content_x, y, content_w) + flint_px(10);
|
||||
habit_format_duration(linked_ctx->best_seconds, best, sizeof(best));
|
||||
habit_format_duration(linked_ctx->total_seconds, total, sizeof(total));
|
||||
statistics_draw_metric(content_x, y, metric_w, metric_h,
|
||||
@@ -388,8 +473,7 @@ statistics_draw_view(InbeApp *app, InbeHabit *active,
|
||||
content_w - metric_w - metrics_gap, metric_h,
|
||||
locale_get("habit_stats_total_hold"), total, flint_lighten(active->color, 20));
|
||||
} else {
|
||||
snprintf(value, sizeof(value), "%d day%s", best_streak,
|
||||
best_streak == 1 ? "" : "s");
|
||||
statistics_format_day_count(value, sizeof(value), best_streak);
|
||||
statistics_draw_metric(content_x, y, content_w, metric_h,
|
||||
locale_get("habit_stats_best_streak"), value, active->color);
|
||||
}
|
||||
|
||||
@@ -186,6 +186,13 @@ schema_create(void)
|
||||
" updated_at INTEGER NOT NULL,"
|
||||
" PRIMARY KEY(user_id,key)"
|
||||
");"
|
||||
"CREATE TABLE IF NOT EXISTS social_cache("
|
||||
" user_id TEXT NOT NULL,"
|
||||
" kind TEXT NOT NULL,"
|
||||
" json TEXT NOT NULL,"
|
||||
" updated_at INTEGER NOT NULL,"
|
||||
" PRIMARY KEY(user_id,kind)"
|
||||
");"
|
||||
"CREATE TABLE IF NOT EXISTS sessions("
|
||||
" id TEXT PRIMARY KEY,"
|
||||
" user_id TEXT NOT NULL,"
|
||||
@@ -443,6 +450,13 @@ migrate_schema(void)
|
||||
" created_at INTEGER NOT NULL,"
|
||||
" sent_at INTEGER NOT NULL DEFAULT 0,"
|
||||
" acked_at INTEGER NOT NULL DEFAULT 0"
|
||||
");"
|
||||
"CREATE TABLE IF NOT EXISTS social_cache("
|
||||
" user_id TEXT NOT NULL,"
|
||||
" kind TEXT NOT NULL,"
|
||||
" json TEXT NOT NULL,"
|
||||
" updated_at INTEGER NOT NULL,"
|
||||
" PRIMARY KEY(user_id,kind)"
|
||||
");"))
|
||||
return 0;
|
||||
if(!had_outbox) {
|
||||
|
||||
@@ -94,6 +94,9 @@ static const char *const importable_setting_keys[] = {
|
||||
"advanced_session_controls",
|
||||
"hold_display_mode",
|
||||
"exercise_type",
|
||||
"meditation_duration_mode",
|
||||
"meditation_custom_minutes",
|
||||
"meditation_show_extend_controls",
|
||||
"meditation_music_enabled",
|
||||
"meditation_music_shuffle",
|
||||
"meditation_music_track",
|
||||
|
||||
@@ -30,6 +30,8 @@ static int
|
||||
storage_json_array_count(const char *json, const char *path);
|
||||
static int
|
||||
storage_clear_local_sync_data(void);
|
||||
static int
|
||||
storage_json_valid(const char *json);
|
||||
|
||||
#define STORAGE_SYNC_BACKFILL_KEY "sync_backfill_v2_done"
|
||||
#define STORAGE_SYNC_HABIT_NAME_REPAIR_KEY "sync_habit_name_repair_v1_done"
|
||||
@@ -42,6 +44,7 @@ storage_clear_local_sync_data(void);
|
||||
#define STORAGE_SYNC_APPLY_REVIEW_KEY "sync_apply_pending_review"
|
||||
#define STORAGE_SYNC_FULL_REPLACE_KEY "sync_full_replace_requested"
|
||||
#define STORAGE_SYNC_ACCOUNT_ALIAS_KEY "sync_account_alias"
|
||||
#define STORAGE_SYNC_ZERO_HABIT_DAY_REPAIR_KEY "sync_zero_habit_day_repair_v1_done"
|
||||
|
||||
static long long
|
||||
storage_next_change_time(void)
|
||||
@@ -57,6 +60,7 @@ storage_next_change_time(void)
|
||||
" SELECT COALESCE(MAX(updated_at),0) AS updated_at FROM habits"
|
||||
" UNION ALL SELECT COALESCE(MAX(updated_at),0) FROM habit_days"
|
||||
" UNION ALL SELECT COALESCE(MAX(updated_at),0) FROM sessions"
|
||||
" UNION ALL SELECT COALESCE(MAX(updated_at),0) FROM social_cache"
|
||||
")",
|
||||
-1, &stmt, NULL) == SQLITE_OK) {
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
@@ -411,6 +415,76 @@ storage_settings_empty(void)
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
int
|
||||
storage_get_social_cache_json(const char *kind, char *out, size_t out_size)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int found = 0;
|
||||
|
||||
if(out == NULL || out_size == 0)
|
||||
return 0;
|
||||
out[0] = '\0';
|
||||
if(g_storage.db == NULL || kind == NULL || kind[0] == '\0')
|
||||
return 0;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT json FROM social_cache WHERE user_id=?1 AND kind=?2",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 0;
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
bind_text(stmt, 2, kind);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
const char *json = (const char *)sqlite3_column_text(stmt, 0);
|
||||
snprintf(out, out_size, "%s", json != NULL ? json : "");
|
||||
found = out[0] != '\0';
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
return found;
|
||||
}
|
||||
|
||||
int
|
||||
storage_set_social_cache_json(const char *kind, const char *json)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
long long updated_at;
|
||||
int rc;
|
||||
int same = 0;
|
||||
|
||||
if(g_storage.db == NULL || kind == NULL || kind[0] == '\0' ||
|
||||
json == NULL || json[0] == '\0' || !storage_json_valid(json))
|
||||
return 0;
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT json=?3 FROM social_cache WHERE user_id=?1 AND kind=?2",
|
||||
-1, &stmt, NULL) == SQLITE_OK) {
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
bind_text(stmt, 2, kind);
|
||||
bind_text(stmt, 3, json);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
same = sqlite3_column_int(stmt, 0) != 0;
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
stmt = NULL;
|
||||
if(same)
|
||||
return 1;
|
||||
updated_at = storage_next_change_time();
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"INSERT INTO social_cache(user_id,kind,json,updated_at) "
|
||||
"VALUES(?1,?2,?3,?4) "
|
||||
"ON CONFLICT(user_id,kind) DO UPDATE SET "
|
||||
"json=excluded.json,updated_at=excluded.updated_at",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 0;
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
bind_text(stmt, 2, kind);
|
||||
bind_text(stmt, 3, json);
|
||||
sqlite3_bind_int64(stmt, 4, updated_at);
|
||||
rc = sqlite3_step(stmt);
|
||||
sqlite3_finalize(stmt);
|
||||
if(rc != SQLITE_DONE)
|
||||
return 0;
|
||||
storage_schedule_persist();
|
||||
return 2;
|
||||
}
|
||||
|
||||
int
|
||||
storage_get_setting_int(const char *key, int fallback)
|
||||
{
|
||||
@@ -1403,9 +1477,7 @@ storage_sync_op_is_delete(const char *entity_type, const char *entity_id, int lo
|
||||
return 0;
|
||||
bind_text(stmt, 1, entity_id);
|
||||
sqlite3_bind_int(stmt, 2, local_date);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
deleted = sqlite3_column_int(stmt, 0) == 0 && sqlite3_column_int(stmt, 1) == 0;
|
||||
else
|
||||
if(sqlite3_step(stmt) != SQLITE_ROW)
|
||||
deleted = 1;
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
@@ -1490,6 +1562,7 @@ storage_build_sync_payload_json(const char *user_id_hash, const char *public_key
|
||||
long long since_server_version;
|
||||
long long through_seq;
|
||||
int full_upload_done;
|
||||
int force_zero_day_repair;
|
||||
|
||||
if(g_storage.db == NULL || user_id_hash == NULL || user_id_hash[0] == '\0')
|
||||
return NULL;
|
||||
@@ -1503,6 +1576,9 @@ storage_build_sync_payload_json(const char *user_id_hash, const char *public_key
|
||||
full_upload_done = get_meta_int64("sync_full_upload_done", 0) != 0;
|
||||
if(!get_meta_int64(STORAGE_SYNC_HABIT_NAME_REPAIR_KEY, 0) || storage_has_orphan_habit_days())
|
||||
since_server_version = 0;
|
||||
force_zero_day_repair = get_meta_int64(STORAGE_SYNC_ZERO_HABIT_DAY_REPAIR_KEY, 0) == 0;
|
||||
if(force_zero_day_repair)
|
||||
since_server_version = 0;
|
||||
through_seq = storage_max_sync_outbox_seq();
|
||||
g_storage.pending_sync_outbox_seq = through_seq;
|
||||
json.ok = 1;
|
||||
@@ -1517,7 +1593,7 @@ storage_build_sync_payload_json(const char *user_id_hash, const char *public_key
|
||||
json_append(&json, ",\"full_sync_requested\":true");
|
||||
{
|
||||
const char *last_server_hash = get_meta_text(STORAGE_SYNC_LAST_SERVER_HASH_KEY);
|
||||
if(last_server_hash != NULL && last_server_hash[0] != '\0') {
|
||||
if(!force_zero_day_repair && last_server_hash != NULL && last_server_hash[0] != '\0') {
|
||||
json_append(&json, ",");
|
||||
json_append_key_string(&json, "last_server_state_hash", last_server_hash);
|
||||
}
|
||||
@@ -1717,7 +1793,8 @@ storage_sync_response_has_changes(const char *json)
|
||||
return storage_json_array_has_items(json, "$.changes.habits") ||
|
||||
storage_json_array_has_items(json, "$.changes.habit_days") ||
|
||||
storage_json_array_has_items(json, "$.changes.sessions") ||
|
||||
storage_json_array_has_items(json, "$.changes.meditation_logs");
|
||||
storage_json_array_has_items(json, "$.changes.meditation_logs") ||
|
||||
storage_json_array_has_items(json, "$.changes.social_cache");
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -2007,6 +2084,16 @@ storage_apply_sync_response_json(const char *response_json)
|
||||
" AND NOT EXISTS (SELECT 1 FROM sync_outbox "
|
||||
" WHERE entity_type='session' AND "
|
||||
"entity_id=COALESCE(json_extract(s.value,'$.id'),'') AND local_date=0)))";
|
||||
static const char *social_cache_sql =
|
||||
"INSERT INTO social_cache(user_id,kind,json,updated_at) "
|
||||
"SELECT ?2,"
|
||||
" COALESCE(json_extract(value,'$.kind'),''),"
|
||||
" json(COALESCE(json_extract(value,'$.json'),'{}')),"
|
||||
" CAST(COALESCE(strftime('%s',json_extract(value,'$.updated_at')),'0') AS INTEGER) "
|
||||
"FROM json_each(?1,'$.changes.social_cache') "
|
||||
"WHERE COALESCE(json_extract(value,'$.kind'),'')<>'' "
|
||||
"ON CONFLICT(user_id,kind) DO UPDATE SET "
|
||||
" json=excluded.json,updated_at=excluded.updated_at";
|
||||
long long server_version;
|
||||
long long server_clock;
|
||||
long long old_server_version;
|
||||
@@ -2050,12 +2137,14 @@ storage_apply_sync_response_json(const char *response_json)
|
||||
old_server_version = get_meta_int64("sync_last_server_version", 0);
|
||||
if(!exec_sql("BEGIN IMMEDIATE"))
|
||||
return 0;
|
||||
storage_clear_uploaded_outbox(g_storage.pending_sync_outbox_seq);
|
||||
if(!storage_exec_json_user_sql(habits_sql, response_json) ||
|
||||
!storage_exec_json_user_sql(habit_days_sql, response_json) ||
|
||||
!storage_merge_duplicate_habit_names() ||
|
||||
!storage_exec_json_user_sql(delete_rounds_sql, response_json) ||
|
||||
!storage_exec_json_user_sql(rounds_sql, response_json) ||
|
||||
!storage_exec_json_user_sql(sessions_sql, response_json)) {
|
||||
!storage_exec_json_user_sql(sessions_sql, response_json) ||
|
||||
!storage_exec_json_user_sql(social_cache_sql, response_json)) {
|
||||
exec_sql("ROLLBACK");
|
||||
return 0;
|
||||
}
|
||||
@@ -2086,11 +2175,11 @@ storage_apply_sync_response_json(const char *response_json)
|
||||
storage_sync_review_delete_json();
|
||||
set_meta_int64(STORAGE_SYNC_APPLY_REVIEW_KEY, 0);
|
||||
set_meta_int64(STORAGE_SYNC_FULL_REPLACE_KEY, 0);
|
||||
storage_clear_uploaded_outbox(g_storage.pending_sync_outbox_seq);
|
||||
g_storage.pending_sync_outbox_seq = 0;
|
||||
set_meta_int64("sync_full_upload_done", 1);
|
||||
set_meta_int64(STORAGE_SYNC_BACKFILL_KEY, 1);
|
||||
set_meta_int64(STORAGE_SYNC_HABIT_NAME_REPAIR_KEY, 1);
|
||||
set_meta_int64(STORAGE_SYNC_ZERO_HABIT_DAY_REPAIR_KEY, 1);
|
||||
storage_mark_habits_initialized();
|
||||
storage_schedule_persist();
|
||||
return 1;
|
||||
@@ -2101,6 +2190,7 @@ storage_clear_local_sync_data(void)
|
||||
{
|
||||
static const char *const sqls[] = {"DELETE FROM session_rounds", "DELETE FROM sessions",
|
||||
"DELETE FROM habit_days", "DELETE FROM habits",
|
||||
"DELETE FROM social_cache",
|
||||
"DELETE FROM sync_outbox"};
|
||||
|
||||
if(g_storage.db == NULL)
|
||||
@@ -2126,6 +2216,32 @@ storage_last_sync_changed(void)
|
||||
return g_storage.last_sync_changed;
|
||||
}
|
||||
|
||||
int
|
||||
storage_sync_status(InbeStorageSyncStatus *status)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
|
||||
if(status == NULL)
|
||||
return 0;
|
||||
memset(status, 0, sizeof(*status));
|
||||
if(g_storage.db == NULL)
|
||||
return 0;
|
||||
|
||||
status->has_account = storage_has_sync_account();
|
||||
status->review_pending = get_meta_int64(STORAGE_SYNC_PENDING_REVIEW_KEY, 0) != 0;
|
||||
status->repair_pending = get_meta_int64(STORAGE_SYNC_ZERO_HABIT_DAY_REPAIR_KEY, 0) == 0;
|
||||
status->full_upload_done = get_meta_int64("sync_full_upload_done", 0) != 0;
|
||||
status->server_version = get_meta_int64("sync_last_server_version", 0);
|
||||
status->server_clock = get_meta_int64(STORAGE_SYNC_SERVER_CLOCK_KEY, 0);
|
||||
if(sqlite3_prepare_v2(g_storage.db, "SELECT COUNT(*) FROM sync_outbox", -1, &stmt, NULL) ==
|
||||
SQLITE_OK) {
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
status->queued_changes = sqlite3_column_int64(stmt, 0);
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
storage_purge_synced_deleted_data(void)
|
||||
{
|
||||
@@ -2238,6 +2354,116 @@ storage_session_count(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
static int
|
||||
storage_profile_day_offset(int local_date, int today_date)
|
||||
{
|
||||
struct tm day_tm = {0};
|
||||
struct tm today_tm = {0};
|
||||
time_t day_time;
|
||||
time_t today_time;
|
||||
double diff_days;
|
||||
|
||||
if(local_date <= 0 || today_date <= 0)
|
||||
return -1;
|
||||
day_tm.tm_year = local_date / 10000 - 1900;
|
||||
day_tm.tm_mon = (local_date / 100) % 100 - 1;
|
||||
day_tm.tm_mday = local_date % 100;
|
||||
day_tm.tm_hour = 12;
|
||||
today_tm.tm_year = today_date / 10000 - 1900;
|
||||
today_tm.tm_mon = (today_date / 100) % 100 - 1;
|
||||
today_tm.tm_mday = today_date % 100;
|
||||
today_tm.tm_hour = 12;
|
||||
day_time = mktime(&day_tm);
|
||||
today_time = mktime(&today_tm);
|
||||
diff_days = difftime(today_time, day_time) / 86400.0;
|
||||
if(diff_days < -0.5 || diff_days > 370.5)
|
||||
return -1;
|
||||
return (int)(diff_days + 0.5);
|
||||
}
|
||||
|
||||
int
|
||||
storage_profile_activity_stats(int activity, int today_date,
|
||||
int *streak_out, long *avg_hold_out)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int seen[371] = {0};
|
||||
int streak = 0;
|
||||
long avg_value = 0;
|
||||
int mask = 1 << activity;
|
||||
|
||||
if(streak_out != NULL)
|
||||
*streak_out = 0;
|
||||
if(avg_hold_out != NULL)
|
||||
*avg_hold_out = 0;
|
||||
if(g_storage.db == NULL || activity < 0 || activity >= 30)
|
||||
return 0;
|
||||
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT local_date FROM sessions "
|
||||
"WHERE user_id=?1 AND deleted_at=0 AND activity=?2 "
|
||||
" AND local_date>0 "
|
||||
"UNION "
|
||||
"SELECT hd.local_date "
|
||||
"FROM habit_days hd JOIN habits h ON h.id=hd.habit_id "
|
||||
"WHERE h.user_id=?1 AND h.deleted_at=0 "
|
||||
" AND h.sync_mode=?3 AND (h.sync_activity & ?4)<>0 "
|
||||
" AND (hd.completed!=0 OR hd.count>0)",
|
||||
-1, &stmt, NULL) != SQLITE_OK)
|
||||
return 0;
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
sqlite3_bind_int(stmt, 2, activity);
|
||||
sqlite3_bind_int(stmt, 3, INBE_HABIT_SYNC_ACTIVITIES);
|
||||
sqlite3_bind_int(stmt, 4, mask);
|
||||
while(sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
int offset = storage_profile_day_offset(sqlite3_column_int(stmt, 0), today_date);
|
||||
if(offset >= 0 && offset <= 370)
|
||||
seen[offset] = 1;
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
stmt = NULL;
|
||||
|
||||
while(streak <= 370 && seen[streak])
|
||||
streak++;
|
||||
|
||||
if(activity == 0) {
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT COALESCE(AVG(sr.seconds),0) "
|
||||
"FROM sessions s JOIN session_rounds sr ON sr.session_id=s.id "
|
||||
"WHERE s.user_id=?1 AND s.deleted_at=0 AND s.activity=?2 "
|
||||
" AND sr.seconds>0",
|
||||
-1, &stmt, NULL) == SQLITE_OK) {
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
sqlite3_bind_int(stmt, 2, activity);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
avg_value = (long)sqlite3_column_double(stmt, 0);
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
} else if(activity == 1) {
|
||||
if(sqlite3_prepare_v2(g_storage.db,
|
||||
"SELECT COALESCE(AVG(total_seconds),0) "
|
||||
"FROM ("
|
||||
" SELECT SUM(sr.seconds) AS total_seconds "
|
||||
" FROM sessions s JOIN session_rounds sr ON sr.session_id=s.id "
|
||||
" WHERE s.user_id=?1 AND s.deleted_at=0 AND s.activity=?2 "
|
||||
" AND sr.seconds>0 "
|
||||
" GROUP BY s.id"
|
||||
")",
|
||||
-1, &stmt, NULL) == SQLITE_OK) {
|
||||
bind_text(stmt, 1, g_storage.user_id);
|
||||
sqlite3_bind_int(stmt, 2, activity);
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
avg_value = (long)sqlite3_column_double(stmt, 0);
|
||||
sqlite3_finalize(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
if(streak_out != NULL)
|
||||
*streak_out = streak;
|
||||
if(avg_hold_out != NULL)
|
||||
*avg_hold_out = avg_value;
|
||||
return 1;
|
||||
}
|
||||
|
||||
long long
|
||||
storage_total_size(void)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,16 @@ typedef struct InbeStorageImportInfo {
|
||||
int setting_count;
|
||||
} InbeStorageImportInfo;
|
||||
|
||||
typedef struct InbeStorageSyncStatus {
|
||||
int has_account;
|
||||
int review_pending;
|
||||
int repair_pending;
|
||||
int full_upload_done;
|
||||
long long server_version;
|
||||
long long server_clock;
|
||||
long long queued_changes;
|
||||
} InbeStorageSyncStatus;
|
||||
|
||||
int storage_init(const char *root);
|
||||
void storage_close(void);
|
||||
const char *storage_db_path(void);
|
||||
@@ -42,6 +52,8 @@ void storage_set_setting_text(const char *key, const char *value);
|
||||
void storage_settings_begin_write(void);
|
||||
void storage_settings_end_write(void);
|
||||
int storage_settings_empty(void);
|
||||
int storage_get_social_cache_json(const char *kind, char *out, size_t out_size);
|
||||
int storage_set_social_cache_json(const char *kind, const char *json);
|
||||
|
||||
int storage_save_session(const int *round_times, int round_count,
|
||||
char *out_id, size_t out_id_size);
|
||||
@@ -63,18 +75,22 @@ int storage_has_any(void);
|
||||
int storage_session_count(void);
|
||||
int storage_habit_count(void);
|
||||
long long storage_total_size(void);
|
||||
int storage_profile_activity_stats(int activity, int today_date,
|
||||
int *streak_out, long *avg_hold_out);
|
||||
long long storage_delete_all_sessions(void);
|
||||
char *storage_build_sync_payload_json(const char *user_id_hash,
|
||||
const char *public_key_hex);
|
||||
void storage_free_sync_payload_json(char *payload);
|
||||
int storage_apply_sync_response_json(const char *response_json);
|
||||
int storage_last_sync_changed(void);
|
||||
int storage_sync_status(InbeStorageSyncStatus *status);
|
||||
int storage_sync_review_pending(void);
|
||||
int storage_sync_review_details(char **local_out, char **remote_out);
|
||||
int storage_sync_review_diff(char **diff_out);
|
||||
int storage_sync_review_has_visible_diff(void);
|
||||
int storage_sync_review_json_has_visible_diff(const char *json);
|
||||
int storage_sync_review_clear_if_no_visible_diff(void);
|
||||
int storage_sync_review_apply_remote_if_local_empty(void);
|
||||
int storage_apply_pending_sync_review(int use_remote);
|
||||
void storage_purge_synced_deleted_data(void);
|
||||
const char *storage_sync_client_id(void);
|
||||
|
||||