diff --git a/wear/src/main/java/io/homeassistant/companion/android/complications/views/ComplicationConfigMainView.kt b/wear/src/main/java/io/homeassistant/companion/android/complications/views/ComplicationConfigMainView.kt index 3b1000b86b9..ccf5b42b4aa 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/complications/views/ComplicationConfigMainView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/complications/views/ComplicationConfigMainView.kt @@ -2,6 +2,7 @@ package io.homeassistant.companion.android.complications.views import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Check import androidx.compose.runtime.Composable @@ -12,9 +13,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.wear.compose.material3.Button +import androidx.wear.compose.material3.FilledIconButton import androidx.wear.compose.material3.Icon +import androidx.wear.compose.material3.IconButtonDefaults import androidx.wear.compose.material3.Text import androidx.wear.compose.material3.ToggleButton +import androidx.wear.compose.material3.touchTargetAwareSize import androidx.wear.compose.navigation.SwipeDismissableNavHost import androidx.wear.compose.navigation.composable import androidx.wear.compose.navigation.rememberSwipeDismissableNavController @@ -151,12 +155,17 @@ fun MainConfigView( } item { - Button( - modifier = Modifier.padding(top = 8.dp), + FilledIconButton( + modifier = Modifier.padding(top = 8.dp).touchTargetAwareSize(IconButtonDefaults.SmallButtonSize), onClick = { onAcceptClicked() }, - enabled = loaded && entity != null, - icon = { Icon(Icons.Filled.Check, stringResource(id = R.string.save)) } - ) { } + enabled = loaded && entity != null + ) { + Icon( + Icons.Filled.Check, + contentDescription = stringResource(id = R.string.save), + modifier = Modifier.size(IconButtonDefaults.iconSizeFor(IconButtonDefaults.SmallButtonSize)) + ) + } } } else { item { diff --git a/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt b/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt index be1461cab3e..456d3cc3336 100755 --- a/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt @@ -40,10 +40,12 @@ import androidx.wear.compose.foundation.lazy.ScalingLazyColumn import androidx.wear.compose.foundation.lazy.items import androidx.wear.compose.foundation.lazy.rememberScalingLazyListState import androidx.wear.compose.material3.Button -import androidx.wear.compose.material3.ButtonDefaults +import androidx.wear.compose.material3.FilledIconButton import androidx.wear.compose.material3.Icon +import androidx.wear.compose.material3.IconButtonDefaults import androidx.wear.compose.material3.LocalContentColor import androidx.wear.compose.material3.Text +import androidx.wear.compose.material3.touchTargetAwareSize import androidx.wear.compose.navigation.SwipeDismissableNavHost import androidx.wear.compose.navigation.composable import androidx.wear.compose.navigation.rememberSwipeDismissableNavController @@ -56,6 +58,7 @@ import io.homeassistant.companion.android.common.data.websocket.impl.entities.As import io.homeassistant.companion.android.conversation.ConversationViewModel import io.homeassistant.companion.android.theme.WearAppTheme import io.homeassistant.companion.android.theme.getFilledTonalButtonColors +import io.homeassistant.companion.android.theme.wearColorScheme import io.homeassistant.companion.android.util.KeepScreenOn import io.homeassistant.companion.android.views.ListHeader import io.homeassistant.companion.android.views.ThemeLazyColumn @@ -193,22 +196,23 @@ fun ConversationResultView( .clip(CircleShape) ) } - Button( + FilledIconButton( onClick = { onMicrophoneInput() }, colors = if (inputIsActive) { - ButtonDefaults.buttonColors(containerColor = Color.Transparent, contentColor = Color.Black) + IconButtonDefaults.filledIconButtonColors(containerColor = Color.Transparent, contentColor = Color.Black) } else { - ButtonDefaults.buttonColors() + IconButtonDefaults.filledIconButtonColors(containerColor = wearColorScheme.outlineVariant, contentColor = Color.White) }, - icon = { - Icon( - Icons.Filled.Mic, - contentDescription = stringResource(R.string.assist_start_listening), - tint = LocalContentColor.current - ) - } - ) { } + modifier = Modifier.touchTargetAwareSize(IconButtonDefaults.SmallButtonSize) + ) { + Icon( + Icons.Filled.Mic, + contentDescription = stringResource(R.string.assist_start_listening), + modifier = Modifier.size(IconButtonDefaults.iconSizeFor(IconButtonDefaults.SmallButtonSize)), + tint = LocalContentColor.current + ) + } } } } diff --git a/wear/src/main/java/io/homeassistant/companion/android/home/views/RefreshIntervalPickerView.kt b/wear/src/main/java/io/homeassistant/companion/android/home/views/RefreshIntervalPickerView.kt index 00e3cae5adc..dd5abb956fb 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/home/views/RefreshIntervalPickerView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/home/views/RefreshIntervalPickerView.kt @@ -2,6 +2,7 @@ package io.homeassistant.companion.android.home.views import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Check import androidx.compose.runtime.Composable @@ -16,11 +17,12 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.wear.compose.material.Picker import androidx.wear.compose.material.rememberPickerState -import androidx.wear.compose.material3.Button -import androidx.wear.compose.material3.ButtonDefaults +import androidx.wear.compose.material3.FilledIconButton import androidx.wear.compose.material3.Icon +import androidx.wear.compose.material3.IconButtonDefaults import androidx.wear.compose.material3.MaterialTheme import androidx.wear.compose.material3.Text +import androidx.wear.compose.material3.touchTargetAwareSize import androidx.wear.tooling.preview.devices.WearDevices import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.composables.picker.toRotaryScrollAdapter @@ -66,14 +68,16 @@ fun RefreshIntervalPickerView( color = wearColorScheme.primary ) } - Button( + FilledIconButton( onClick = { onSelectInterval(options[state.selectedOption]) }, - colors = ButtonDefaults.buttonColors(), - modifier = Modifier, - icon = { - Icon(Icons.Filled.Check, stringResource(id = R.string.save)) - } - ) { } + modifier = Modifier.touchTargetAwareSize(IconButtonDefaults.SmallButtonSize) + ) { + Icon( + Icons.Filled.Check, + contentDescription = stringResource(id = R.string.save), + modifier = Modifier.size(IconButtonDefaults.iconSizeFor(IconButtonDefaults.SmallButtonSize)) + ) + } } } diff --git a/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt b/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt index 87f377cf726..a29ad51525c 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt @@ -2,6 +2,7 @@ package io.homeassistant.companion.android.home.views import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add import androidx.compose.runtime.Composable @@ -14,9 +15,11 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.wear.compose.material3.Button -import androidx.wear.compose.material3.ButtonDefaults +import androidx.wear.compose.material3.FilledIconButton import androidx.wear.compose.material3.Icon +import androidx.wear.compose.material3.IconButtonDefaults import androidx.wear.compose.material3.Text +import androidx.wear.compose.material3.touchTargetAwareSize import androidx.wear.tooling.preview.devices.WearDevices import com.mikepenz.iconics.compose.Image import io.homeassistant.companion.android.data.SimplifiedEntity @@ -73,14 +76,16 @@ fun SetShortcutsTileView( } if (shortcutEntities.size < 7) { item { - Button( - modifier = Modifier.padding(top = 16.dp), - onClick = { onShortcutEntitySelectionChange(shortcutEntities.size) }, - colors = ButtonDefaults.buttonColors(), - icon = { - Icon(Icons.Filled.Add, stringResource(id = commonR.string.add_shortcut)) - } - ) { } + FilledIconButton( + modifier = Modifier.padding(top = 16.dp).touchTargetAwareSize(IconButtonDefaults.SmallButtonSize), + onClick = { onShortcutEntitySelectionChange(shortcutEntities.size) } + ) { + Icon( + Icons.Filled.Add, + contentDescription = stringResource(id = commonR.string.add_shortcut), + modifier = Modifier.size(IconButtonDefaults.iconSizeFor(IconButtonDefaults.SmallButtonSize)) + ) + } } } }