Skip to content

Commit

Permalink
style: put preferred distance option above account management contain…
Browse files Browse the repository at this point in the history
…er with an explanatory text
  • Loading branch information
Harrish92 committed Dec 19, 2024
1 parent 91a52a4 commit f207ef6
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import androidx.compose.ui.window.DialogProperties
import com.android.periodpals.R
import com.android.periodpals.model.authentication.AuthenticationViewModel
import com.android.periodpals.model.user.UserViewModel
import com.android.periodpals.resources.C.Tag.ProfileScreens.CreateProfileScreen
import com.android.periodpals.resources.C.Tag.SettingsScreen
import com.android.periodpals.resources.ComponentColor.getTertiaryCardColors
import com.android.periodpals.ui.components.SliderMenu
Expand Down Expand Up @@ -86,9 +87,9 @@ fun SettingsScreen(
// delete account dialog state
var showDialog by remember { mutableStateOf(false) }

val context = LocalContext.current
val context = LocalContext.current

var sliderPosition by remember { mutableFloatStateOf(DEFAULT_RADIUS) }
var sliderPosition by remember { mutableFloatStateOf(DEFAULT_RADIUS) }

// delete account dialog logic
if (showDialog) {
Expand Down Expand Up @@ -125,6 +126,18 @@ fun SettingsScreen(
verticalArrangement =
Arrangement.spacedBy(MaterialTheme.dimens.small2, Alignment.CenterVertically),
) {
SliderMenu(sliderPosition) { sliderPosition = (it / 100).roundToInt() * 100f }

Text(
text = context.getString(R.string.create_profile_radius_explanation_text),
style = MaterialTheme.typography.labelMedium,
modifier =
Modifier.wrapContentHeight()
.fillMaxWidth()
.testTag(CreateProfileScreen.FILTER_RADIUS_EXPLANATION_TEXT)
.padding(top = MaterialTheme.dimens.small2),
textAlign = TextAlign.Center,
)

// account management section
SettingsContainer(testTag = SettingsScreen.ACCOUNT_MANAGEMENT_CONTAINER) {
Expand Down Expand Up @@ -176,8 +189,6 @@ fun SettingsScreen(
color = MaterialTheme.colorScheme.error,
)
}

SliderMenu(sliderPosition) { sliderPosition = (it / 100).roundToInt() * 100f }
}
}
}
Expand Down

0 comments on commit f207ef6

Please sign in to comment.