Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,82 @@ 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
|
||||
uses: mnao305/[email protected]
|
||||
with:
|
||||
file-path: build/release/chrome-web-store/inbe-chrome-web-store.zip
|
||||
extension-id: lballhghblaenelehneigekpofgcaifa
|
||||
client-id: ${{ secrets.CHROME_CLIENT_ID }}
|
||||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
||||
publish: true
|
||||
@@ -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
|
||||
+24
-2
@@ -1,10 +1,32 @@
|
||||
# Changelog
|
||||
## [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 \
|
||||
@@ -294,7 +321,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 +380,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 +480,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 +536,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 +567,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 +615,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 +640,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 +655,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 +673,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 +714,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 +731,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 +754,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 +836,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 \
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 101 KiB |
@@ -35,8 +35,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 35
|
||||
versionCode 58
|
||||
versionName "1.6.2"
|
||||
versionCode 62
|
||||
versionName "1.6.6"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
@@ -107,6 +110,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"
|
||||
@@ -185,7 +189,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
|
||||
|
||||
@@ -624,8 +624,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() {
|
||||
|
||||
@@ -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 @@
|
||||
- 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
|
||||
+44
-51
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -305,10 +320,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 +347,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 +573,7 @@ Oceán
|
||||
Les
|
||||
---
|
||||
[theme_sunset]
|
||||
Západ slunce
|
||||
Soumrak
|
||||
---
|
||||
[theme_lavender]
|
||||
Levandule
|
||||
@@ -738,10 +762,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 +800,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 +827,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 +841,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 +867,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Relace je aktivni
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Zadrz: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Nadech: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Dalsi kolo
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+46
-53
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -305,10 +320,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 +347,7 @@ Kreis
|
||||
Lautstärke
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Lautstaerkeregler anzeigen
|
||||
Lautstärkeregler anzeigen
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Auf Standard zurücksetzen
|
||||
@@ -549,7 +573,7 @@ Ozean
|
||||
Wald
|
||||
---
|
||||
[theme_sunset]
|
||||
Sonnenuntergang
|
||||
Abendrot
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavendel
|
||||
@@ -738,10 +762,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 +800,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 +827,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 +841,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 +860,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sitzung aktiv
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Start: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Halten: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Einatmen: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Naechste Runde
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+37
-44
@@ -160,6 +160,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
|
||||
---
|
||||
@@ -370,6 +385,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 +804,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 +842,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 +869,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 +919,6 @@ Fade
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
---
|
||||
[notification_session_active]
|
||||
Session active
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Starting: %ds
|
||||
---
|
||||
@@ -938,6 +931,6 @@ Hold: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Breath in: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Next round
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
+42
-49
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -305,10 +320,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 +762,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 +800,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 +827,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 +841,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 +867,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesion activa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Retencion: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inhala: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Siguiente ronda
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+45
-51
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -308,10 +323,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 +350,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 +576,7 @@ Océan
|
||||
Forêt
|
||||
---
|
||||
[theme_sunset]
|
||||
Coucher de soleil
|
||||
Crépuscule
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavande
|
||||
@@ -780,10 +804,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 +842,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 +869,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 +883,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 +909,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 +929,6 @@ Retention : %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspirez : %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Tour suivant
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
+43
-50
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -305,10 +320,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 +762,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 +800,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 +827,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 +841,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 +860,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sesi aktif
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Mulai: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Tahan: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Tarik napas: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Ronde berikutnya
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+44
-51
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -359,10 +374,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 +401,7 @@ Cerchio
|
||||
Volume
|
||||
---
|
||||
[show_session_volume_control_label]
|
||||
Mostra il controllo volume
|
||||
Mostra controllo volume
|
||||
---
|
||||
[reset_to_defaults_label]
|
||||
Ripristina predefiniti
|
||||
@@ -738,10 +762,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 +800,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 +827,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 +841,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 +860,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessione attiva
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Avvio: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Trattieni: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspira: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Round successivo
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+42
-49
@@ -157,6 +157,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]
|
||||
呼吸
|
||||
---
|
||||
@@ -305,10 +320,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 +762,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 +800,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 +827,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 +841,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 +867,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
セッション中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
開始: %d秒
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
吸う: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
次のラウンド
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+42
-49
@@ -157,6 +157,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]
|
||||
호흡
|
||||
---
|
||||
@@ -359,10 +374,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 +761,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 +799,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 +826,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 +840,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 +866,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 +915,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
세션 진행 중
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
시작: %d초
|
||||
---
|
||||
@@ -934,7 +927,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
들이쉬기: %d초
|
||||
---
|
||||
[notification_next_round]
|
||||
다음 라운드
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+44
-51
@@ -157,6 +157,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
|
||||
---
|
||||
@@ -305,10 +320,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 +573,7 @@ Oceano
|
||||
Floresta
|
||||
---
|
||||
[theme_sunset]
|
||||
Pôr do sol
|
||||
Poente
|
||||
---
|
||||
[theme_lavender]
|
||||
Lavanda
|
||||
@@ -738,10 +762,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 +800,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 +827,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 +841,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 +860,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Sessao ativa
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Inicio: %ds
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Segure: %ds
|
||||
[notification_breath_in_seconds]
|
||||
Inspire: %ds
|
||||
---
|
||||
[notification_next_round]
|
||||
Proxima rodada
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+42
-49
@@ -160,6 +160,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]
|
||||
ДЫШАТЬ
|
||||
---
|
||||
@@ -362,10 +377,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 +762,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 +800,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 +827,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 +841,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 +867,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 +916,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
Сессия активна
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
Старт: %dс
|
||||
---
|
||||
@@ -935,7 +928,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
Вдох: %dс
|
||||
---
|
||||
[notification_next_round]
|
||||
Следующий раунд
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
+42
-49
@@ -157,6 +157,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]
|
||||
呼吸
|
||||
---
|
||||
@@ -305,10 +320,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 +760,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 +798,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 +825,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 +839,6 @@ Wim Hof 屏息轮次
|
||||
[practice_guide_manual]
|
||||
开始练习前请先阅读教程,了解完整的练习流程。
|
||||
---
|
||||
[practice_guide_sun]
|
||||
准备开始练习时,请使用太阳标签。
|
||||
---
|
||||
[practice_guide_config]
|
||||
根据你的需要调整练习配置。
|
||||
---
|
||||
@@ -869,13 +865,13 @@ Wim Hof 屏息轮次
|
||||
---
|
||||
|
||||
[transition_label]
|
||||
Transition
|
||||
过渡
|
||||
[transition_none]
|
||||
None
|
||||
无
|
||||
[transition_fade]
|
||||
Fade
|
||||
淡入淡出
|
||||
[theme_picker_title]
|
||||
Choose Theme
|
||||
选择主题
|
||||
[skip_button]
|
||||
Skip
|
||||
---
|
||||
@@ -918,9 +914,6 @@ Save Alias
|
||||
[sync_alias_saved]
|
||||
Alias saved
|
||||
---
|
||||
[notification_session_active]
|
||||
练习进行中
|
||||
---
|
||||
[notification_starting_seconds]
|
||||
开始: %d秒
|
||||
---
|
||||
@@ -933,7 +926,7 @@ Alias saved
|
||||
[notification_breath_in_seconds]
|
||||
吸气: %d秒
|
||||
---
|
||||
[notification_next_round]
|
||||
下一轮
|
||||
[notification_results]
|
||||
Results
|
||||
---
|
||||
---
|
||||
@@ -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;
|
||||
|
||||
+62
-512
@@ -333,7 +333,8 @@ app_modal_type_name(UIModalType type)
|
||||
case UIModalConfirmDeleteSyncAccount: return "confirm_delete_sync_account";
|
||||
case UIModalHabitPracticeListInfo: return "habit_practice_list_info";
|
||||
case UIModalHabitCountingInfo: return "habit_counting_info";
|
||||
case UIModalBottomNavConfig: return "bottom_nav_config";
|
||||
case UIModalPracticeManual: return "practice_manual";
|
||||
case UIModalPracticeConfig: return "practice_config";
|
||||
case UIModalThemePicker: return "theme_picker";
|
||||
case UIModalSyncReview: return "sync_review";
|
||||
case UIModalSyncAlias: return "sync_alias";
|
||||
@@ -462,7 +463,9 @@ app_pump_sync(InbeApp *app)
|
||||
double now;
|
||||
int should_sync = 0;
|
||||
int dirty_due = 0;
|
||||
int repair_due = 0;
|
||||
char url[256];
|
||||
InbeStorageSyncStatus sync_status;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
@@ -485,6 +488,11 @@ app_pump_sync(InbeApp *app)
|
||||
should_sync = 1;
|
||||
dirty_due = 1;
|
||||
}
|
||||
if(storage_sync_status(&sync_status) && sync_status.has_account && sync_status.repair_pending &&
|
||||
(g_dirty_sync_at <= 0.0 || now >= g_dirty_sync_at)) {
|
||||
should_sync = 1;
|
||||
repair_due = 1;
|
||||
}
|
||||
#if !defined(PLATFORM_WEB)
|
||||
sync_lock();
|
||||
#endif
|
||||
@@ -511,15 +519,15 @@ app_pump_sync(InbeApp *app)
|
||||
storage_sync_review_pending(),
|
||||
app->tutorial_seen,
|
||||
app->habits_guide_seen);
|
||||
if(g_dirty_sync_at <= 0.0)
|
||||
if(g_dirty_sync_at <= 0.0 || repair_due)
|
||||
g_dirty_sync_at = now + 1.0;
|
||||
return;
|
||||
}
|
||||
if(app_sync_now(app)) {
|
||||
if(dirty_due)
|
||||
if(dirty_due || repair_due)
|
||||
g_dirty_sync_at = 0.0;
|
||||
TraceLog(LOG_INFO, "SYNC: dispatched");
|
||||
} else if(dirty_due) {
|
||||
} else if(dirty_due || repair_due) {
|
||||
g_dirty_sync_at = now + INBE_SYNC_INPUT_QUIET_SECONDS;
|
||||
}
|
||||
app_apply_pending_sync_refresh(app);
|
||||
@@ -612,114 +620,6 @@ app_observe_direct_screen_change(InbeApp *app, int before_screen)
|
||||
app->screen_transition_target = app->inbe.screen;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
enum {
|
||||
APP_SETTINGS_SAVE_DELAY_TICKS = 30,
|
||||
APP_SIDEBAR_ENABLED = 0
|
||||
};
|
||||
|
||||
static void
|
||||
app_schedule_settings_save(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->settings_dirty = 1;
|
||||
app->settings_save_delay_ticks = APP_SETTINGS_SAVE_DELAY_TICKS;
|
||||
}
|
||||
|
||||
static int
|
||||
app_sidebar_is_wide_layout(void)
|
||||
{
|
||||
if(!APP_SIDEBAR_ENABLED)
|
||||
return 0;
|
||||
return app_full_view_width >= flint_px(600);
|
||||
}
|
||||
|
||||
static int
|
||||
app_sidebar_width(void)
|
||||
{
|
||||
int width = flint_px(220);
|
||||
int max_width = app_full_view_width / 3;
|
||||
|
||||
if(width > max_width)
|
||||
width = max_width;
|
||||
if(width < flint_px(180))
|
||||
width = flint_px(180);
|
||||
return width;
|
||||
}
|
||||
|
||||
static void
|
||||
app_request_sidebar_route(InbeApp *app, int route)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app->pending_sidebar_route = route;
|
||||
}
|
||||
|
||||
static void
|
||||
app_apply_sidebar_route(InbeApp *app, int route)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
|
||||
switch(route) {
|
||||
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);
|
||||
app_schedule_settings_save(app);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(!app_sidebar_is_wide_layout())
|
||||
app->sidebar_open = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
app_apply_pending_sidebar_route(InbeApp *app)
|
||||
{
|
||||
int pending;
|
||||
|
||||
if(app == NULL || app->pending_sidebar_route == APP_NAV_ROUTE_NONE)
|
||||
return;
|
||||
|
||||
pending = app->pending_sidebar_route;
|
||||
app->pending_sidebar_route = APP_NAV_ROUTE_NONE;
|
||||
app_apply_sidebar_route(app, pending);
|
||||
}
|
||||
|
||||
static void
|
||||
app_flush_deferred_settings(InbeApp *app)
|
||||
{
|
||||
@@ -731,9 +631,6 @@ app_flush_deferred_settings(InbeApp *app)
|
||||
save_settings(app);
|
||||
}
|
||||
|
||||
static int app_current_nav_route(const InbeApp *app);
|
||||
static int app_bottom_nav_contains_route(const InbeApp *app, int route);
|
||||
|
||||
int
|
||||
app_toolbar_height(void)
|
||||
{
|
||||
@@ -743,100 +640,11 @@ app_toolbar_height(void)
|
||||
int
|
||||
app_content_top_reserved(const InbeApp *app)
|
||||
{
|
||||
if(app != NULL && app->inbe.screen == InbeScreenStart) {
|
||||
return ui_tab_bar_height() + flint_px(PRACTICE_CATEGORY_TAB_H);
|
||||
}
|
||||
if(app != NULL && app->inbe.screen == InbeScreenStart)
|
||||
return ui_tab_bar_height();
|
||||
return app_toolbar_height();
|
||||
}
|
||||
|
||||
int
|
||||
app_content_bottom_reserved(const InbeApp *app)
|
||||
{
|
||||
if(app == NULL || app->bottom_nav_count <= 0)
|
||||
return 0;
|
||||
if(app_bottom_nav_contains_route(app, app_current_nav_route(app)))
|
||||
return ui_bottom_nav_height();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
app_draw_sidebar_toggle(InbeApp *app, int x, int y)
|
||||
{
|
||||
int hover = 0;
|
||||
Texture2D icon;
|
||||
|
||||
if(!APP_SIDEBAR_ENABLED)
|
||||
return 0;
|
||||
if(app == NULL || app->modal.active)
|
||||
return 0;
|
||||
if(app->sidebar_open && app_sidebar_is_wide_layout())
|
||||
return 0;
|
||||
icon = app->sidebar_open
|
||||
? app->icons[UI_ICON_TYPE_X]
|
||||
: app->icons[UI_ICON_TYPE_STACK];
|
||||
if(ui_draw_icon_btn_padded(x, y, flint_px(20), flint_px(8),
|
||||
icon, &hover)) {
|
||||
app->sidebar_open = !app->sidebar_open;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
app_bottom_nav_default_routes(int *routes, int *count)
|
||||
{
|
||||
if(routes == NULL)
|
||||
return;
|
||||
routes[0] = APP_NAV_ROUTE_HABITS;
|
||||
routes[1] = APP_NAV_ROUTE_PRACTICE;
|
||||
routes[2] = APP_NAV_ROUTE_SETTINGS;
|
||||
if(count != NULL)
|
||||
*count = 3;
|
||||
}
|
||||
|
||||
static void
|
||||
app_bottom_nav_set_defaults(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
app_bottom_nav_default_routes(app->bottom_nav_routes, &app->bottom_nav_count);
|
||||
}
|
||||
|
||||
static int
|
||||
app_nav_route_valid(int route)
|
||||
{
|
||||
return route == APP_NAV_ROUTE_HABITS ||
|
||||
route == APP_NAV_ROUTE_PRACTICE ||
|
||||
route == APP_NAV_ROUTE_SETTINGS;
|
||||
}
|
||||
|
||||
static void
|
||||
app_bottom_nav_normalize(InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return;
|
||||
if(app->bottom_nav_count < 0 || app->bottom_nav_count > APP_BOTTOM_NAV_MAX_ITEMS) {
|
||||
app_bottom_nav_set_defaults(app);
|
||||
return;
|
||||
}
|
||||
for(int i = 0; i < app->bottom_nav_count; i++) {
|
||||
if(!app_nav_route_valid(app->bottom_nav_routes[i]))
|
||||
app_bottom_nav_set_defaults(app);
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
app_nav_route_label(int route)
|
||||
{
|
||||
switch(route) {
|
||||
case APP_NAV_ROUTE_HABITS: return locale_get("tab_habits");
|
||||
case APP_NAV_ROUTE_PRACTICE: return locale_get("tab_practice");
|
||||
case APP_NAV_ROUTE_SETTINGS: return locale_get("tab_settings");
|
||||
default: break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void
|
||||
app_open_modal(InbeApp *app, UIModalType type)
|
||||
{
|
||||
@@ -850,113 +658,31 @@ app_open_modal(InbeApp *app, UIModalType type)
|
||||
void
|
||||
app_close_modal(InbeApp *app)
|
||||
{
|
||||
UIModalType type;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
type = app->modal.type;
|
||||
if(type == UIModalEditProgressiveStartSpeed &&
|
||||
app->inbe.screen == InbeScreenStart &&
|
||||
app->practice_tab == PRACTICE_TAB_CONFIG) {
|
||||
app->modal.type = UIModalPracticeConfig;
|
||||
app->modal_open_frame = app->inbe.frame;
|
||||
return;
|
||||
}
|
||||
if(type == UIModalPracticeConfig) {
|
||||
app_leave_practice_config(app);
|
||||
app->settings_scroll = 0;
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
} else if(type == UIModalPracticeManual) {
|
||||
app->manual_scroll = 0;
|
||||
app->tutorial_step = 0;
|
||||
app->practice_tab = PRACTICE_TAB_PLAY;
|
||||
}
|
||||
app->modal.active = 0;
|
||||
app->modal.type = UIModalNone;
|
||||
}
|
||||
|
||||
static Texture2D
|
||||
app_nav_route_icon(InbeApp *app, int route)
|
||||
{
|
||||
if(app == NULL)
|
||||
return (Texture2D){0};
|
||||
switch(route) {
|
||||
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_SETTINGS: return app->icons[UI_ICON_TYPE_GEAR];
|
||||
default: break;
|
||||
}
|
||||
return (Texture2D){0};
|
||||
}
|
||||
|
||||
static int
|
||||
app_current_nav_route(const InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return APP_NAV_ROUTE_NONE;
|
||||
switch(app->inbe.screen) {
|
||||
case InbeScreenStart:
|
||||
return APP_NAV_ROUTE_PRACTICE;
|
||||
case InbeScreenHabits:
|
||||
return APP_NAV_ROUTE_HABITS;
|
||||
case InbeScreenSettings:
|
||||
return APP_NAV_ROUTE_SETTINGS;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return APP_NAV_ROUTE_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
app_bottom_nav_contains_route(const InbeApp *app, int route)
|
||||
{
|
||||
if(app == NULL || route == APP_NAV_ROUTE_NONE)
|
||||
return 0;
|
||||
for(int i = 0; i < app->bottom_nav_count && i < APP_BOTTOM_NAV_MAX_ITEMS; i++) {
|
||||
if(app->bottom_nav_routes[i] == route)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
app_nav_route_active(const InbeApp *app, int route)
|
||||
{
|
||||
if(app == NULL)
|
||||
return 0;
|
||||
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_SETTINGS)
|
||||
return app->inbe.screen == InbeScreenSettings;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
app_should_draw_bottom_nav(const InbeApp *app)
|
||||
{
|
||||
if(app == NULL || app->bottom_nav_count <= 0)
|
||||
return 0;
|
||||
return app_bottom_nav_contains_route(app, app_current_nav_route(app));
|
||||
}
|
||||
|
||||
static void
|
||||
app_draw_bottom_nav(InbeApp *app)
|
||||
{
|
||||
FlintUIBottomNavItem items[APP_BOTTOM_NAV_MAX_ITEMS];
|
||||
FlintUIBottomNavResult result;
|
||||
int count;
|
||||
|
||||
if(!app_should_draw_bottom_nav(app))
|
||||
return;
|
||||
app_bottom_nav_normalize(app);
|
||||
count = app->bottom_nav_count;
|
||||
if(count > APP_BOTTOM_NAV_MAX_ITEMS)
|
||||
count = APP_BOTTOM_NAV_MAX_ITEMS;
|
||||
for(int i = 0; i < count; i++) {
|
||||
int route = app->bottom_nav_routes[i];
|
||||
items[i] = (FlintUIBottomNavItem){
|
||||
route,
|
||||
app_nav_route_label(route),
|
||||
app_nav_route_icon(app, route),
|
||||
app_nav_route_active(app, route),
|
||||
app->modal.active
|
||||
};
|
||||
}
|
||||
result = ui_draw_bottom_nav((FlintUIBottomNav){
|
||||
.view_width = view_width,
|
||||
.view_height = view_height,
|
||||
.count = count,
|
||||
.items = items
|
||||
});
|
||||
if(result.clicked_route != APP_NAV_ROUTE_NONE)
|
||||
app_request_sidebar_route(app, result.clicked_route);
|
||||
}
|
||||
|
||||
static int
|
||||
exercise_manual_seen_bit(int exercise_type)
|
||||
{
|
||||
@@ -986,85 +712,6 @@ mark_exercise_manual_seen(InbeApp *app, int exercise_type)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
app_draw_sidebar_button(InbeApp *app, int route, int x, int y, int w,
|
||||
Texture2D icon, const char *label)
|
||||
{
|
||||
int hover = 0;
|
||||
int selected = 0;
|
||||
int wide = app_sidebar_is_wide_layout();
|
||||
int button_h = wide ? flint_px(50) : flint_px(42);
|
||||
int icon_size = wide ? flint_px(24) : flint_px(20);
|
||||
int icon_y = y + (button_h - icon_size) / 2;
|
||||
UIButtonStyle style = UI_BUTTON_STYLE_SECONDARY;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
selected = app_nav_route_active(app, route);
|
||||
if(selected)
|
||||
style = UI_BUTTON_STYLE_TAB_SELECTED;
|
||||
|
||||
if(ui_draw_generic_button(x, y, w, button_h, label, style, 0, &hover))
|
||||
app_request_sidebar_route(app, route);
|
||||
if(icon.id != 0) {
|
||||
DrawTexturePro(icon, (Rectangle){0, 0, icon.width, icon.height},
|
||||
(Rectangle){x + flint_px(12), icon_y,
|
||||
icon_size, icon_size},
|
||||
(Vector2){0}, 0, flint_theme_get_icon());
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
app_draw_sidebar(InbeApp *app, int width, int height)
|
||||
{
|
||||
int pad = flint_px(16);
|
||||
int title_h = flint_px(58);
|
||||
int icon_w = flint_px(20) + flint_px(8) * 2;
|
||||
int title_max_w = width - (flint_px(12) + icon_w) * 2;
|
||||
int button_w = width - pad * 2;
|
||||
int button_gap = app_sidebar_is_wide_layout() ? flint_px(10) : flint_px(8);
|
||||
int button_h = app_sidebar_is_wide_layout() ? flint_px(50) : flint_px(42);
|
||||
int y = title_h + flint_px(16);
|
||||
int title_font;
|
||||
int title_w;
|
||||
int title_x;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
DrawRectangle(0, 0, width, height, flint_darken(flint_theme_get_bg(), 8));
|
||||
DrawLine(width - 1, 0, width - 1, height, flint_darken(flint_theme_get_bg(), 42));
|
||||
|
||||
if(app->sidebar_open) {
|
||||
int hover = 0;
|
||||
if(ui_draw_icon_btn_padded(flint_px(12), flint_px(12), flint_px(20),
|
||||
flint_px(8), app->icons[UI_ICON_TYPE_X],
|
||||
&hover))
|
||||
app->sidebar_open = 0;
|
||||
} else {
|
||||
app_draw_sidebar_toggle(app, flint_px(12), flint_px(12));
|
||||
}
|
||||
if(title_max_w < flint_px(80))
|
||||
title_max_w = width - pad * 2;
|
||||
title_font = flint_ui_title_font(locale_get("app_title"), title_max_w);
|
||||
title_w = flint_text_measure(locale_get("app_title"), title_font);
|
||||
title_x = (width - title_w) / 2;
|
||||
if(title_x < pad + icon_w)
|
||||
title_x = pad + icon_w;
|
||||
if(title_x + title_w > width - pad)
|
||||
title_x = width - pad - title_w;
|
||||
flint_text_draw(locale_get("app_title"), title_x,
|
||||
flint_ui_text_y(locale_get("app_title"), 0, title_h, title_font),
|
||||
title_font, flint_theme_get_text());
|
||||
|
||||
app_draw_sidebar_button(app, APP_NAV_ROUTE_PRACTICE, pad, y, button_w,
|
||||
app->icons[UI_ICON_TYPE_AMEN], locale_get("tab_practice"));
|
||||
y += button_h + button_gap;
|
||||
app_draw_sidebar_button(app, APP_NAV_ROUTE_HABITS, pad, y, button_w,
|
||||
app->icons[UI_ICON_TYPE_HABIT], locale_get("tab_habits"));
|
||||
app_draw_sidebar_button(app, APP_NAV_ROUTE_SETTINGS, pad, height - pad - button_h, button_w,
|
||||
app->icons[UI_ICON_TYPE_GEAR], locale_get("tab_settings"));
|
||||
}
|
||||
|
||||
static int
|
||||
load_locale_font(InbeApp *app)
|
||||
{
|
||||
@@ -1293,6 +940,7 @@ app_reload_after_import(InbeApp *app, int reload_settings)
|
||||
int month_offset = 0;
|
||||
int scroll = 0;
|
||||
int weekly_days = 0;
|
||||
int hold_stats_range_days = 0;
|
||||
if(app == NULL)
|
||||
return;
|
||||
|
||||
@@ -1310,6 +958,7 @@ app_reload_after_import(InbeApp *app, int reload_settings)
|
||||
month_offset = app->habits.month_offset;
|
||||
scroll = app->habits.scroll;
|
||||
weekly_days = app->habits.weekly_days;
|
||||
hold_stats_range_days = app->habits.hold_stats_range_days;
|
||||
}
|
||||
|
||||
if(reload_settings) {
|
||||
@@ -1346,6 +995,7 @@ app_reload_after_import(InbeApp *app, int reload_settings)
|
||||
app->habits.month_offset = month_offset;
|
||||
app->habits.scroll = scroll;
|
||||
app->habits.weekly_days = weekly_days;
|
||||
app->habits.hold_stats_range_days = hold_stats_range_days == 31 ? 31 : 7;
|
||||
}
|
||||
if(app->habit_detail_index >= app->habits.count)
|
||||
app->habit_detail_index = -1;
|
||||
@@ -1535,9 +1185,6 @@ app_init(void *vapp) {
|
||||
habits_init(&app->habits);
|
||||
app->habit_detail_index = -1;
|
||||
app->habit_session_edit = (HabitSessionEditState){.round = -1};
|
||||
app->sidebar_open = 0;
|
||||
app->pending_sidebar_route = APP_NAV_ROUTE_NONE;
|
||||
app_bottom_nav_normalize(app);
|
||||
flint_transition_reset(&app->screen_transition);
|
||||
app->inbe.screen = app->main_tab == APP_MAIN_TAB_HABITS
|
||||
? InbeScreenHabits
|
||||
@@ -1620,11 +1267,6 @@ app_web_background_tick(int elapsed_ms)
|
||||
static void
|
||||
handle_back_button(InbeApp *app)
|
||||
{
|
||||
if(app->sidebar_open) {
|
||||
app->sidebar_open = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* If modal is active, let modal drawing handle it */
|
||||
if(app->modal.active) {
|
||||
return;
|
||||
@@ -1685,6 +1327,10 @@ handle_back_button(InbeApp *app)
|
||||
|
||||
case InbeScreenResults:
|
||||
practice_ensure_results_saved(app);
|
||||
#if ANDROID_BUILD
|
||||
android_allow_screen_off();
|
||||
android_wakelock_release();
|
||||
#endif
|
||||
app_init(app);
|
||||
break;
|
||||
|
||||
@@ -1712,72 +1358,6 @@ handle_back_button(InbeApp *app)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
app_draw_bottom_nav_config_modal(InbeApp *app)
|
||||
{
|
||||
const char *slot_labels[APP_BOTTOM_NAV_MAX_ITEMS];
|
||||
FlintUIBottomNavOption options[3];
|
||||
FlintUIBottomNavConfigResult result;
|
||||
|
||||
if(app == NULL)
|
||||
return;
|
||||
slot_labels[0] = locale_get("bottom_nav_slot_1");
|
||||
slot_labels[1] = locale_get("bottom_nav_slot_2");
|
||||
slot_labels[2] = locale_get("bottom_nav_slot_3");
|
||||
slot_labels[3] = locale_get("bottom_nav_slot_4");
|
||||
slot_labels[4] = locale_get("bottom_nav_slot_5");
|
||||
slot_labels[5] = locale_get("bottom_nav_slot_6");
|
||||
slot_labels[6] = locale_get("bottom_nav_slot_7");
|
||||
slot_labels[7] = locale_get("bottom_nav_slot_8");
|
||||
options[0] = (FlintUIBottomNavOption){
|
||||
APP_NAV_ROUTE_HABITS,
|
||||
app_nav_route_label(APP_NAV_ROUTE_HABITS),
|
||||
app_nav_route_icon(app, APP_NAV_ROUTE_HABITS)
|
||||
};
|
||||
options[1] = (FlintUIBottomNavOption){
|
||||
APP_NAV_ROUTE_PRACTICE,
|
||||
app_nav_route_label(APP_NAV_ROUTE_PRACTICE),
|
||||
app_nav_route_icon(app, APP_NAV_ROUTE_PRACTICE)
|
||||
};
|
||||
options[2] = (FlintUIBottomNavOption){
|
||||
APP_NAV_ROUTE_SETTINGS,
|
||||
app_nav_route_label(APP_NAV_ROUTE_SETTINGS),
|
||||
app_nav_route_icon(app, APP_NAV_ROUTE_SETTINGS)
|
||||
};
|
||||
|
||||
result = ui_draw_bottom_nav_config_modal((FlintUIBottomNavConfigModal){
|
||||
.id = 700,
|
||||
.title = locale_get("bottom_nav_customize_title"),
|
||||
.routes = app->bottom_nav_draft_routes,
|
||||
.route_count = &app->bottom_nav_draft_count,
|
||||
.max_route_count = APP_BOTTOM_NAV_MAX_ITEMS,
|
||||
.slot_labels = slot_labels,
|
||||
.options = options,
|
||||
.option_count = 3,
|
||||
.add_label = locale_get("bottom_nav_add_button"),
|
||||
.cancel_label = locale_get("cancel_button"),
|
||||
.save_label = locale_get("save_button"),
|
||||
.reset_label = locale_get("reset_button"),
|
||||
.close_icon = app->icons[UI_ICON_TYPE_X]
|
||||
});
|
||||
if(result.action == 1) {
|
||||
app_close_modal(app);
|
||||
} else if(result.action == 2) {
|
||||
app->bottom_nav_count = app->bottom_nav_draft_count;
|
||||
for(int i = 0; i < APP_BOTTOM_NAV_MAX_ITEMS; i++)
|
||||
app->bottom_nav_routes[i] = app->bottom_nav_draft_routes[i];
|
||||
for(int i = app->bottom_nav_count; i < APP_BOTTOM_NAV_MAX_ITEMS; i++)
|
||||
app->bottom_nav_routes[i] = APP_NAV_ROUTE_HABITS;
|
||||
app_bottom_nav_normalize(app);
|
||||
app->settings_dirty = 1;
|
||||
save_settings(app);
|
||||
app_close_modal(app);
|
||||
} else if(result.action == 3) {
|
||||
app_bottom_nav_default_routes(app->bottom_nav_draft_routes,
|
||||
&app->bottom_nav_draft_count);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_global_modal(InbeApp *app)
|
||||
{
|
||||
@@ -1800,10 +1380,14 @@ draw_global_modal(InbeApp *app)
|
||||
app_close_modal(app);
|
||||
}
|
||||
}
|
||||
if(app->modal.type == UIModalBottomNavConfig)
|
||||
app_draw_bottom_nav_config_modal(app);
|
||||
if(app->modal.type == UIModalThemePicker)
|
||||
settings_screen_draw_theme_picker_modal(app);
|
||||
if(app->modal.type == UIModalPracticeManual ||
|
||||
app->modal.type == UIModalPracticeConfig ||
|
||||
app->modal.type == UIModalEditProgressiveStartSpeed) {
|
||||
practice_screen_draw_modal(app);
|
||||
return;
|
||||
}
|
||||
if(app->modal.type == UIModalSyncAlias) {
|
||||
modal_result = settings_sync_account_draw_alias_modal(app);
|
||||
if(modal_result == 1) {
|
||||
@@ -1840,8 +1424,8 @@ updateapp(InbeApp *app)
|
||||
int frame_screen = app->inbe.screen;
|
||||
int first_run_guide_active = 0;
|
||||
int habits_guide_active = 0;
|
||||
int practice_fullscreen_modal = 0;
|
||||
|
||||
app_apply_pending_sidebar_route(app);
|
||||
#if !ANDROID_BUILD && !defined(PLATFORM_WEB)
|
||||
app->backgrounded = (!IsWindowFocused() || IsWindowMinimized()) ? 1 : 0;
|
||||
#endif
|
||||
@@ -1856,6 +1440,11 @@ updateapp(InbeApp *app)
|
||||
habits_screen_prepare_first_run_guide(app);
|
||||
first_run_guide_active = practice_screen_first_run_guide_active(app);
|
||||
habits_guide_active = habits_screen_first_run_guide_active(app);
|
||||
practice_fullscreen_modal =
|
||||
app->modal.active &&
|
||||
(app->modal.type == UIModalPracticeManual ||
|
||||
app->modal.type == UIModalPracticeConfig ||
|
||||
app->modal.type == UIModalEditProgressiveStartSpeed);
|
||||
ui_set_input_blocked(app->modal.active);
|
||||
|
||||
if(IsKeyPressed(KEY_BACK)) {
|
||||
@@ -1897,7 +1486,7 @@ updateapp(InbeApp *app)
|
||||
goto finish_frame;
|
||||
}
|
||||
|
||||
if(app->inbe.screen == InbeScreenStart && app->practice_tab == PRACTICE_TAB_PLAY) {
|
||||
if(app->inbe.screen == InbeScreenStart) {
|
||||
practice_update_circle_bounds(app, app_content_top_reserved(app),
|
||||
app_content_bottom_reserved(app));
|
||||
} else if(app->inbe.screen == InbeScreenSession) {
|
||||
@@ -1906,7 +1495,7 @@ updateapp(InbeApp *app)
|
||||
|
||||
play_center_y = center_y - flint_px(12);
|
||||
int play_circle_clicked = 0;
|
||||
if(app->inbe.screen == InbeScreenStart && app->practice_tab == PRACTICE_TAB_PLAY)
|
||||
if(app->inbe.screen == InbeScreenStart && !practice_fullscreen_modal)
|
||||
play_circle_clicked = practice_draw_start_preview(app, center_x, play_center_y);
|
||||
else if(app->inbe.screen == InbeScreenSession)
|
||||
practice_draw_active_breathing(app, center_x, center_y);
|
||||
@@ -1915,21 +1504,20 @@ updateapp(InbeApp *app)
|
||||
switch (app->inbe.screen) {
|
||||
case InbeScreenStart:
|
||||
{
|
||||
practice_screen_draw_top_bar(app, 0);
|
||||
if(!practice_fullscreen_modal) {
|
||||
practice_screen_draw_top_bar(app, 0);
|
||||
practice_screen_draw_floating_actions(app);
|
||||
}
|
||||
|
||||
if(app->practice_tab == PRACTICE_TAB_MANUAL) {
|
||||
manual_screen_draw(app);
|
||||
} else if(app->practice_tab == PRACTICE_TAB_CONFIG) {
|
||||
const PracticeDefinition *practice = practice_get(app->exercise_type);
|
||||
if(practice->draw_config != NULL)
|
||||
practice->draw_config(app);
|
||||
} else if(!app->modal.active && app->tutorial_seen && play_circle_clicked) {
|
||||
if(!practice_fullscreen_modal && !app->modal.active &&
|
||||
app->tutorial_seen && play_circle_clicked) {
|
||||
const PracticeDefinition *practice = practice_get(app->exercise_type);
|
||||
if(practice->start != NULL)
|
||||
practice->start(app);
|
||||
}
|
||||
|
||||
practice_screen_draw_top_bar(app, 1);
|
||||
if(!practice_fullscreen_modal)
|
||||
practice_screen_draw_top_bar(app, 1);
|
||||
}
|
||||
// Skip drawing on the same frame modal opens to prevent click propagation
|
||||
if(app->modal.active && app->modal.type == UIModalMeditationSetup &&
|
||||
@@ -1990,8 +1578,6 @@ app_update_draw(void *vapp, Rectangle viewport) {
|
||||
int full_height;
|
||||
int content_x = 0;
|
||||
int content_w;
|
||||
int sidebar_w = 0;
|
||||
Camera2D frame_camera;
|
||||
|
||||
if(app == 0 || viewport.width <= 0 || viewport.height <= 0)
|
||||
return;
|
||||
@@ -2021,42 +1607,6 @@ app_update_draw(void *vapp, Rectangle viewport) {
|
||||
|
||||
DrawRectangleRec(viewport, flint_theme_get_bg());
|
||||
|
||||
if(APP_SIDEBAR_ENABLED && app->sidebar_open && !app_sidebar_is_wide_layout()) {
|
||||
app->camera = (Camera2D){0};
|
||||
app->camera.zoom = 1.0f;
|
||||
app->camera.offset.x = viewport.x;
|
||||
app->camera.offset.y = viewport.y;
|
||||
ui_set_frame(app->camera);
|
||||
flint_clip_begin((int)viewport.x, (int)viewport.y, full_width, full_height);
|
||||
BeginMode2D(app->camera);
|
||||
DrawRectangle(0, 0, view_width, view_height, flint_theme_get_bg());
|
||||
app_draw_sidebar(app, view_width, view_height);
|
||||
EndMode2D();
|
||||
flint_clip_end();
|
||||
app_apply_pending_sidebar_route(app);
|
||||
app_flush_deferred_settings(app);
|
||||
habits_flush_save(app);
|
||||
app_pump_sync(app);
|
||||
return;
|
||||
}
|
||||
|
||||
if(APP_SIDEBAR_ENABLED && app->sidebar_open && app_sidebar_is_wide_layout()) {
|
||||
sidebar_w = app_sidebar_width();
|
||||
frame_camera = (Camera2D){0};
|
||||
frame_camera.zoom = 1.0f;
|
||||
frame_camera.offset.x = viewport.x;
|
||||
frame_camera.offset.y = viewport.y;
|
||||
flint_set_view_size(sidebar_w, full_height);
|
||||
ui_init(sidebar_w, full_height, flint_dpi_scale());
|
||||
ui_set_frame(frame_camera);
|
||||
flint_clip_begin((int)viewport.x, (int)viewport.y, sidebar_w, full_height);
|
||||
BeginMode2D(frame_camera);
|
||||
app_draw_sidebar(app, sidebar_w, full_height);
|
||||
EndMode2D();
|
||||
flint_clip_end();
|
||||
content_x = sidebar_w;
|
||||
}
|
||||
|
||||
content_w = full_width - content_x;
|
||||
if(content_w < 1)
|
||||
content_w = 1;
|
||||
|
||||
+7
-11
@@ -75,7 +75,8 @@ typedef enum {
|
||||
UIModalConfirmDeleteSyncAccount,
|
||||
UIModalHabitPracticeListInfo,
|
||||
UIModalHabitCountingInfo,
|
||||
UIModalBottomNavConfig,
|
||||
UIModalPracticeManual,
|
||||
UIModalPracticeConfig,
|
||||
UIModalThemePicker,
|
||||
UIModalSyncReview,
|
||||
UIModalSyncAlias,
|
||||
@@ -151,8 +152,6 @@ typedef enum AppNavRoute {
|
||||
APP_NAV_ROUTE_COUNT = 3,
|
||||
} AppNavRoute;
|
||||
|
||||
#define APP_BOTTOM_NAV_MAX_ITEMS 8
|
||||
|
||||
typedef struct WhmPracticeState {
|
||||
Texture2D image_1;
|
||||
Texture2D image_2;
|
||||
@@ -163,6 +162,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;
|
||||
@@ -278,12 +281,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,9 +324,7 @@ 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);
|
||||
int app_should_use_tab_bar(const InbeApp *app);
|
||||
@@ -353,6 +348,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,168 @@
|
||||
#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 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_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;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
app_content_bottom_reserved(const InbeApp *app)
|
||||
{
|
||||
if(app == NULL)
|
||||
return 0;
|
||||
return app_current_nav_route(app) != APP_NAV_ROUTE_NONE ? ui_bottom_nav_height() : 0;
|
||||
}
|
||||
|
||||
static const char *
|
||||
app_nav_route_label(int route)
|
||||
{
|
||||
switch(route) {
|
||||
case APP_NAV_ROUTE_HABITS: return locale_get("tab_habits");
|
||||
case APP_NAV_ROUTE_PRACTICE: return locale_get("tab_practice");
|
||||
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_HABITS: return app->icons[UI_ICON_TYPE_HABIT];
|
||||
case APP_NAV_ROUTE_PRACTICE: return app->icons[UI_ICON_TYPE_AMEN];
|
||||
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 InbeScreenStart:
|
||||
return APP_NAV_ROUTE_PRACTICE;
|
||||
case InbeScreenHabits:
|
||||
return APP_NAV_ROUTE_HABITS;
|
||||
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_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_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 = 3 };
|
||||
const int routes[BOTTOM_NAV_ROUTE_COUNT] = {
|
||||
APP_NAV_ROUTE_HABITS,
|
||||
APP_NAV_ROUTE_PRACTICE,
|
||||
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
|
||||
};
|
||||
}
|
||||
result = ui_draw_bottom_nav((FlintUIBottomNav){
|
||||
.view_width = view_width,
|
||||
.view_height = view_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,11 @@
|
||||
#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_draw_bottom_nav(InbeApp *app);
|
||||
void app_apply_nav_route(InbeApp *app, int route);
|
||||
|
||||
#endif
|
||||
+8
-27
@@ -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,
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#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_PATCH 6
|
||||
#define INBE_VERSION_STRING "1.6.6"
|
||||
|
||||
#endif
|
||||
@@ -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;
|
||||
|
||||
+98
-100
@@ -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);
|
||||
|
||||
@@ -346,6 +346,7 @@ settings_data_content_height(int content_w)
|
||||
|
||||
return flint_px(SETTINGS_DATA_TOP_PADDING) +
|
||||
data_button_h + flint_px(12) +
|
||||
flint_px(98) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
data_button_h + flint_px(12) +
|
||||
@@ -355,6 +356,57 @@ settings_data_content_height(int content_w)
|
||||
flint_px(40);
|
||||
}
|
||||
|
||||
static void
|
||||
settings_draw_sync_status(int x, int w, int *y)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
int
|
||||
settings_data_is_configuring(const InbeApp *app)
|
||||
{
|
||||
@@ -560,6 +612,8 @@ settings_data_draw(InbeApp *app, int x, int w, int *y)
|
||||
settings_open_sync_account_config(app);
|
||||
*y += data_button_h + flint_px(12);
|
||||
|
||||
settings_draw_sync_status(x, w, y);
|
||||
|
||||
if(ui_draw_generic_button(x, *y, w, data_button_h,
|
||||
locale_get("import_data_button"),
|
||||
UI_BUTTON_STYLE_PRIMARY, 0, &hover_import))
|
||||
|
||||
@@ -354,13 +354,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 +416,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 +697,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 +704,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 +739,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;
|
||||
}
|
||||
@@ -143,6 +143,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 +157,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);
|
||||
|
||||
+121
-37
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
+35
-5
@@ -42,6 +42,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)
|
||||
@@ -1403,9 +1404,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 +1489,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 +1503,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 +1520,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);
|
||||
}
|
||||
@@ -2050,6 +2053,7 @@ 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() ||
|
||||
@@ -2086,11 +2090,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;
|
||||
@@ -2126,6 +2130,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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
@@ -69,6 +79,7 @@ char *storage_build_sync_payload_json(const char *user_id_hash,
|
||||
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);
|
||||
|
||||
+29
-481
@@ -13,390 +13,45 @@
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#if defined(INBE_HAS_LIBOQS)
|
||||
#include <oqs/oqs.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if !defined(FLINT_HAS_LIBOQS)
|
||||
#error "Inbe sync account builds require FLINT_HAS_LIBOQS; build liboqs for this target instead of disabling sync crypto."
|
||||
#endif
|
||||
|
||||
#define SYNC_PUBLIC_ID_KEY "sync_public_id"
|
||||
#define SYNC_PUBLIC_KEY_KEY "sync_public_key"
|
||||
#define SYNC_PRIVATE_KEY_KEY "sync_private_key"
|
||||
|
||||
typedef struct Sha256Ctx {
|
||||
uint32_t state[8];
|
||||
uint64_t bit_len;
|
||||
uint8_t data[64];
|
||||
size_t data_len;
|
||||
} Sha256Ctx;
|
||||
|
||||
static int account_has_values(const InbeSyncAccount *account);
|
||||
|
||||
static const uint32_t sha256_k[64] = {
|
||||
0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U,
|
||||
0x923f82a4U, 0xab1c5ed5U, 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U,
|
||||
0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U, 0xe49b69c1U, 0xefbe4786U,
|
||||
0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU,
|
||||
0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, 0xc6e00bf3U, 0xd5a79147U,
|
||||
0x06ca6351U, 0x14292967U, 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U,
|
||||
0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, 0xa2bfe8a1U, 0xa81a664bU,
|
||||
0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U,
|
||||
0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU,
|
||||
0x5b9cca4fU, 0x682e6ff3U, 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U,
|
||||
0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U
|
||||
};
|
||||
|
||||
static uint32_t
|
||||
rotr32(uint32_t value, uint32_t bits)
|
||||
{
|
||||
return (value >> bits) | (value << (32U - bits));
|
||||
}
|
||||
|
||||
static void
|
||||
sha256_transform(Sha256Ctx *ctx, const uint8_t data[64])
|
||||
{
|
||||
uint32_t m[64];
|
||||
uint32_t a, b, c, d, e, f, g, h;
|
||||
|
||||
for(int i = 0; i < 16; i++) {
|
||||
m[i] = ((uint32_t)data[i * 4] << 24) |
|
||||
((uint32_t)data[i * 4 + 1] << 16) |
|
||||
((uint32_t)data[i * 4 + 2] << 8) |
|
||||
(uint32_t)data[i * 4 + 3];
|
||||
}
|
||||
for(int i = 16; i < 64; i++) {
|
||||
uint32_t s0 = rotr32(m[i - 15], 7) ^ rotr32(m[i - 15], 18) ^ (m[i - 15] >> 3);
|
||||
uint32_t s1 = rotr32(m[i - 2], 17) ^ rotr32(m[i - 2], 19) ^ (m[i - 2] >> 10);
|
||||
m[i] = m[i - 16] + s0 + m[i - 7] + s1;
|
||||
}
|
||||
|
||||
a = ctx->state[0];
|
||||
b = ctx->state[1];
|
||||
c = ctx->state[2];
|
||||
d = ctx->state[3];
|
||||
e = ctx->state[4];
|
||||
f = ctx->state[5];
|
||||
g = ctx->state[6];
|
||||
h = ctx->state[7];
|
||||
|
||||
for(int i = 0; i < 64; i++) {
|
||||
uint32_t s1 = rotr32(e, 6) ^ rotr32(e, 11) ^ rotr32(e, 25);
|
||||
uint32_t ch = (e & f) ^ ((~e) & g);
|
||||
uint32_t temp1 = h + s1 + ch + sha256_k[i] + m[i];
|
||||
uint32_t s0 = rotr32(a, 2) ^ rotr32(a, 13) ^ rotr32(a, 22);
|
||||
uint32_t maj = (a & b) ^ (a & c) ^ (b & c);
|
||||
uint32_t temp2 = s0 + maj;
|
||||
h = g;
|
||||
g = f;
|
||||
f = e;
|
||||
e = d + temp1;
|
||||
d = c;
|
||||
c = b;
|
||||
b = a;
|
||||
a = temp1 + temp2;
|
||||
}
|
||||
|
||||
ctx->state[0] += a;
|
||||
ctx->state[1] += b;
|
||||
ctx->state[2] += c;
|
||||
ctx->state[3] += d;
|
||||
ctx->state[4] += e;
|
||||
ctx->state[5] += f;
|
||||
ctx->state[6] += g;
|
||||
ctx->state[7] += h;
|
||||
}
|
||||
|
||||
static void
|
||||
sha256_init(Sha256Ctx *ctx)
|
||||
{
|
||||
memset(ctx, 0, sizeof(*ctx));
|
||||
ctx->state[0] = 0x6a09e667U;
|
||||
ctx->state[1] = 0xbb67ae85U;
|
||||
ctx->state[2] = 0x3c6ef372U;
|
||||
ctx->state[3] = 0xa54ff53aU;
|
||||
ctx->state[4] = 0x510e527fU;
|
||||
ctx->state[5] = 0x9b05688cU;
|
||||
ctx->state[6] = 0x1f83d9abU;
|
||||
ctx->state[7] = 0x5be0cd19U;
|
||||
}
|
||||
|
||||
static void
|
||||
sha256_update(Sha256Ctx *ctx, const uint8_t *data, size_t len)
|
||||
{
|
||||
for(size_t i = 0; i < len; i++) {
|
||||
ctx->data[ctx->data_len++] = data[i];
|
||||
if(ctx->data_len == 64) {
|
||||
sha256_transform(ctx, ctx->data);
|
||||
ctx->bit_len += 512;
|
||||
ctx->data_len = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sha256_final(Sha256Ctx *ctx, uint8_t hash[32])
|
||||
{
|
||||
size_t i = ctx->data_len;
|
||||
|
||||
ctx->data[i++] = 0x80;
|
||||
if(i > 56) {
|
||||
while(i < 64)
|
||||
ctx->data[i++] = 0;
|
||||
sha256_transform(ctx, ctx->data);
|
||||
i = 0;
|
||||
}
|
||||
while(i < 56)
|
||||
ctx->data[i++] = 0;
|
||||
|
||||
ctx->bit_len += ctx->data_len * 8;
|
||||
for(int j = 0; j < 8; j++)
|
||||
ctx->data[63 - j] = (uint8_t)(ctx->bit_len >> (j * 8));
|
||||
sha256_transform(ctx, ctx->data);
|
||||
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(int j = 0; j < 8; j++)
|
||||
hash[j * 4 + i] = (uint8_t)(ctx->state[j] >> (24 - i * 8));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bytes_to_hex(const uint8_t *bytes, size_t len, char *out, size_t out_size)
|
||||
{
|
||||
static const char hex[] = "0123456789abcdef";
|
||||
size_t needed = len * 2 + 1;
|
||||
|
||||
if(out == NULL || out_size < needed)
|
||||
return;
|
||||
for(size_t i = 0; i < len; i++) {
|
||||
out[i * 2] = hex[bytes[i] >> 4];
|
||||
out[i * 2 + 1] = hex[bytes[i] & 0x0f];
|
||||
}
|
||||
out[len * 2] = '\0';
|
||||
}
|
||||
|
||||
static int
|
||||
hex_to_bytes(const char *hex, uint8_t *out, size_t out_len)
|
||||
account_has_values(const InbeSyncAccount *account)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if(hex == NULL || out == NULL)
|
||||
return 0;
|
||||
len = strlen(hex);
|
||||
if(len != out_len * 2)
|
||||
return 0;
|
||||
for(size_t i = 0; i < out_len; i++) {
|
||||
unsigned int value;
|
||||
if(sscanf(hex + i * 2, "%2x", &value) != 1)
|
||||
return 0;
|
||||
out[i] = (uint8_t)value;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
hex_string_valid(const char *hex, size_t expected_len)
|
||||
{
|
||||
if(hex == NULL || strlen(hex) != expected_len)
|
||||
return 0;
|
||||
for(size_t i = 0; i < expected_len; i++) {
|
||||
char c = hex[i];
|
||||
if(!((c >= '0' && c <= '9') ||
|
||||
(c >= 'a' && c <= 'f') ||
|
||||
(c >= 'A' && c <= 'F')))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return flint_lyra_account_has_values(account);
|
||||
}
|
||||
|
||||
static void
|
||||
copy_key_value(char *out, size_t out_size, const char *value, size_t value_len)
|
||||
sync_account_save_and_reset(const InbeSyncAccount *account)
|
||||
{
|
||||
if(out == NULL || out_size == 0)
|
||||
return;
|
||||
if(value_len >= out_size)
|
||||
value_len = out_size - 1;
|
||||
memcpy(out, value, value_len);
|
||||
out[value_len] = '\0';
|
||||
}
|
||||
|
||||
static void
|
||||
parse_sync_key_line(InbeSyncAccount *account, const char *line, size_t line_len)
|
||||
{
|
||||
const char *value;
|
||||
size_t value_len;
|
||||
|
||||
if(account == NULL || line == NULL)
|
||||
return;
|
||||
if(line_len > 0 && line[line_len - 1] == '\r')
|
||||
line_len--;
|
||||
|
||||
if(line_len > 10 && strncmp(line, "public_id=", 10) == 0) {
|
||||
value = line + 10;
|
||||
value_len = line_len - 10;
|
||||
copy_key_value(account->public_id, sizeof(account->public_id), value, value_len);
|
||||
} else if(line_len > 11 && strncmp(line, "public_key=", 11) == 0) {
|
||||
value = line + 11;
|
||||
value_len = line_len - 11;
|
||||
copy_key_value(account->public_key_hex, sizeof(account->public_key_hex), value, value_len);
|
||||
} else if(line_len > 12 && strncmp(line, "private_key=", 12) == 0) {
|
||||
value = line + 12;
|
||||
value_len = line_len - 12;
|
||||
copy_key_value(account->private_key_hex, sizeof(account->private_key_hex), value, value_len);
|
||||
} else if(line_len > 11 && strncmp(line, "secret_key=", 11) == 0) {
|
||||
value = line + 11;
|
||||
value_len = line_len - 11;
|
||||
copy_key_value(account->private_key_hex, sizeof(account->private_key_hex), value, value_len);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
extract_json_string_field(const char *json, const char *field, char *out, size_t out_size)
|
||||
{
|
||||
char key[64];
|
||||
const char *p;
|
||||
char *dst;
|
||||
char *end;
|
||||
|
||||
if(json == NULL || field == NULL || out == NULL || out_size == 0)
|
||||
return 0;
|
||||
out[0] = '\0';
|
||||
if(strlen(field) + 3 > sizeof(key))
|
||||
return 0;
|
||||
|
||||
snprintf(key, sizeof(key), "\"%s\"", field);
|
||||
p = strstr(json, key);
|
||||
if(p == NULL)
|
||||
return 0;
|
||||
p += strlen(key);
|
||||
while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
|
||||
p++;
|
||||
if(*p != ':')
|
||||
return 0;
|
||||
p++;
|
||||
while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
|
||||
p++;
|
||||
if(*p != '"')
|
||||
return 0;
|
||||
p++;
|
||||
|
||||
dst = out;
|
||||
end = out + out_size - 1;
|
||||
while(*p != '\0' && *p != '"' && dst < end) {
|
||||
if(*p == '\\') {
|
||||
p++;
|
||||
if(*p == 'n')
|
||||
*dst++ = '\n';
|
||||
else if(*p == 'r')
|
||||
*dst++ = '\r';
|
||||
else if(*p == 't')
|
||||
*dst++ = '\t';
|
||||
else if(*p == '\\' || *p == '"')
|
||||
*dst++ = *p;
|
||||
else
|
||||
return 0;
|
||||
if(*p != '\0')
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
*dst++ = *p++;
|
||||
}
|
||||
*dst = '\0';
|
||||
return *p == '"';
|
||||
}
|
||||
|
||||
static int
|
||||
parse_sync_key_text(const char *text, InbeSyncAccount *account)
|
||||
{
|
||||
const char *line;
|
||||
const char *next;
|
||||
char exported_key[8200];
|
||||
|
||||
if(text == NULL || account == NULL)
|
||||
return 0;
|
||||
|
||||
if(extract_json_string_field(text, "exported_key", exported_key, sizeof(exported_key)))
|
||||
text = exported_key;
|
||||
|
||||
memset(account, 0, sizeof(*account));
|
||||
|
||||
line = text;
|
||||
if((unsigned char)line[0] == 0xef &&
|
||||
(unsigned char)line[1] == 0xbb &&
|
||||
(unsigned char)line[2] == 0xbf)
|
||||
line += 3;
|
||||
while(*line != '\0') {
|
||||
next = strchr(line, '\n');
|
||||
if(next == NULL) {
|
||||
parse_sync_key_line(account, line, strlen(line));
|
||||
break;
|
||||
}
|
||||
parse_sync_key_line(account, line, (size_t)(next - line));
|
||||
line = next + 1;
|
||||
}
|
||||
return account->public_key_hex[0] != '\0' &&
|
||||
account->private_key_hex[0] != '\0';
|
||||
}
|
||||
|
||||
static int
|
||||
sync_account_validate_import(InbeSyncAccount *account)
|
||||
{
|
||||
uint8_t public_key[1312];
|
||||
char expected_public_id[65];
|
||||
|
||||
if(account == NULL)
|
||||
return 0;
|
||||
if(!hex_string_valid(account->public_key_hex, 2624) ||
|
||||
!hex_string_valid(account->private_key_hex, 5120))
|
||||
return 0;
|
||||
if(!hex_to_bytes(account->public_key_hex, public_key, sizeof(public_key)))
|
||||
return 0;
|
||||
sync_sha256_hex(public_key, sizeof(public_key), expected_public_id);
|
||||
if(account->public_id[0] == '\0') {
|
||||
snprintf(account->public_id, sizeof(account->public_id), "%s", expected_public_id);
|
||||
return 1;
|
||||
}
|
||||
if(!hex_string_valid(account->public_id, 64))
|
||||
return 0;
|
||||
return strcmp(account->public_id, expected_public_id) == 0;
|
||||
storage_settings_begin_write();
|
||||
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, account != NULL ? account->public_id : "");
|
||||
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, account != NULL ? account->public_key_hex : "");
|
||||
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, account != NULL ? account->private_key_hex : "");
|
||||
sync_client_clear_auth_token();
|
||||
storage_reset_sync_state();
|
||||
storage_settings_end_write();
|
||||
}
|
||||
|
||||
void
|
||||
sync_sha256_hex(const uint8_t *data, size_t len, char out_hex[65])
|
||||
{
|
||||
uint8_t digest[32];
|
||||
Sha256Ctx sha;
|
||||
|
||||
if(out_hex == NULL)
|
||||
return;
|
||||
out_hex[0] = '\0';
|
||||
if(data == NULL && len > 0)
|
||||
return;
|
||||
sha256_init(&sha);
|
||||
sha256_update(&sha, data, len);
|
||||
sha256_final(&sha, digest);
|
||||
bytes_to_hex(digest, sizeof(digest), out_hex, 65);
|
||||
}
|
||||
|
||||
static int
|
||||
account_has_values(const InbeSyncAccount *account)
|
||||
{
|
||||
return account != NULL &&
|
||||
account->public_id[0] != '\0' &&
|
||||
account->public_key_hex[0] != '\0' &&
|
||||
account->private_key_hex[0] != '\0';
|
||||
flint_lyra_sha256_hex(data, len, out_hex);
|
||||
}
|
||||
|
||||
int
|
||||
sync_account_available(void)
|
||||
{
|
||||
#if defined(INBE_HAS_LIBOQS)
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
return flint_lyra_account_available();
|
||||
}
|
||||
|
||||
int
|
||||
@@ -426,93 +81,31 @@ sync_account_load(InbeSyncAccount *account)
|
||||
int
|
||||
sync_account_create(InbeSyncAccount *account)
|
||||
{
|
||||
#if defined(INBE_HAS_LIBOQS)
|
||||
OQS_SIG *sig;
|
||||
uint8_t public_key[1312];
|
||||
uint8_t private_key[2560];
|
||||
uint8_t digest[32];
|
||||
Sha256Ctx sha;
|
||||
InbeSyncAccount generated;
|
||||
|
||||
data_init();
|
||||
if(account == NULL)
|
||||
return 0;
|
||||
memset(&generated, 0, sizeof(generated));
|
||||
|
||||
sig = OQS_SIG_new(OQS_SIG_alg_ml_dsa_44);
|
||||
if(sig == NULL ||
|
||||
sig->length_public_key != sizeof(public_key) ||
|
||||
sig->length_secret_key != sizeof(private_key)) {
|
||||
if(sig != NULL)
|
||||
OQS_SIG_free(sig);
|
||||
if(!flint_lyra_account_create(&generated))
|
||||
return 0;
|
||||
}
|
||||
if(OQS_SIG_keypair(sig, public_key, private_key) != OQS_SUCCESS) {
|
||||
OQS_SIG_free(sig);
|
||||
return 0;
|
||||
}
|
||||
OQS_SIG_free(sig);
|
||||
|
||||
sha256_init(&sha);
|
||||
sha256_update(&sha, public_key, sizeof(public_key));
|
||||
sha256_final(&sha, digest);
|
||||
|
||||
bytes_to_hex(digest, sizeof(digest), generated.public_id, sizeof(generated.public_id));
|
||||
bytes_to_hex(public_key, sizeof(public_key), generated.public_key_hex,
|
||||
sizeof(generated.public_key_hex));
|
||||
bytes_to_hex(private_key, sizeof(private_key), generated.private_key_hex,
|
||||
sizeof(generated.private_key_hex));
|
||||
|
||||
storage_settings_begin_write();
|
||||
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, generated.public_id);
|
||||
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, generated.public_key_hex);
|
||||
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, generated.private_key_hex);
|
||||
sync_client_clear_auth_token();
|
||||
storage_reset_sync_state();
|
||||
storage_settings_end_write();
|
||||
|
||||
sync_account_save_and_reset(&generated);
|
||||
*account = generated;
|
||||
return 1;
|
||||
#else
|
||||
(void)account;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
sync_account_import_private_key(InbeSyncAccount *account, const char *filename)
|
||||
{
|
||||
char *body;
|
||||
InbeSyncAccount imported;
|
||||
|
||||
data_init();
|
||||
if(account == NULL || filename == NULL || filename[0] == '\0')
|
||||
return 0;
|
||||
|
||||
body = LoadFileText(filename);
|
||||
if(body == NULL)
|
||||
return 0;
|
||||
|
||||
if(!parse_sync_key_text(body, &imported)) {
|
||||
TraceLog(LOG_WARNING, "SYNC: Private key import failed: missing public_key/private_key fields");
|
||||
UnloadFileText(body);
|
||||
if(!flint_lyra_account_import_file(filename, &imported)) {
|
||||
TraceLog(LOG_WARNING, "SYNC: Private key import failed: invalid key file");
|
||||
return 0;
|
||||
}
|
||||
if(!sync_account_validate_import(&imported)) {
|
||||
TraceLog(LOG_WARNING, "SYNC: Private key import failed: invalid key values");
|
||||
UnloadFileText(body);
|
||||
return 0;
|
||||
}
|
||||
UnloadFileText(body);
|
||||
|
||||
storage_settings_begin_write();
|
||||
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, imported.public_id);
|
||||
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, imported.public_key_hex);
|
||||
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, imported.private_key_hex);
|
||||
sync_client_clear_auth_token();
|
||||
storage_reset_sync_state();
|
||||
storage_settings_end_write();
|
||||
|
||||
sync_account_save_and_reset(&imported);
|
||||
*account = imported;
|
||||
return 1;
|
||||
}
|
||||
@@ -521,30 +114,21 @@ int
|
||||
sync_account_clear(void)
|
||||
{
|
||||
data_init();
|
||||
storage_settings_begin_write();
|
||||
storage_set_setting_text(SYNC_PUBLIC_ID_KEY, "");
|
||||
storage_set_setting_text(SYNC_PUBLIC_KEY_KEY, "");
|
||||
storage_set_setting_text(SYNC_PRIVATE_KEY_KEY, "");
|
||||
sync_client_clear_auth_token();
|
||||
storage_reset_sync_state();
|
||||
storage_settings_end_write();
|
||||
sync_account_save_and_reset(NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
sync_account_export_private_key(const InbeSyncAccount *account, const char *filename)
|
||||
{
|
||||
char body[8200];
|
||||
char body[FLINT_LYRA_ACCOUNT_EXPORT_TEXT_SIZE];
|
||||
int len;
|
||||
|
||||
if(!account_has_values(account) || filename == NULL || filename[0] == '\0')
|
||||
return 0;
|
||||
|
||||
len = snprintf(body, sizeof(body),
|
||||
"inbe-sync-key-v1\nalgorithm=ML-DSA-44\npublic_id=%s\npublic_key=%s\nprivate_key=%s\n",
|
||||
account->public_id, account->public_key_hex, account->private_key_hex);
|
||||
if(len <= 0 || (size_t)len >= sizeof(body))
|
||||
if(!flint_lyra_account_export_text(account, body, sizeof(body)))
|
||||
return 0;
|
||||
len = (int)strlen(body);
|
||||
|
||||
#if ANDROID_BUILD
|
||||
return android_share_bytes((const unsigned char *)body, (size_t)len, filename,
|
||||
@@ -559,7 +143,7 @@ sync_account_export_private_key(const InbeSyncAccount *account, const char *file
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename || "inbe-sync.key";
|
||||
a.download = filename || "lyra-account.key";
|
||||
a.style.display = "none";
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
@@ -580,48 +164,12 @@ sync_account_export_private_key(const InbeSyncAccount *account, const char *file
|
||||
|
||||
int
|
||||
sync_account_sign_hex(const uint8_t *message, size_t message_len,
|
||||
char *out_signature_hex, size_t out_size)
|
||||
char *out_signature_hex, size_t out_size)
|
||||
{
|
||||
#if defined(INBE_HAS_LIBOQS)
|
||||
InbeSyncAccount account;
|
||||
OQS_SIG *sig;
|
||||
uint8_t private_key[2560];
|
||||
uint8_t signature[2420];
|
||||
size_t signature_len = 0;
|
||||
|
||||
if(out_signature_hex == NULL || out_size < sizeof(signature) * 2 + 1 ||
|
||||
(message == NULL && message_len > 0))
|
||||
return 0;
|
||||
out_signature_hex[0] = '\0';
|
||||
if(!sync_account_load(&account))
|
||||
return 0;
|
||||
if(!hex_to_bytes(account.private_key_hex, private_key, sizeof(private_key)))
|
||||
return 0;
|
||||
|
||||
sig = OQS_SIG_new(OQS_SIG_alg_ml_dsa_44);
|
||||
if(sig == NULL ||
|
||||
sig->length_secret_key != sizeof(private_key) ||
|
||||
sig->length_signature != sizeof(signature)) {
|
||||
if(sig != NULL)
|
||||
OQS_SIG_free(sig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(OQS_SIG_sign(sig, signature, &signature_len, message, message_len,
|
||||
private_key) != OQS_SUCCESS ||
|
||||
signature_len != sizeof(signature)) {
|
||||
OQS_SIG_free(sig);
|
||||
return 0;
|
||||
}
|
||||
OQS_SIG_free(sig);
|
||||
|
||||
bytes_to_hex(signature, sizeof(signature), out_signature_hex, out_size);
|
||||
return out_signature_hex[0] != '\0';
|
||||
#else
|
||||
(void)message;
|
||||
(void)message_len;
|
||||
(void)out_signature_hex;
|
||||
(void)out_size;
|
||||
return 0;
|
||||
#endif
|
||||
return flint_lyra_account_sign_hex(&account, message, message_len, out_signature_hex,
|
||||
out_size);
|
||||
}
|
||||
@@ -4,17 +4,15 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "flint_lyra_account.h"
|
||||
|
||||
enum {
|
||||
INBE_SYNC_PUBLIC_ID_HEX_SIZE = 65,
|
||||
INBE_SYNC_PUBLIC_KEY_HEX_SIZE = 2625,
|
||||
INBE_SYNC_PRIVATE_KEY_HEX_SIZE = 5121
|
||||
INBE_SYNC_PUBLIC_ID_HEX_SIZE = FLINT_LYRA_PUBLIC_ID_HEX_SIZE,
|
||||
INBE_SYNC_PUBLIC_KEY_HEX_SIZE = FLINT_LYRA_PUBLIC_KEY_HEX_SIZE,
|
||||
INBE_SYNC_PRIVATE_KEY_HEX_SIZE = FLINT_LYRA_PRIVATE_KEY_HEX_SIZE
|
||||
};
|
||||
|
||||
typedef struct InbeSyncAccount {
|
||||
char public_id[INBE_SYNC_PUBLIC_ID_HEX_SIZE];
|
||||
char public_key_hex[INBE_SYNC_PUBLIC_KEY_HEX_SIZE];
|
||||
char private_key_hex[INBE_SYNC_PRIVATE_KEY_HEX_SIZE];
|
||||
} InbeSyncAccount;
|
||||
typedef FlintLyraAccount InbeSyncAccount;
|
||||
|
||||
int sync_account_available(void);
|
||||
int sync_account_load(InbeSyncAccount *account);
|
||||
|
||||
@@ -1656,7 +1656,6 @@ sync_client_delete_account(const char *base_url)
|
||||
SyncBuffer response = {0};
|
||||
const char *headers[1] = {"Content-Type: application/json"};
|
||||
long status = 0;
|
||||
int len;
|
||||
int ok;
|
||||
|
||||
if(!sync_client_url_valid(base_url))
|
||||
@@ -1664,10 +1663,7 @@ sync_client_delete_account(const char *base_url)
|
||||
if(!sync_account_load(&account))
|
||||
return INBE_SYNC_CLIENT_NO_ACCOUNT;
|
||||
|
||||
len = snprintf(exported_key, sizeof(exported_key),
|
||||
"inbe-sync-key-v1\nalgorithm=ML-DSA-44\npublic_id=%s\npublic_key=%s\nprivate_key=%s\n",
|
||||
account.public_id, account.public_key_hex, account.private_key_hex);
|
||||
if(len <= 0 || (size_t)len >= sizeof(exported_key))
|
||||
if(!flint_lyra_account_export_text(&account, exported_key, sizeof(exported_key)))
|
||||
return INBE_SYNC_CLIENT_PAYLOAD_FAILED;
|
||||
|
||||
if(!sync_buffer_append(&body, "{\"user_id_hash\":", strlen("{\"user_id_hash\":")) ||
|
||||
|
||||
@@ -214,6 +214,29 @@ read_raw_habit_day_count(const char *root, const char *habit_id, int local_date)
|
||||
return count;
|
||||
}
|
||||
|
||||
static int
|
||||
read_raw_count_query(const char *root, const char *sql)
|
||||
{
|
||||
char db_path[512];
|
||||
sqlite3 *db = NULL;
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
int count = -1;
|
||||
|
||||
make_path(db_path, sizeof(db_path), root, "inbe.db");
|
||||
check_true("open raw count query db", sqlite3_open(db_path, &db) == SQLITE_OK);
|
||||
if(db == NULL)
|
||||
return count;
|
||||
if(sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) == SQLITE_OK) {
|
||||
if(sqlite3_step(stmt) == SQLITE_ROW)
|
||||
count = sqlite3_column_int(stmt, 0);
|
||||
} else {
|
||||
check_true("prepare raw count query", 0);
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
sqlite3_close(db);
|
||||
return count;
|
||||
}
|
||||
|
||||
static int
|
||||
read_raw_session_round_seconds(const char *root, const char *session_id, int round_index)
|
||||
{
|
||||
@@ -494,6 +517,68 @@ test_sync_apply_preserves_counter_counts(void)
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_sync_apply_clears_acknowledged_outbox_before_equal_timestamp_merge(void)
|
||||
{
|
||||
char root[512];
|
||||
char db_path[512];
|
||||
sqlite3 *db = NULL;
|
||||
char *payload = NULL;
|
||||
const char *remote_response =
|
||||
"{\"server_version\":99,\"server_clock\":99,\"changes\":{\"habits\":[],"
|
||||
"\"habit_days\":[{\"habit_id\":\"push-ups\",\"local_date\":20260628,"
|
||||
"\"completed\":true,\"count\":1,\"updated_at\":\"2026-06-28T12:00:00Z\"}],"
|
||||
"\"sessions\":[],\"meditation_logs\":[]}}";
|
||||
|
||||
make_clean_root(root, sizeof(root), "sync-outbox-equal-remote");
|
||||
check_true("init sync outbox equal db", storage_init(root));
|
||||
storage_close();
|
||||
|
||||
make_path(db_path, sizeof(db_path), root, "inbe.db");
|
||||
check_true("open sync outbox equal raw db", sqlite3_open(db_path, &db) == SQLITE_OK);
|
||||
if(db != NULL) {
|
||||
check_true(
|
||||
"insert sync outbox equal state",
|
||||
sqlite3_exec(db,
|
||||
"INSERT INTO "
|
||||
"habits(id,user_id,name,color_r,color_g,color_b,sync_mode,sync_activity,"
|
||||
"counter_enabled,sort_order,deleted_at,updated_at) "
|
||||
"VALUES('push-ups',(SELECT id FROM users LIMIT 1),'Push Ups',255,255,"
|
||||
"255,0,0,0,0,0,1782648000);"
|
||||
"INSERT INTO habit_days(habit_id,local_date,completed,count,updated_at) "
|
||||
"VALUES('push-ups',20260628,0,0,1782648000);"
|
||||
"INSERT INTO sync_outbox(entity_type,entity_id,local_date,queued_at) "
|
||||
"VALUES('habit_day','push-ups',20260628,1782648000);",
|
||||
NULL, NULL, NULL) == SQLITE_OK);
|
||||
sqlite3_close(db);
|
||||
}
|
||||
|
||||
check_true("reopen sync outbox equal db", storage_init(root));
|
||||
storage_close();
|
||||
check_int("queued outbox before payload",
|
||||
read_raw_count_query(root, "SELECT COUNT(*) FROM sync_outbox"), 1);
|
||||
|
||||
check_true("reopen sync outbox equal db for payload", storage_init(root));
|
||||
payload = storage_build_sync_payload_json(
|
||||
"55035d07339af4ea8e198413928073c2053c8d294ffd58bfa0c3094cf2ca496d", NULL);
|
||||
check_true("payload includes zero count habit day state",
|
||||
payload != NULL && strstr(payload, "\"habit_id\":\"push-ups\"") != NULL &&
|
||||
strstr(payload, "\"completed\":false") != NULL &&
|
||||
strstr(payload, "\"count\":0") != NULL &&
|
||||
strstr(payload, "\"op_type\":\"upsert\"") != NULL);
|
||||
storage_free_sync_payload_json(payload);
|
||||
check_true("apply equal timestamp remote after ack",
|
||||
storage_apply_sync_response_json(remote_response));
|
||||
storage_close();
|
||||
|
||||
check_int("equal timestamp remote applied after ack",
|
||||
read_raw_habit_day_count(root, "push-ups", 20260628), 1);
|
||||
check_int("acknowledged outbox cleared",
|
||||
read_raw_count_query(root, "SELECT COUNT(*) FROM sync_outbox"), 0);
|
||||
|
||||
remove_tree(root);
|
||||
}
|
||||
|
||||
static void
|
||||
test_sync_apply_sessions_last_write_wins(void)
|
||||
{
|
||||
@@ -1914,6 +1999,7 @@ main(void)
|
||||
test_sync_payload_includes_queued_current_edits();
|
||||
test_sync_outbox_preserves_edits_after_snapshot();
|
||||
test_sync_apply_preserves_counter_counts();
|
||||
test_sync_apply_clears_acknowledged_outbox_before_equal_timestamp_merge();
|
||||
test_sync_apply_sessions_last_write_wins();
|
||||
test_sync_apply_updates_habit_counter_enabled();
|
||||
test_stale_habit_save_keeps_synced_remote_habits();
|
||||
|
||||
@@ -251,6 +251,8 @@ test_import_export_clear(void)
|
||||
exported = LoadFileText(export_path);
|
||||
check_true("read exported key", exported != NULL);
|
||||
if(exported != NULL) {
|
||||
check_true("export uses generic key header",
|
||||
strstr(exported, "lyra-account-key-v1\n") == exported);
|
||||
check_true("export includes public key", strstr(exported, "\npublic_key=") != NULL);
|
||||
UnloadFileText(exported);
|
||||
}
|
||||
|
||||
Vendored
-1
Submodule vendor/curl deleted from bb837dda23.
Vendored
+1
-1
Submodule vendor/flint updated: 382749a229...fc151eebd2.
Vendored
-1
Submodule vendor/liboqs deleted from d95fc734f5.
+4
-4
@@ -3,8 +3,8 @@
|
||||
IDI_APP_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,6,2,0
|
||||
PRODUCTVERSION 1,6,2,0
|
||||
FILEVERSION 1,6,6,0
|
||||
PRODUCTVERSION 1,6,6,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -21,11 +21,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "1.6.2"
|
||||
VALUE "FileVersion", "1.6.6"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "1.6.2"
|
||||
VALUE "ProductVersion", "1.6.6"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Reference in new issue
Block a user