Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/src/main/java/com/rgremote/app/ui/HaloScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import com.rgremote.app.ui.ringGradientFill
import com.rgremote.app.ui.theme.HaloColors
import com.rgremote.app.ui.theme.HaloSpec
import com.rgremote.app.ui.theme.ringGradientColors
import com.rgremote.app.ui.theme.rememberRingBrush
import com.rgremote.app.ui.theme.LocalHaloColors

/**
Expand Down Expand Up @@ -482,6 +483,7 @@ private fun MoreControlsAffordance(
onClick: () -> Unit,
) {
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
Expand Down Expand Up @@ -510,13 +512,14 @@ private fun MoreControlsAffordance(
Icon(
imageVector = Icons.Filled.KeyboardArrowUp,
contentDescription = null,
tint = halo.moreControls
tint = Color.White,
modifier = Modifier.ringGradientFill(halo.ringGradientColors())
)
}
Spacer(Modifier.height(6.dp))
Text(
text = stringResource(R.string.halo_more_controls),
color = halo.moreControls,
style = MaterialTheme.typography.labelSmall.copy(brush = ringBrush),
fontSize = 11.sp,
letterSpacing = 2.sp
)
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/com/rgremote/app/ui/MoreControlsSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.rgremote.app.domain.AppLaunchTarget
import com.rgremote.app.domain.HdmiPort
import com.rgremote.app.domain.VolumeCommand
import com.rgremote.app.ui.theme.HaloSpec
import com.rgremote.app.ui.theme.rememberRingBrush
import com.rgremote.app.ui.theme.LocalHaloColors

/**
Expand Down Expand Up @@ -73,6 +74,7 @@ internal fun MoreControlsSheet(
onDismiss: () -> Unit,
) {
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
ModalBottomSheet(
onDismissRequest = onDismiss,
containerColor = MaterialTheme.colorScheme.surface
Expand All @@ -87,8 +89,7 @@ internal fun MoreControlsSheet(
) {
Text(
text = stringResource(R.string.halo_more_controls),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.titleMedium.copy(brush = ringBrush),
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 4.dp)
Expand Down Expand Up @@ -237,27 +238,27 @@ private fun SheetSeparator() {
)
}

/** Halo-styled text pill: glass fill, hairline border, dock-icon text. */
/** Halo-styled text pill: glass fill, ring-gradient border and label. */
@Composable
private fun GlassPill(
label: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
val shape = RoundedCornerShape(24.dp)
Box(
modifier = modifier
.height(48.dp)
.background(halo.dockFill, shape)
.border(1.dp, halo.dockBorder, shape)
.border(1.dp, ringBrush, shape)
.clickable(onClickLabel = label, onClick = onClick),
contentAlignment = Alignment.Center
) {
Text(
text = label,
color = halo.dockIcon,
fontSize = 15.sp,
style = MaterialTheme.typography.labelLarge.copy(brush = ringBrush),
fontWeight = FontWeight.Medium
)
}
Expand Down
18 changes: 12 additions & 6 deletions app/src/main/java/com/rgremote/app/ui/RGRemoteApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ import com.rgremote.app.domain.AppLaunchTarget
import com.rgremote.app.domain.DeviceType
import com.rgremote.app.roku.RokuPowerMode
import com.rgremote.app.ui.theme.LocalHaloColors
import com.rgremote.app.ui.theme.rememberRingBrush
import com.rgremote.app.ui.theme.ThemeMode
import com.rgremote.app.domain.DpadDirection
import com.rgremote.app.domain.duplicateDeviceCount
Expand Down Expand Up @@ -695,6 +696,7 @@ private fun SetupGuideDialog(
val googlePaired = google?.id?.let { state.pairedDeviceIds.contains(it) } == true
val hdmiMapped = mappedPort != null
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
AlertDialog(
onDismissRequest = onDismiss,
confirmButton = {
Expand All @@ -714,7 +716,10 @@ private fun SetupGuideDialog(
}
},
title = {
Text(stringResource(R.string.setup_guide_title))
Text(
text = stringResource(R.string.setup_guide_title),
style = MaterialTheme.typography.titleLarge.copy(brush = ringBrush)
)
},
text = {
Column(
Expand Down Expand Up @@ -811,6 +816,7 @@ private fun GuideStep(
accent: Color
) {
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
Surface(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(16.dp),
Expand All @@ -822,7 +828,7 @@ private fun GuideStep(
border = if (complete) {
BorderStroke(0.5.dp, halo.statusOnline.copy(alpha = 0.30f))
} else {
null
BorderStroke(0.5.dp, ringBrush)
}
) {
Column(
Expand Down Expand Up @@ -863,8 +869,7 @@ private fun GuideStep(
}
Text(
text = title,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.titleSmall,
style = MaterialTheme.typography.titleSmall.copy(brush = ringBrush),
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f)
)
Expand All @@ -882,19 +887,20 @@ private fun GuideStep(
private fun SavedTvsSummary(state: RGRemoteUiState) {
if (state.devices.isEmpty()) return
val halo = LocalHaloColors.current
val ringBrush = rememberRingBrush()
Surface(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(16.dp),
color = halo.dockWell,
border = BorderStroke(0.5.dp, halo.chipBorder)
border = BorderStroke(0.5.dp, ringBrush)
) {
Column(
modifier = Modifier.padding(12.dp),
verticalArrangement = Arrangement.spacedBy(6.dp)
) {
Text(
text = stringResource(R.string.saved_summary_title),
style = MaterialTheme.typography.labelLarge,
style = MaterialTheme.typography.labelLarge.copy(brush = ringBrush),
fontWeight = FontWeight.Bold,
color = PrimaryText
)
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/rgremote/app/ui/theme/HaloColors.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.rgremote.app.ui.theme

import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color

/**
Expand Down Expand Up @@ -126,6 +129,13 @@ fun HaloColors.ringGradientColors(): List<Color> = listOf(
ringPink
)

/** Remembered vertical brush over the ring gradient, for text and borders. */
@Composable
fun rememberRingBrush(): Brush {
val halo = LocalHaloColors.current
return remember(halo) { Brush.verticalGradient(halo.ringGradientColors()) }
}

/**
* Measured geometry contract from `docs/ui-target.md`. Fractions are relative
* to screen width (ring) or parent size (the rest); components must consume
Expand Down
Loading