diff --git a/app/src/main/java/com/ankitsuda/rebound/ui/navigation/AppNavigation.kt b/app/src/main/java/com/ankitsuda/rebound/ui/navigation/AppNavigation.kt index ae4d9e42..ff690f4d 100644 --- a/app/src/main/java/com/ankitsuda/rebound/ui/navigation/AppNavigation.kt +++ b/app/src/main/java/com/ankitsuda/rebound/ui/navigation/AppNavigation.kt @@ -28,6 +28,7 @@ import com.ankitsuda.rebound.ui.measure.MeasureScreen import com.ankitsuda.rebound.ui.exercise_details.ExerciseDetailScreen import com.ankitsuda.rebound.ui.exercises.ExercisesScreen import com.ankitsuda.rebound.ui.calendar.CalendarScreen +import com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.RpeSelectorBottomSheet import com.ankitsuda.rebound.ui.components.workouteditor.supersetselector.SupersetSelectorBottomSheet import com.ankitsuda.rebound.ui.create_exercise.CreateExerciseScreen import com.ankitsuda.rebound.ui.customizeplates.CustomizePlatesScreen @@ -127,6 +128,7 @@ internal fun AppNavigation( addExercisesBottomSheet(navController) addRestTimer(navController) addSupersetSelector(navController) + addRpeSelector(navController) } } @@ -401,6 +403,12 @@ private fun NavGraphBuilder.addSupersetSelector(navController: NavController) { } } +private fun NavGraphBuilder.addRpeSelector(navController: NavController) { + bottomSheetScreen(LeafScreen.RpeSelector()) { + RpeSelectorBottomSheet(navController) + } +} + /** * Adds an [NavController.OnDestinationChangedListener] to this [NavController] and updates the diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutEditorComponent.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutEditorComponent.kt index 1fb96886..6a699447 100644 --- a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutEditorComponent.kt +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutEditorComponent.kt @@ -42,11 +42,13 @@ import com.ankitsuda.rebound.domain.entities.ExerciseSetGroupNote import com.ankitsuda.rebound.domain.entities.ExerciseWorkoutJunction import com.ankitsuda.rebound.domain.entities.LogEntriesWithExerciseJunction import com.ankitsuda.rebound.ui.components.AppTextField +import com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.models.RpeSelectorResult import com.ankitsuda.rebound.ui.components.workouteditor.supersetselector.models.SupersetSelectorResult import com.ankitsuda.rebound.ui.components.workouteditor.warmupcalculator.toExerciseLogEntries import com.ankitsuda.rebound.ui.keyboard.LocalReboundSetKeyboard import com.ankitsuda.rebound.ui.theme.ReboundTheme import com.google.accompanist.insets.LocalWindowInsets +import timber.log.Timber import kotlin.math.log @OptIn(ExperimentalComposeUiApi::class, ExperimentalFoundationApi::class) @@ -87,6 +89,12 @@ fun WorkoutEditorComponent( ?.getStateFlow(RESULT_SUPERSET_SELECTOR_SUPERSET_ID_KEY, null) ?.collectAsState() + // Observes results when RPE Selector changes value of arg + val rpeSelectorResult = navController.currentBackStackEntry + ?.savedStateHandle + ?.getStateFlow(RESULT_RPE_SELECTOR_KEY, null) + ?.collectAsState() + val navigationBarHeight = with(LocalDensity.current) { if (addNavigationBarPadding) LocalWindowInsets.current.navigationBars.bottom.toDp() else 0.dp } @@ -117,6 +125,26 @@ fun WorkoutEditorComponent( } } + LaunchedEffect(key1 = rpeSelectorResult?.value) { + rpeSelectorResult?.value?.let { result -> + + logEntriesWithJunction.flatMap { it.logEntries }.find { + it.entryId == result.entryId + }?.let { + onUpdateLogEntry( + it.copy( + rpe = result.rpe + ) + ) + } + + navController.currentBackStackEntry?.savedStateHandle?.set( + RESULT_RPE_SELECTOR_KEY, + null + ) + } + } + val keyboardController = LocalSoftwareKeyboardController.current val reboundKeyboard = LocalReboundSetKeyboard.current fun hideKeyboard() { @@ -221,6 +249,15 @@ fun WorkoutEditorComponent( junctionId = logEntriesWithJunctionItem.junction.id, ) ) + }, + onRequestRpeSelector = { + hideKeyboard() + navigator.navigate( + LeafScreen.RpeSelector.createRoute( + it.entryId, + it.rpe + ) + ) } ) } diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutExerciseItem.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutExerciseItem.kt index e72e6c35..eb836f3e 100644 --- a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutExerciseItem.kt +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/WorkoutExerciseItem.kt @@ -24,6 +24,7 @@ import androidx.compose.foundation.lazy.LazyItemScope import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.* @@ -31,6 +32,7 @@ import androidx.compose.runtime.* import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.scale import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource @@ -70,6 +72,7 @@ fun LazyListScope.workoutExerciseItemAlt( onChangeNote: (ExerciseSetGroupNote) -> Unit, onAddToSuperset: () -> Unit, onRemoveFromSuperset: () -> Unit, + onRequestRpeSelector: (ExerciseLogEntry) -> Unit, ) { val supersetId = logEntriesWithJunction.junction.supersetId @@ -238,6 +241,19 @@ fun LazyListScope.workoutExerciseItemAlt( textAlign = TextAlign.Center, modifier = Modifier.weight(1.25f) ) + + if (exercise.category == ExerciseCategory.WEIGHTS_AND_REPS + || exercise.category == ExerciseCategory.REPS + ) { + Text( + text = stringResource(id = R.string.rpe), + style = ReboundTheme.typography.caption, + color = ReboundTheme.colors.onBackground.copy(alpha = 0.5f), + textAlign = TextAlign.Center, + modifier = Modifier.weight(.75f) + ) + } + Box( modifier = Modifier.weight(0.5f), contentAlignment = Alignment.Center, @@ -278,8 +294,9 @@ fun LazyListScope.workoutExerciseItemAlt( val revisedSetsTexts = getRevisedSetNumbers() items(items = sortedEntries, key = { + "${it.entryId}_${it.rpe}" // "${it.entryId}_${it.setNumber}" - it.entryId +// it.entryId }) { entry -> SetItem( useReboundKeyboard = useReboundKeyboard, @@ -291,7 +308,8 @@ fun LazyListScope.workoutExerciseItemAlt( }, onSwipeDelete = { onSwipeDelete(it) - } + }, + onRequestRpeSelector = onRequestRpeSelector ) } @@ -330,6 +348,7 @@ private fun LazyItemScope.SetItem( exerciseLogEntry: ExerciseLogEntry, onChange: (ExerciseLogEntry) -> Unit, onSwipeDelete: (ExerciseLogEntry) -> Unit, + onRequestRpeSelector: (ExerciseLogEntry) -> Unit, ) { var mLogEntry by rememberSaveable { mutableStateOf(exerciseLogEntry) @@ -448,6 +467,7 @@ private fun LazyItemScope.SetItem( onSetTypeChange = { _, value -> handleOnChange(mLogEntry.copy(setType = value)) }, + onRequestRpeSelector = onRequestRpeSelector ) } } @@ -466,6 +486,7 @@ private fun SetItemLayout( onTimeChange: (ExerciseLogEntry, Long?) -> Unit, onCompleteChange: (ExerciseLogEntry, Boolean) -> Unit, onSetTypeChange: (ExerciseLogEntry, LogSetType) -> Unit, + onRequestRpeSelector: (ExerciseLogEntry) -> Unit, ) { val typeOfSet = exerciseLogEntry.setType ?: LogSetType.NORMAL var isSetTypeChangerExpanded by rememberSaveable { @@ -596,6 +617,32 @@ private fun SetItemLayout( ) } + if (exercise.category == ExerciseCategory.WEIGHTS_AND_REPS + || exercise.category == ExerciseCategory.REPS + ) { + Box( + modifier = Modifier + .defaultMinSize(minHeight = 32.dp) + .padding(start = 8.dp, end = 8.dp) + .weight(0.75f) + .clip(RoundedCornerShape(12.dp)) + .background(bgColor.lighterOrDarkerColor(0.10f)) + .clickable { + onRequestRpeSelector(exerciseLogEntry) + }, + contentAlignment = Alignment.Center + ) { + Text( + exerciseLogEntry.rpe?.toReadableString() ?: "", + style = LocalTextStyle.current.copy( + textAlign = TextAlign.Center, + fontSize = 14.sp, + color = contentColor + ) + ) + } + } + IconButton( onClick = { onCompleteChange( diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/RpeSelectorBottomSheet.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/RpeSelectorBottomSheet.kt new file mode 100644 index 00000000..6326a502 --- /dev/null +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/RpeSelectorBottomSheet.kt @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022 Ankit Suda. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package com.ankitsuda.rebound.ui.components.workouteditor.rpeselector + +import androidx.compose.foundation.layout.* +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import androidx.navigation.NavController +import com.ankitsuda.navigation.ENTRY_ID_KEY +import com.ankitsuda.navigation.RESULT_RPE_SELECTOR_KEY +import com.ankitsuda.navigation.RPE_KEY +import com.ankitsuda.rebound.ui.components.BottomSheetRButton +import com.ankitsuda.rebound.ui.components.BottomSheetSecondaryRButton +import com.ankitsuda.rebound.ui.components.BottomSheetSurface +import com.ankitsuda.rebound.ui.components.TopBar +import com.ankitsuda.rebound.ui.components.workouteditor.R +import com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.components.RpeSlider +import com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.components.SelectedRpeOverview +import com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.models.RpeSelectorResult + +@Composable +fun RpeSelectorBottomSheet( + navController: NavController +) { + val initialRpe: Float? = with( + navController.currentBackStackEntry?.arguments + ?.getFloat(RPE_KEY) + ) { + if (this == -1f) null else this + } + + var rpe: Float? by rememberSaveable { + mutableStateOf(initialRpe) + } + + fun handleSelectClick() { + + navController.currentBackStackEntry?.arguments?.getString(ENTRY_ID_KEY)?.let { + navController.previousBackStackEntry?.savedStateHandle?.set( + RESULT_RPE_SELECTOR_KEY, + RpeSelectorResult( + entryId = it, + rpe = rpe, + ) + ) + } + + navController.popBackStack() + + } + + BottomSheetSurface { + Column( + modifier = Modifier + .fillMaxWidth() + .navigationBarsPadding(), + ) { + TopBar( + title = stringResource(id = R.string.rpe), + statusBarEnabled = false, + elevationEnabled = false + ) + Column( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + verticalArrangement = Arrangement.spacedBy(16.dp) + ) { + SelectedRpeOverview( + modifier = Modifier.fillMaxWidth(), + rpe = rpe, + ) + RpeSlider( + modifier = Modifier.fillMaxWidth(), + value = rpe, + onValueChange = { + rpe = it + } + ) + } + Row( + Modifier + .padding(end = 16.dp, start = 16.dp, bottom = 16.dp, top = 16.dp) + .align(Alignment.End) + ) { + BottomSheetSecondaryRButton( + modifier = Modifier.padding(end = 16.dp), + onClick = { + navController.popBackStack() + }) { + Text(stringResource(id = R.string.cancel)) + } + + BottomSheetRButton( + onClick = ::handleSelectClick, + modifier = Modifier.width(88.dp) + ) { + Text(stringResource(id = R.string.select)) + } + } + } + } +} \ No newline at end of file diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/RpeSlider.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/RpeSlider.kt new file mode 100644 index 00000000..f62c6e3b --- /dev/null +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/RpeSlider.kt @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2022 Ankit Suda. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.components + +import androidx.compose.foundation.Canvas +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Slider +import androidx.compose.material.SliderDefaults +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.nativeCanvas +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.unit.dp +import com.ankitsuda.base.util.toLegacyInt +import com.ankitsuda.base.util.toReadableString +import com.ankitsuda.rebound.ui.theme.ReboundTheme +import timber.log.Timber +import kotlin.math.roundToInt + +@Composable +internal fun RpeSlider( + modifier: Modifier, + value: Float?, + onValueChange: (Float?) -> Unit, +) { + val allRPEs = listOf(null, 6f, 7f, 7.5f, 8f, 8.5f, 9f, 9.5f, 10f) + + var mValue by remember { + mutableStateOf(with(allRPEs.indexOf(value)) { + if (this == -1) 0f else this.toFloat() + }) + } + + val drawPadding = with(LocalDensity.current) { 10.dp.toPx() } + val textSize = with(LocalDensity.current) { 10.dp.toPx() } + val lineHeightDp = 10.dp + val lineHeightPx = with(LocalDensity.current) { lineHeightDp.toPx() } + val canvasHeight = 50.dp + val textPaint = android.graphics.Paint().apply { + color = ReboundTheme.colors.onBackground.toLegacyInt() + textAlign = android.graphics.Paint.Align.CENTER + this.textSize = textSize + } + Box( + modifier = modifier, + contentAlignment = Alignment.Center + ) { + Canvas( + modifier = Modifier + .height(canvasHeight) + .fillMaxWidth() + .padding( + top = canvasHeight + .div(2) + .minus(lineHeightDp.div(2)) + ) + ) { + val yStart = 0f + val distance = (size.width.minus(2 * drawPadding)).div(allRPEs.size.minus(1)) + allRPEs.forEachIndexed { index, rpe -> + drawLine( + color = Color.DarkGray, + start = Offset(x = drawPadding + index.times(distance), y = yStart), + end = Offset(x = drawPadding + index.times(distance), y = lineHeightPx) + ) +// if (index.rem(2) == 1) { + this.drawContext.canvas.nativeCanvas.drawText( + rpe?.toReadableString() ?: "?", + drawPadding + index.times(distance), + size.height, + textPaint + ) +// } + } + } + Slider( + modifier = Modifier.fillMaxWidth(), + value = mValue, + valueRange = 0f..(allRPEs.size - 1).toFloat(), + steps = allRPEs.size - 2, + colors = SliderDefaults.colors( + activeTickColor = Color.Transparent, + inactiveTickColor = Color.Transparent + ), + onValueChange = { + mValue = it + onValueChange(allRPEs.getOrNull(it.roundToInt())) + }) + } +} \ No newline at end of file diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/SelectedRpeOverview.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/SelectedRpeOverview.kt new file mode 100644 index 00000000..c2c8b0da --- /dev/null +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/components/SelectedRpeOverview.kt @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022 Ankit Suda. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.components + +import androidx.compose.animation.* +import androidx.compose.animation.core.tween +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.material.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.ankitsuda.base.util.toReadableString +import com.ankitsuda.rebound.ui.components.workouteditor.R +import com.ankitsuda.rebound.ui.theme.ReboundTheme + +@OptIn(ExperimentalAnimationApi::class) +@Composable +internal fun SelectedRpeOverview(modifier: Modifier, rpe: Float?) { + var lastRpe by remember { mutableStateOf(rpe) } + var mRpe by remember { mutableStateOf(rpe) } + + SideEffect { + if (mRpe != rpe) { + lastRpe = mRpe + mRpe = rpe + } + } + + AnimatedContent( + targetState = mRpe, + transitionSpec = { + if ((targetState ?: 0f) > (lastRpe ?: 0f)) { + // If the target number is larger, it slides up and fades in + // while the initial (smaller) number slides up and fades out. + slideInHorizontally { width -> width } + fadeIn() with + slideOutHorizontally { width -> -width } + fadeOut() + } else { + // If the target number is smaller, it slides down and fades in + // while the initial number slides down and fades out. + slideInHorizontally { width -> -width } + fadeIn() with + slideOutHorizontally { width -> width } + fadeOut() + }.using( + // Disable clipping since the faded slide-in/out should + // be displayed out of bounds. + SizeTransform(clip = false) + ) + }, + ) { + + var title = stringResource(id = R.string.rpe) + var description: String? = null + + when (it) { + 6f -> { + title = stringResource(id = R.string.rpe_6_title) + description = stringResource(id = R.string.rpe_6_description) + } + 7f -> { + title = stringResource(id = R.string.rpe_7_title) + description = stringResource(id = R.string.rpe_7_description) + } + 7.5f -> { + title = stringResource(id = R.string.rpe_7_5_title) + description = stringResource(id = R.string.rpe_7_5_description) + } + 8f -> { + title = stringResource(id = R.string.rpe_8_title) + description = stringResource(id = R.string.rpe_8_description) + } + 8.5f -> { + title = stringResource(id = R.string.rpe_8_5_title) + description = stringResource(id = R.string.rpe_8_5_description) + } + 9f -> { + title = stringResource(id = R.string.rpe_9_title) + description = stringResource(id = R.string.rpe_9_description) + } + 9.5f -> { + title = stringResource(id = R.string.rpe_9_5_title) + description = stringResource(id = R.string.rpe_9_5_description) + } + 10f -> { + title = stringResource(id = R.string.rpe_10_title) + description = stringResource(id = R.string.rpe_10_description) + } + } + + Column( + modifier = modifier, + verticalArrangement = Arrangement.spacedBy(8.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + text = if (it != null) it.toReadableString() else "?", + style = ReboundTheme.typography.h3 + ) + Text( + text = title, + style = ReboundTheme.typography.subtitle1.copy(color = ReboundTheme.colors.onBackground) + ) + + Text( + text = description ?: "", + style = ReboundTheme.typography.subtitle1.copy( + color = ReboundTheme.colors.onBackground.copy(alpha = 0.75f) + ) + ) + } + } +} \ No newline at end of file diff --git a/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/models/RpeSelectorResult.kt b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/models/RpeSelectorResult.kt new file mode 100644 index 00000000..2379bb31 --- /dev/null +++ b/modules/common-ui-components-workout-editor/src/main/java/com/ankitsuda/rebound/ui/components/workouteditor/rpeselector/models/RpeSelectorResult.kt @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022 Ankit Suda. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package com.ankitsuda.rebound.ui.components.workouteditor.rpeselector.models + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +@Parcelize +data class RpeSelectorResult( + val entryId: String, + val rpe: Float? +) : Parcelable + diff --git a/modules/common-ui-components/src/main/java/com/ankitsuda/rebound/ui/components/BottomSheetSurface.kt b/modules/common-ui-components/src/main/java/com/ankitsuda/rebound/ui/components/BottomSheetSurface.kt index efed436b..8c278e12 100644 --- a/modules/common-ui-components/src/main/java/com/ankitsuda/rebound/ui/components/BottomSheetSurface.kt +++ b/modules/common-ui-components/src/main/java/com/ankitsuda/rebound/ui/components/BottomSheetSurface.kt @@ -15,23 +15,18 @@ package com.ankitsuda.rebound.ui.components import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.Surface import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import com.ankitsuda.rebound.ui.theme.LocalThemeState -//import com.ankitsuda.rebound.ui.screens.main_screen.LocalBottomSheet -import com.ankitsuda.rebound.ui.theme.ReboundTheme -import com.google.accompanist.insets.statusBarsPadding -import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi /** * Wraps bottom sheet content in surface with better inset support */ -@OptIn(ExperimentalMaterialNavigationApi::class, ExperimentalMaterialApi::class) @Composable fun BottomSheetSurface(content: @Composable () -> Unit) { Surface( diff --git a/modules/common-ui-resources/src/main/res/values/strings.xml b/modules/common-ui-resources/src/main/res/values/strings.xml index 24338d87..930ab0ec 100644 --- a/modules/common-ui-resources/src/main/res/values/strings.xml +++ b/modules/common-ui-resources/src/main/res/values/strings.xml @@ -1,5 +1,4 @@ - -