Commit Graph

59 Commits

Author SHA1 Message Date
Jonas Acker
049485e4a9 Android Gradle Plugin 9.1.1, the minimum the current Flutter accepts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 14:41:33 +01:00
Jonas Acker
5cede7cffc Native launch screen: the brand disc on the app's background, light and dark
flutter_native_splash generates iOS (with a dark variant) and Android
(pre-12 and the 12+ splash API) from flutter_native_splash.yaml: BkTheme's
background (#F2F2F7 / #101318) with BkBrandMark's disc at 128 dp/pt in the
centre, rendered from the widget itself at 4x. iOS showed the app icon on
fixed white before.

The Flutter startup splash (LaunchMark) draws the same image at the same
size and place, instead of a bare spinner, so the hand-off doesn't move;
a spinner fades in under it only after 700 ms. On Android and iOS the
first frame is held (at most 300 ms) until that image is decoded, so no
frame goes by without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 12:28:51 +01:00
jonasbark
0db9070ad7 OBC haptic feedback: expose characteristic and play it on phone + controllers (#447)
* Expose OBC haptic feedback characteristic over BLE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Play OBC haptic feedback on the phone and vibrating controllers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Expose OBC haptic characteristic over DirCon too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:19:03 +01:00
Jonas Acker
fe5e96a596 feat(store): Play feature graphic, App Store header and search assets
store_screenshots/scripts/graphics.mjs renders the Play feature graphic and
the App Store product page header (3840x1646) and search results (3840x2560)
stills per language from the app captures, on the app's brand band. They lead
with virtual shifting, then the rider's own controllers, and follow the
stores' rules: copy and focal art in Apple's template safe areas, no prices,
URLs or other platforms; for Play a vibrant ground, no device imagery and the
centre clear of the preview video's play button. The copy lives in
scripts/creative-copy.mjs.

store_screenshots/header-loop is a HyperFrames project for a 10 s seamless
header loop: the design system's drivetrain shifting 12 → 14 → 12 with the
+ / − press, the contours drifting on a closed path. node render-all.mjs
renders one MP4 per language (renders/ is not committed).

The capture settle now waits 2.5 s: Trainer Controls' buttons fade their
own fill slower than the theme and were caught half light, half dark. A
failed capture run retries once; the feature graphic gets its own Play lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:37:02 +02:00
Jonas Acker
86a27050d1 feat(store): the English listing uses the editor decks
scripts/store_screenshots.sh now also copies the store sizes of every deck
into the committed screenshots/store/<locale>/<slot>/, and
prepare_store_screenshots.sh prefers those over the Flutter-drawn boards per
locale and slot: iPhone 6.5" (1284x2778), Mac (2880x1800), Play phone, 10"
and — new — 7" tablets. Locales without a deck (all but en so far) and the
iPad keep the boards. New screenshots-only lanes (iOS, macOS, Play) replace
the images without touching the listing texts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:04:49 +02:00
Jonas Acker
d99a9f9c92 fix(overlay): "Hide overlay" works after the app screen was recreated
- The main isolate listens for the notification's Hide button from app
  start, not from its first show(): the overlay service can outlive the
  screen that opened it, and the tap then went nowhere.
- When Dart doesn't answer (no handler, or it fails), the receiver stops
  the overlay service itself instead of assuming it was handled.
- The setting is switched off before the overlay is closed, so a close
  that fails can't leave it on for the next trainer reconnect; the
  failure goes to recordError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:22:36 +02:00
Jonas Acker
8ea0396597 Add "Hide overlay" to the Android overlay notification
The overlay's notification gets a "Hide overlay" button. It switches
the overlay off the way the Overlay section's switch does - hidden and
persisted, so the next trainer reconnect doesn't bring it back. With
the main engine gone (activity destroyed, process kept alive by the
overlay service) the receiver stops the overlay service itself.

Also only resize the overlay window while it is up. The package starts
the overlay engine with the app, so the card reported its size before
any window existed and every Android launch recorded a
MissingPluginException for resizeOverlay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:48:34 +02:00
Jonas Acker
eb72bc7719 Give the Android overlay notification its own icon, words and tap
flutter_overlay_window 0.5.0 posts the overlay's foreground-service
notification with the launcher icon as small icon (a filled circle in
the status bar), a bare "BikeControl" title, and a tap that opens
nothing. Right after showing the overlay, re-post it under the same
id and channel with ic_notification, "Gear overlay is on / Tap to open
BikeControl" in the rider's language, a tap that opens the app, and
rename its "Foreground Service Channel" to "Gear overlay".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:25:00 +02:00
Jonas Acker
e76dcf9acd fix(android): free network server ports when the app is swiped away
Swiping BikeControl out of recents left the process running: the
keep-alive foreground service was declared stopWithTask="false", and a
process with a foreground service is not killed on task removal. The
activity and its engine were destroyed, but the server sockets of the
dead isolate stayed bound. The next launch got a new engine in the same
process with an empty server registry, so the OpenBikeControl server
walked one port up per relaunch until all five were taken, and the
fixed-port MyWhoosh Link server failed to start at all.

- Stop the foreground service with the task, so swiping the app away
  ends the process like the overlay service already does. Backgrounding
  is unaffected.
- When the engine reports detached, close every network server so the
  ports are released even if the process lives on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:06:02 +02:00
Jonas Acker
cfb007b276 feat(rides): "In Health" opens the Health app / Health Connect's data
A ride already in Health was only a status. Tapping it now opens the
Health app on iOS and Health Connect's data on Android (its settings on
older devices). Neither store links to a single workout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 11:10:23 +02:00
Jonas Acker
df818dbf6f build(android): Gradle 9.3.1, AGP 9.1.0, Kotlin 2.4.0
Gradle 8.14 refuses to run on Java 25. Versions follow Flutter 3.47's
own template; the newDsl / builtInKotlin opt-outs are already set.

- kotlinOptions → kotlin { compilerOptions } in the app module.
- AGP 9 rejects proguard-android.txt: use the -optimize default with
  -dontoptimize, so R8 does exactly what it did before (the overlay's
  reflected OverlayService fields are still kept; checked in the APK).
- flutter_screen_recording 2.0.25 (no newer release) calls jcenter(),
  which Gradle 9 removed: vendored under packages/ with mavenCentral().
- Plugins still compiling against SDK 31 fail AGP 9's AAR metadata
  check: compile every library against 36 (targetSdk unchanged).

Debug and release APKs build on Java 25.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 10:19:06 +02:00
Jonas Acker
f44f55041c feat(rides): ride details and export, Health Connect on Android
- Details page (pushed, centred column): date, clock range and moving time;
  a stat grid with moving and total time, distance (only with a speed
  source), work in kJ with ≈ kcal, Ø/max power, cadence and heart rate,
  gear changes — values a ride never had are left out; power and heart
  rate on one time axis with the pause hatched, the dashed average and a
  hover / press-and-drag scrub; Export; delete in the ⋯ menu with a
  confirm that says what stays in the Health store.
- Export, no Pro: Apple Health / Health Connect (a status once written, no
  second write; the install when Health Connect is missing), share the .fit
  under a readable name, save the .fit (Files, the system picker, a save
  panel), and the rides folder on desktop. A phone gets a sheet, desktop a
  menu.
- Android: a small Health Connect writer over a method channel (session
  with pause segments; power, cadence, speed, heart rate, distance, active
  energy; client record ids from the ride's sync id). Write-only
  permissions, the permission-rationale activity and alias, the provider
  package query; minSdk stays 24 (the writer reports unsupported below 26).
- macOS may write user-selected files (save the .fit).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 21:43:41 +02:00
Jonas Acker
649b700158 fix(build): let a clone without the private submodule build
Three separate things stopped a plain clone from compiling, so the
repository could not be built from source at all (#387).

- prop_public had drifted well behind prop: 143 analyzer errors in lib/.
  Added the missing stub types and members (sensor definition, CSC/CPS
  measurements, mDNS responder + dns_sd advertiser, control-protocol and
  gear-echo surfaces) and corrected two stubs whose declared types were
  wrong. Signatures only - the bodies stay inert.
- android/app/build.gradle.kts loaded the gitignored keystore.properties
  unconditionally, so every Android build failed to configure. It is now
  optional and falls back to the debug key; with the file present the
  release key is used exactly as before.
- lib/gen/ is generated and gitignored, and nothing said so. README now
  documents the build, what the prop stub does and does not do, and which
  tests need the private package.

Verified from a worktree with an empty prop/ and no pubspec_overrides.yaml:
dart analyze lib and prop_public report 0 errors, and both
flutter build apk --debug and --release succeed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 13:57:07 +02:00
Jonas Bark
c7b89a6059 fix(shift-feedback): Android sound follows media volume, vibration via Vibrator service
Two Android reports from the first device test:

Sound was only audible with the ringer on. The audio attributes used
usage=assistanceSonification, which Android routes to STREAM_SYSTEM — muted
in silent/vibrate mode. Now usage=media (STREAM_MUSIC), i.e. it follows the
media volume like the trainer app's own audio.

Vibration never fired. Flutter's HapticFeedback is View.performHapticFeedback,
which obeys the system "touch feedback" setting (off by default on many
devices) and is a no-op unless our window is focused — mid-ride BikeControl
sits behind the trainer app or its overlay. Android now goes through a small
method channel (ShiftHapticsChannel.kt) into the Vibrator service with
predefined effects (heavy click / click / double click, with pre-Q
fallbacks); VIBRATE permission added. The foreground service keeps the
process eligible under Android 12+'s background-vibration rule. iOS keeps
the impact generators.

PlatformShiftHaptics now keys off defaultTargetPlatform so the routing is
unit-tested per platform, and the HomeExtras test covers both the desktop
and phone toggle layouts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 13:42:12 +02:00
Jonas Bark
55eba7ce4d fix(android): keep flutter_overlay_window OverlayService fields under R8
The release build is minified (R8), which renamed/removed the private
OverlayService fields (instance, flutterView, windowManager) that
OverlayActionBridge reaches by reflection to re-top the overlay and toggle
keep-screen-on. Both calls therefore threw NoSuchFieldException at runtime
("No field instance in ...OverlayService"). Add a proguard-rules.pro keep
rule for the service and wire proguardFiles into the release buildType.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-05 09:22:01 +02:00
Jonas Bark
f4814d5dc6 fix(overlay/android): close overlay on app close + keep screen on during ride
Two fixes from support c39e2501 (Android acting as bridge with the gear
overlay on):

- The overlay stayed on screen after the app was swiped away. OverlayService
  is a foreground service that outlives the task, and nothing closed it on
  termination. Add android:stopWithTask="true" so Android stops it on task
  removal; the package's onDestroy already removes the window view.

- The screen auto-locked mid-ride. wakelock_plus only sets FLAG_KEEP_SCREEN_ON
  on BikeControl's activity window, which is inert once that activity is
  backgrounded, i.e. the normal state when the tablet is a bridge and only the
  overlay is on screen. Set the flag on the overlay window itself via the
  OverlayActionBridge reflection path (shared overlayWindow() helper, applied
  on show with the same service-attach retry as the handler install).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-31 09:25:02 +02:00
Jonas Bark
38fbfc9594 fix(overlay/android): re-top the gear overlay when a trainer app connects
The Android overlay is a TYPE_APPLICATION_OVERLAY window added while
BikeControl is in the foreground. When a trainer app (e.g. Rouvy) comes to
the foreground afterwards, the window ends up buried beneath it and stays
hidden — the rider sees the overlay over every other app "but only not with
Rouvy" (support 73367365) — until it is re-added. Disable + re-enable fixes
it because that re-adds the window.

Automate that re-add at the right moment: on the false→true edge of a proxy's
isConnectedListenable ("a trainer app grabbed the virtual trainer"), debounced
so a flapping DirCon reconnect collapses into one re-top, and gated on the
overlay being enabled + showing.

We can't close+show from Dart: the package's showOverlay uses startService,
which Android blocks from the background — and the trainer app being foreground
is exactly the background case. Instead reassertOverlay() reflects into the
already-running OverlayService and re-adds its view in place
(removeViewImmediate + addView), re-entering the top of the overlay z-order
with no service start.

- add TrainerOverlayController.reassert(): real on Android, no-op on
  iOS/desktop/NoOp (they handle fullscreen elevation their own way)
- OverlayReassertScheduler: rising-edge detection + debounce + enabled/showing
  gating (10 unit tests)
- wire it in navigation for every proxy present now or connecting later

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-30 14:15:56 +02:00
Jonas Bark
643ce56ecd build(android): raise the Gradle wrapper to 8.14.3
The Flutter Gradle plugin now refuses to apply below Gradle 8.14.0, so
every Android build failed at plugin resolution.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 12:51:42 +02:00
Jonas Bark
20c33a05c8 feat(deeplink): register bikecontrol:// on iOS + Universal/App Links scaffolding
- iOS: add the bikecontrol custom URL scheme to CFBundleURLTypes (it was only
  registered on Android), so bikecontrol:// opens the app on iOS too.
- iOS: add the associated-domains entitlement (applinks:bikecontrol.app) for
  Universal Links.
- Android: add a verified App Links intent-filter for
  https://bikecontrol.app/app/... (autoVerify) alongside the bikecontrol://
  scheme.

Universal/App Links additionally require the website AASA + assetlinks.json
(separate repo), which need the Apple Team ID and the Play App Signing SHA-256.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 11:28:52 +02:00
Jonas Bark
460be55a66 version++ 2026-06-26 22:00:18 +02:00
Jonas Bark
d1ecbe2cbc feat(6.2): Android screen recording backend (MediaProjection + gallery save) 2026-06-24 16:51:58 +02:00
Jonas Bark
57a530acbc Make metadata download/commit-back robust
- Android download: 'supply init' won't overwrite existing metadata (it printed
  'Metadata already exists ...' and downloaded nothing), so clear the folder
  first to actually re-pull the live Google Play listing.
- Commit-back: rebase onto FETCH_HEAD instead of origin/6.1 (the remote-tracking
  ref doesn't exist after 'git fetch origin 6.1', which failed the iOS job with
  'invalid upstream origin/6.1'), and retry the push so the two parallel jobs
  (disjoint android/ vs ios/ paths) converge.
- Drop the auto app-repo submodule-pointer bump (racy across the two jobs); the
  metadata still lands in prop@6.1. Bump the pointer separately if needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 10:09:42 +02:00
Jonas Bark
e84ba6c44e Fix fastlane path resolution (lanes run from the fastlane/ folder)
The Store Metadata workflow failed on first run: fastlane chdir's into the
fastlane/ folder before executing a lane, so the Fastfiles' project-dir-relative
paths resolved one level deep (e.g. android/fastlane/fastlane/service-account.json,
ios/fastlane/fastlane/asc_api_key.json) and the lanes couldn't find the key files
or metadata.

Anchor every path at the repo root via GITHUB_WORKSPACE (set by Actions; falls
back to two levels up from the Fastfile locally), so json_key, metadata_path,
screenshots_path, the API-key .p8/.json and the download-lane subprocess args are
all absolute and CWD-independent. Drop the now-redundant relative
SUPPLY_JSON_KEY_FILE env.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 09:57:30 +02:00
Jonas Bark
3c1495ff8f Merge origin/6.1 into claude/fastlane-supply-metadata-2cjxs3
Bring the fastlane/store-metadata branch up to date with 6.1. Resolved
.gitignore by keeping both sides' rules; prop fast-forwards to the
store_metadata commit (a descendant of 6.1's prop pin).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 09:21:54 +02:00
Jonas Bark
cea9112031 Move store metadata into the private prop submodule
The localized App Store / Google Play listing text (titles, descriptions,
keywords, ...) was committed under ios/fastlane/metadata and
android/fastlane/metadata in this public repo, exposing the marketing/ASO copy.
Relocate it to the private prop submodule (prop/store_metadata/{ios,android})
and point fastlane at it; the public repo keeps only the lanes/workflow.

- ios/android Fastfiles: METADATA = "../prop/store_metadata/{ios,android}"
  (lanes run from ios//android/, so ../prop is the repo-root submodule).
- prepare_store_screenshots.sh: Android images stage under the prop metadata
  path; iOS screenshots unchanged.
- metadata.yml: checkout the prop submodule (submodules: recursive + PAT_TOKEN);
  on download, commit & push the listing text to OpenBikeControl/prop (6.1) and
  bump the submodule pointer here. PAT_TOKEN needs write access to prop.
- .gitignore / STORE_METADATA.md updated; screenshots stay public in ./screenshots.
- Bumps prop submodule to include the new store_metadata.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 06:56:26 +02:00
Claude
eb37850b2d Upload store screenshots from screenshot_test.dart goldens
Add scripts/prepare_store_screenshots.sh which maps the golden screenshots
produced by test/screenshot_test.dart (./screenshots/<scene>-<device>-<WxH>.png)
into the per-language layout fastlane expects:
- Google Play: phoneScreenshots (android) + tenInchScreenshots (androidTablet)
- App Store: iPhone 6.5" + iPad 12.9" images per locale (device detected by size)

The fastlane upload lanes now include screenshots (skip_upload_screenshots /
skip_screenshots disabled), and the 'Store Metadata' upload workflow runs the
prepare step first. Generated screenshot folders are gitignored so the images
stay sourced from the test output instead of being duplicated per language.

https://claude.ai/code/session_01Q3VrPge5KaXrrogqtbvGLZ
2026-06-15 20:21:43 +00:00
Claude
69025a5a71 Add fastlane for App Store & Play Store metadata per language
Manage localized store listings via fastlane (supply for Google Play,
deliver for the App Store) with one folder per language under
android/fastlane/metadata and ios/fastlane/metadata (en, de, fr, es, it, pl).

The txt files are seeded with the current live store data fetched from the
public Play Store and App Store listing pages. App Store listings are only
localized in English upstream, so the non-English iOS texts are translated
from the live en-US listing.

Adds a manually-triggered 'Store Metadata' GitHub Actions workflow to
download (store -> repo, auto-committed) or upload (repo -> store, texts only)
the metadata for either or both platforms, reusing the existing store secrets.

https://claude.ai/code/session_01Q3VrPge5KaXrrogqtbvGLZ
2026-06-14 17:43:15 +00:00
Jonas Bark
df18e4ff2f advertisement fix 2026-06-10 11:09:35 +02:00
Jonas Bark
9c43a07cb0 fix gear change buttons 2026-05-10 11:10:22 +02:00
Jonas Bark
aea35aa24f android: add FOREGROUND_SERVICE_SPECIAL_USE for trainer overlay (Android 14+)
The flutter_overlay_window package calls startForeground() without a
service type, which crashes on Android 14+ (API 34) when no
foregroundServiceType is declared. Add the FOREGROUND_SERVICE_SPECIAL_USE
permission and declare specialUse type on the OverlayService entry with
a PROPERTY_SPECIAL_USE_FGS_SUBTYPE description for Play Store review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:46:15 +02:00
Jonas Bark
67ee202f41 android: declare SYSTEM_ALERT_WINDOW and overlay service for trainer overlay 2026-05-09 09:09:25 +02:00
Jonas Bark
2bf525c7cb fix potential start issues on Android 2026-03-20 14:23:40 +01:00
Jonas Bark
e1a7aac3e4 sign in with google, apple 2026-02-16 16:26:22 +01:00
Jonas Bark
7fac3390b1 update dependencies 2026-01-19 11:01:42 +01:00
Jonas Bark
5f246023f0 change notification icon 2026-01-16 12:59:39 +01:00
Jonas Bark
6f3142c913 fix detection for hardware buttons when BikeControl is in foreground, change notification icon 2026-01-16 12:38:10 +01:00
Jonas Bark
f389993ea0 implement logic 2025-12-26 18:48:57 +01:00
Jonas Bark
b69d41ecb5 in app purchase implementation on macOS / iOS 2025-12-14 19:32:23 +01:00
copilot-swe-agent[bot]
fd1b82ed8b Rename app from SwiftControl to BikeControl and update GitHub repo references
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2025-11-21 18:07:48 +00:00
jonasbark
c34f5ff4e8 Updated .gitignore 2025-11-09 08:54:17 +01:00
Jonas Bark
9aa902bc22 support HID key events on Android #110 2025-11-04 09:53:52 +01:00
Jonas Bark
990ba76b00 fix already paired gamepad detection 2025-10-31 09:41:34 +01:00
Jonas Bark
fb43ddf024 initial support for gamepads 2025-10-26 10:21:59 +01:00
Jonas Bark
b60e9c42dd missing files 2025-10-16 23:56:04 +02:00
Jonas Bark
b939c36863 new icon, cleanup 2025-10-16 23:46:32 +02:00
Jonas Bark
c498a96ae9 try it on Android #1 2025-10-08 09:18:53 +02:00
Jonas Bark
59cabe6b4b make it work 2025-10-06 21:41:37 +02:00
Jonas Bark
2e18fe6c59 rename Android package name, revert Zwift Click V2 encryption support, add play store assets 2025-09-24 09:12:21 +02:00
Jonas Bark
30bfd99f97 implement in app update for Android 2025-09-22 13:41:50 +02:00
Jonas Bark
d83b9985ea version update check => internet permission is required 2025-03-31 20:58:27 +02:00