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

Commit

Permalink
Fix rpe
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitSuda committed Nov 18, 2022
1 parent 497da60 commit 5e393b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ private fun SetItemLayout(
|| exercise.category == ExerciseCategory.REPS
) {
ReboundSetTextField(
layoutWeight = 0.75f,
value = exerciseLogEntry.rpe?.toReadableString() ?: "",
onValueChange = {
onRpeChange(exerciseLogEntry, it.toFloatOrNull())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ fun ReboundSetKeyboardComponent(
)
}
KeyboardModeType.RPE_PICKER -> {
RpePickerComponent(
modifier = Modifier
.fillMaxWidth()
.height(
height = 250.dp,
),
onSetText = ::setText,
text = inputConnection?.getText(),
refreshKey = inputConnection
)
key(inputConnection) {
RpePickerComponent(
modifier = Modifier
.fillMaxWidth()
.height(
height = 250.dp,
),
onSetText = ::setText,
text = inputConnection?.getText(),
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import com.ankitsuda.rebound.ui.keyboard.enums.ReboundKeyboardType

@Composable
fun RowScope.ReboundSetTextField(
layoutWeight: Float = 1.25f,
value: String,
contentColor: Color,
bgColor: Color,
Expand All @@ -51,7 +52,7 @@ fun RowScope.ReboundSetTextField(
modifier = Modifier
.height(32.dp)
.padding(start = 8.dp, end = 8.dp)
.weight(1.25f)
.weight(layoutWeight)
.clip(RoundedCornerShape(12.dp))
.background(bgColor.lighterOrDarkerColor(0.10f)),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal fun RpePickerComponent(
modifier: Modifier,
onSetText: (String) -> Unit,
text: String?,
refreshKey: Any?,
refreshKey: Any? = null,
) {
var rpe: Float? by remember(text) {
mutableStateOf(text?.toFloatOrNull().takeIf { allRPEs.any { r -> r == it } })
Expand Down

0 comments on commit 5e393b2

Please sign in to comment.