Skip to content

Commit

Permalink
Replace 'Refresh interval' title with icon (#4144)
Browse files Browse the repository at this point in the history
- To (hopefully) finally address review failures about text being cut off on round screens replace it with an icon. Same icon as used in the previous screen so should be pretty clear.
  • Loading branch information
jpelgrom committed Jan 24, 2024
1 parent b7ec2ab commit ff2b0ec
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ListHeader
import androidx.wear.compose.material.LocalContentColor
import androidx.wear.compose.material.Picker
import androidx.wear.compose.material.rememberPickerState
import androidx.wear.compose.material3.FilledIconButton
Expand All @@ -28,9 +31,10 @@ import androidx.wear.tooling.preview.devices.WearDevices
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.composables.picker.toRotaryScrollAdapter
import com.google.android.horologist.compose.rotaryinput.rotaryWithSnap
import com.mikepenz.iconics.compose.Image
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import io.homeassistant.companion.android.theme.wearColorScheme
import io.homeassistant.companion.android.util.intervalToString
import io.homeassistant.companion.android.views.ListHeader
import io.homeassistant.companion.android.common.R as R

@OptIn(ExperimentalHorologistApi::class)
Expand All @@ -50,7 +54,13 @@ fun RefreshIntervalPickerView(
modifier = Modifier.padding(horizontal = 12.dp).fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
ListHeader(R.string.refresh_interval)
ListHeader {
Image(
asset = CommunityMaterial.Icon3.cmd_timer_cog,
contentDescription = stringResource(R.string.refresh_interval),
colorFilter = ColorFilter.tint(LocalContentColor.current)
)
}
Picker(
state = state,
contentDescription = stringResource(R.string.refresh_interval),
Expand Down

0 comments on commit ff2b0ec

Please sign in to comment.