From 41ba630680ad96d4ee584f72216e2f6261663368 Mon Sep 17 00:00:00 2001 From: razeeman Date: Wed, 27 Mar 2024 21:25:44 +0300 Subject: [PATCH] fix wear settings button cutoff by round screen to pass store review --- .../ui/components/SettingsButton.kt | 49 +++++-------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/wear/src/main/java/com/example/util/simpletimetracker/presentation/ui/components/SettingsButton.kt b/wear/src/main/java/com/example/util/simpletimetracker/presentation/ui/components/SettingsButton.kt index 62691e3fd..2e6cb06d3 100644 --- a/wear/src/main/java/com/example/util/simpletimetracker/presentation/ui/components/SettingsButton.kt +++ b/wear/src/main/java/com/example/util/simpletimetracker/presentation/ui/components/SettingsButton.kt @@ -5,59 +5,32 @@ */ package com.example.util.simpletimetracker.presentation.ui.components -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.wear.compose.material.Chip -import androidx.wear.compose.material.ChipDefaults +import androidx.wear.compose.material.Button +import androidx.wear.compose.material.ButtonDefaults import androidx.wear.compose.material.Icon -import androidx.wear.compose.material.Text import com.example.util.simpletimetracker.R import com.example.util.simpletimetracker.presentation.theme.ColorInactive -import com.example.util.simpletimetracker.utils.getString @Composable fun SettingsButton( onClick: () -> Unit = {}, ) { - Chip( - modifier = Modifier - .height(ACTIVITY_VIEW_HEIGHT.dp) - .fillMaxWidth(), + Button( + modifier = Modifier.size(ACTIVITY_VIEW_HEIGHT.dp), onClick = onClick, - label = { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Center, - ) { - Icon( - painter = painterResource(id = R.drawable.wear_settings), - contentDescription = null, - ) - Spacer( - modifier = Modifier.width(4.dp), - ) - Text( - text = getString(stringResId = R.string.wear_settings_title), - maxLines = 1, - textAlign = TextAlign.Center, - overflow = TextOverflow.Ellipsis, - ) - } + content = { + Icon( + painter = painterResource(id = R.drawable.wear_settings), + contentDescription = null, + ) }, - colors = ChipDefaults.chipColors( + colors = ButtonDefaults.buttonColors( backgroundColor = ColorInactive, ), )