Skip to content

Commit

Permalink
Merge pull request #101 from LiamMorrow/fix-cycle-count
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamMorrow authored Dec 24, 2023
2 parents 4032f53 + c684515 commit dc16f1c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/android-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 7 additions & 3 deletions LiftLog.App/LiftLog.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

<PropertyGroup>
<TargetFrameworks>net8.0-android;</TargetFrameworks>
<TargetFramework>net8.0-android</TargetFramework>

<!--This wild business is so that when I open vscode it doesn't try and open the project as an android or ios one, which causes weird locks when building from the cli-->
<TargetFramework Condition="'$(BuildFor)' == 'ios'">net8.0-ios</TargetFramework>
<TargetFramework Condition="'$(BuildFor)' == 'android'">net8.0-android</TargetFramework>
<TargetFramework Condition="'$(BuildFor)' == ''">net8.0</TargetFramework>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net8.0-ios;</TargetFrameworks>

<OutputType>Exe</OutputType>
Expand All @@ -22,8 +26,8 @@
<ApplicationIdGuid>71733E37-6FDD-4EEF-A0BF-DE32634D58EC</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.13.0</ApplicationDisplayVersion>
<ApplicationVersion>43</ApplicationVersion>
<ApplicationDisplayVersion>1.13.1</ApplicationDisplayVersion>
<ApplicationVersion>44</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
Expand Down
2 changes: 1 addition & 1 deletion LiftLog.App/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 5 additions & 6 deletions LiftLog.Ui/Shared/Presentation/PotentialSetCounter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LiftLog.Ui/Shared/Smart/Tips/HoldingRepCounterTip.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CycleRepCount=@(() => CycleRepCountForSet())
ClearRepCount=@(() => ClearRepCountForSet())
UpdateWeight=@((_)=>{})
ToStartNext=false />
ToStartNext=@(set.Set is null) />
</div>
@code{
private PotentialSet set = new PotentialSet(new RecordedSet(8, TimeOnly.MinValue), 10m);
Expand Down
10 changes: 8 additions & 2 deletions LiftLog.Ui/Shared/Smart/Tips/PreviousButtonTip.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<div class="flex gap-2">
<span>If you <span class="font-bold text-primary">hold</span> the <span class="font-bold text-primary">Previous</span> 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.</span>
<span>If you <span class="font-bold text-primary">hold</span> the <span class="font-bold text-primary">Previous</span> 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!</span>
<div>
<IconButton Type="IconButtonType.Outlined" Icon="history"/>
<IconButton Type="IconButtonType.FilledTonal" Icon="history" OnStartHold=@(() => text = "Well done!") OnEndHold=@(()=>text = "")/>
</div>
</div>
<div class="font-bold text-primary">
@text
</div>
@code {
string text = "";
}

0 comments on commit dc16f1c

Please sign in to comment.