From 5c235369a79e5b9756d952c73f79b18718a87301 Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 25 Dec 2023 07:06:16 +1000 Subject: [PATCH 1/5] Fix the clear repcount It had an issue where the callback for clearing would run on a different synch context so updating the state did not cause it to update. Fluxor usually deals with this, but we use it in the tips section now without fluxor --- LiftLog.App/LiftLog.App.csproj | 8 +++++--- LiftLog.App/install.sh | 2 +- .../Shared/Presentation/PotentialSetCounter.razor | 11 +++++------ .../Shared/Smart/Tips/HoldingRepCounterTip.razor | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/LiftLog.App/LiftLog.App.csproj b/LiftLog.App/LiftLog.App.csproj index eef62e70..ba02f953 100644 --- a/LiftLog.App/LiftLog.App.csproj +++ b/LiftLog.App/LiftLog.App.csproj @@ -2,7 +2,9 @@ net8.0-android; - net8.0-android + net8.0-ios + net8.0-android + net8.0 $(TargetFrameworks);net8.0-ios; Exe @@ -22,8 +24,8 @@ 71733E37-6FDD-4EEF-A0BF-DE32634D58EC - 1.13.0 - 43 + 1.13.1 + 44 14.2 24.0 diff --git a/LiftLog.App/install.sh b/LiftLog.App/install.sh index 3c28e6fd..47e7af26 100755 --- a/LiftLog.App/install.sh +++ b/LiftLog.App/install.sh @@ -16,4 +16,4 @@ if [ "$1" == "-c" ]; then dotnet clean -f net8.0-android fi -dotnet build -t:Run -c Debug -f net8.0-android -p:TargetFramework=net8.0-android -p:ExtraDefineConstants=TEST_MODE #-p:AndroidEnableProfiler=true +dotnet build -t:Run -c Debug -f net8.0-android -p:TargetFramework=net8.0-android -p:BuildFor=android -p:ExtraDefineConstants=TEST_MODE #-p:AndroidEnableProfiler=true diff --git a/LiftLog.Ui/Shared/Presentation/PotentialSetCounter.razor b/LiftLog.Ui/Shared/Presentation/PotentialSetCounter.razor index ead048eb..45e7be1b 100644 --- a/LiftLog.Ui/Shared/Presentation/PotentialSetCounter.razor +++ b/LiftLog.Ui/Shared/Presentation/PotentialSetCounter.razor @@ -115,13 +115,12 @@ private string? RepCountToStartClass => ToStartNext ? "" : null; - private void OnPointerDown(PointerEventArgs args){ + private async void OnPointerDown(PointerEventArgs args){ _lastPointerDownTime = DateTime.Now; - Task.Delay(500).ContinueWith(_ => { - if (_lastPointerDownTime is null || _lastPointerDownTime.Value.AddMilliseconds(500) > DateTime.Now) return; - _clearRepCountTime = DateTime.Now; - ClearRepCount(); - }); + await Task.Delay(500); + if (_lastPointerDownTime is null || _lastPointerDownTime.Value.AddMilliseconds(500) > DateTime.Now) return; + _clearRepCountTime = DateTime.Now; + ClearRepCount(); } protected override async Task OnAfterRenderAsync(bool firstRender) diff --git a/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor b/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor index bb5c3e3e..53371561 100644 --- a/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor +++ b/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor @@ -9,7 +9,7 @@ CycleRepCount=@(() => CycleRepCountForSet()) ClearRepCount=@(() => ClearRepCountForSet()) UpdateWeight=@((_)=>{}) - ToStartNext=false /> + ToStartNext=@(set.Set is null) /> @code{ private PotentialSet set = new PotentialSet(new RecordedSet(8, TimeOnly.MinValue), 10m); @@ -33,7 +33,7 @@ private void ClearRepCountForSet() { set = set with { Set = null }; - StateHasChanged(); + InvokeAsync(StateHasChanged); } From f072b28da6623887fcf3f487b6ad2975b093e9ab Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 25 Dec 2023 07:10:39 +1000 Subject: [PATCH 2/5] Remove invoke void --- LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor b/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor index 53371561..bfda6147 100644 --- a/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor +++ b/LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor @@ -33,7 +33,7 @@ private void ClearRepCountForSet() { set = set with { Set = null }; - InvokeAsync(StateHasChanged); + StateHasChanged(); } From 0f8dd28c2486e69babe6166ab0d953a9d11657ca Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 25 Dec 2023 07:20:08 +1000 Subject: [PATCH 3/5] Add interactability to previous button tip --- LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor b/LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor index 9853d394..2f13f33a 100644 --- a/LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor +++ b/LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor @@ -1,6 +1,12 @@
- If you hold the Previous button on an exercise during a session, that exercise will temporarily show how you performed the last time you completed it, along with a graph of your progression. + If you hold the Previous button on an exercise during a session, that exercise will temporarily show how you performed the last time you completed it, along with a graph of your progression. Try it now!
- + text = "Well done!") OnEndHold=@(()=>text = "")/>
+
+ @text +
+@code { + string text = ""; +} From 8d6bd72911afa9909d94ad4aef3c4f462d1f328f Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 25 Dec 2023 07:21:01 +1000 Subject: [PATCH 4/5] Build for android --- .github/workflows/android-build.yml | 2 +- .github/workflows/android-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index ee4dc459..d56d8dd7 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -38,5 +38,5 @@ jobs: run: yarn && yarn build working-directory: ./LiftLog.Ui - name: Build - run: dotnet build -p:TargetFramework=net8.0-android -f net8.0-android + run: dotnet build -p:TargetFramework=net8.0-android -f net8.0-android -p:BuildFor=android working-directory: ./LiftLog.App diff --git a/.github/workflows/android-publish.yml b/.github/workflows/android-publish.yml index a3c00554..9ef79b80 100644 --- a/.github/workflows/android-publish.yml +++ b/.github/workflows/android-publish.yml @@ -43,7 +43,7 @@ jobs: run: yarn && yarn build working-directory: ./LiftLog.Ui - name: Build - run: dotnet publish -p:TargetFramework=net8.0-android -f net8.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=liftlog.keystore -p:AndroidSigningKeyAlias=liftlog -p:AndroidSigningKeyPass=env:KEYSTORE_PASS -p:AndroidSigningStorePass=env:KEYSTORE_PASS + run: dotnet publish -p:TargetFramework=net8.0-android -f net8.0-android -c Release -p:BuildFor=android -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=liftlog.keystore -p:AndroidSigningKeyAlias=liftlog -p:AndroidSigningKeyPass=env:KEYSTORE_PASS -p:AndroidSigningStorePass=env:KEYSTORE_PASS working-directory: ./LiftLog.App env: KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }} From c684515e62e80342c007fef283efa09b36fbc751 Mon Sep 17 00:00:00 2001 From: Li Date: Mon, 25 Dec 2023 07:22:29 +1000 Subject: [PATCH 5/5] Comments --- LiftLog.App/LiftLog.App.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LiftLog.App/LiftLog.App.csproj b/LiftLog.App/LiftLog.App.csproj index ba02f953..9789f16d 100644 --- a/LiftLog.App/LiftLog.App.csproj +++ b/LiftLog.App/LiftLog.App.csproj @@ -2,6 +2,8 @@ net8.0-android; + + net8.0-ios net8.0-android net8.0