Skip to content

Commit

Permalink
fix wear settings button cutoff by round screen to pass store review
Browse files Browse the repository at this point in the history
  • Loading branch information
Razeeman committed Mar 27, 2024
1 parent 4bb9e7b commit 41ba630
Showing 1 changed file with 11 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
Expand Down

0 comments on commit 41ba630

Please sign in to comment.