Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Fix some rpe bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitSuda committed Nov 12, 2022
1 parent 2b48121 commit 637f0ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ fun LazyListScope.workoutExerciseItemAlt(
val revisedSetsTexts = getRevisedSetNumbers()

items(items = sortedEntries, key = {
"${it.entryId}_${it.rpe}"
// "${it.entryId}_${it.rpe}"
// "${it.entryId}_${it.setNumber}"
// it.entryId
it.entryId
}) { entry ->
SetItem(
useReboundKeyboard = useReboundKeyboard,
Expand Down Expand Up @@ -339,7 +339,7 @@ fun LazyListScope.workoutExerciseItemAlt(
}
}

@OptIn(ExperimentalMaterialApi::class, ExperimentalFoundationApi::class)
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun LazyItemScope.SetItem(
exercise: Exercise,
Expand All @@ -354,6 +354,14 @@ private fun LazyItemScope.SetItem(
mutableStateOf(exerciseLogEntry)
}

LaunchedEffect(key1 = exerciseLogEntry) {
// We have to change saved rpe manually because
// main rpe change is not handled by SetItem function
if (exerciseLogEntry.rpe != mLogEntry.rpe) {
mLogEntry = mLogEntry.copy(rpe = exerciseLogEntry.rpe)
}
}

val completionAnimDuration = 200
val completionAnimSpecFloat =
tween<Float>(
Expand Down
4 changes: 2 additions & 2 deletions modules/common-ui-resources/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@
<string name="rpe_8_5_title">Very Hard Effort</string>
<string name="rpe_8_5_description">Could have maybe done 2 more reps</string>
<string name="rpe_9_title">Extremely Hard Effort</string>
<string name="rpe_9_description">Could have definitely done 1 more reps</string>
<string name="rpe_9_description">Could have definitely done 1 more rep</string>
<string name="rpe_9_5_title">Extremely Hard Effort</string>
<string name="rpe_9_5_description">Could have maybe done 1 more reps</string>
<string name="rpe_9_5_description">Could have maybe done 1 more rep</string>
<string name="rpe_10_title">Max Effort</string>
<string name="rpe_10_description">No more reps possible</string>
</resources>

0 comments on commit 637f0ec

Please sign in to comment.