Skip to content

Commit

Permalink
Renamed JetLaggedTheme.colors to extraColors
Browse files Browse the repository at this point in the history
  • Loading branch information
IanGClifton committed Sep 12, 2024
1 parent e0ecc08 commit 98e0270
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ fun BasicInformationalCard(
val shape = RoundedCornerShape(24.dp)
Card(
shape = shape,
colors = CardDefaults.cardColors(containerColor = JetLaggedTheme.colors.cardBackground),
colors = CardDefaults.cardColors(
containerColor = JetLaggedTheme.extraColors.cardBackground
),
modifier = modifier
.padding(8.dp),
border = BorderStroke(2.dp, borderColor)
Expand Down Expand Up @@ -172,7 +174,7 @@ fun TwoLineInfoCard(
@Composable
fun AverageTimeInBedCard(modifier: Modifier = Modifier) {
TwoLineInfoCard(
borderColor = JetLaggedTheme.colors.bed,
borderColor = JetLaggedTheme.extraColors.bed,
firstLineText = stringResource(R.string.ave_time_in_bed_heading),
secondLineText = "8h42min",
icon = Icons.Default.Watch,
Expand All @@ -187,7 +189,7 @@ fun AverageTimeInBedCard(modifier: Modifier = Modifier) {
@Composable
fun AverageTimeAsleepCard(modifier: Modifier = Modifier) {
TwoLineInfoCard(
borderColor = JetLaggedTheme.colors.sleep,
borderColor = JetLaggedTheme.extraColors.sleep,
firstLineText = stringResource(R.string.ave_time_sleep_heading),
secondLineText = "7h42min",
icon = Icons.Default.SingleBed,
Expand All @@ -205,12 +207,12 @@ fun WellnessCard(
wellnessData: WellnessData = WellnessData(0, 0, 0)
) {
BasicInformationalCard(
borderColor = JetLaggedTheme.colors.wellness,
borderColor = JetLaggedTheme.extraColors.wellness,
modifier = modifier
.widthIn(max = 400.dp)
.heightIn(min = 200.dp)
) {
FadingCircleBackground(36.dp, JetLaggedTheme.colors.wellness.copy(0.25f))
FadingCircleBackground(36.dp, JetLaggedTheme.extraColors.wellness.copy(0.25f))
Column(
horizontalAlignment = CenterHorizontally,
modifier = Modifier
Expand Down Expand Up @@ -248,7 +250,7 @@ fun WellnessBubble(
countText: String,
metric: String,
modifier: Modifier = Modifier,
bubbleColor: Color = JetLaggedTheme.colors.wellness
bubbleColor: Color = JetLaggedTheme.extraColors.wellness
) {
Column(
modifier = modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fun JetLaggedScreen(
) {
Column(
modifier = Modifier.movingStripesBackground(
stripeColor = JetLaggedTheme.colors.header,
stripeColor = JetLaggedTheme.extraColors.header,
backgroundColor = MaterialTheme.colorScheme.background,
)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun HeartRateCard(
heartRateData: HeartRateOverallData = HeartRateOverallData()
) {
BasicInformationalCard(
borderColor = JetLaggedTheme.colors.heart,
borderColor = JetLaggedTheme.extraColors.heart,
modifier = modifier
.height(260.dp)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fun HeartRateGraph(listData: List<HeartRateData>) {
private fun Graph(
listData: List<HeartRateData>,
modifier: Modifier = Modifier,
waveLineColors: List<Color> = JetLaggedTheme.colors.heartWave,
pathBackground: Color = JetLaggedTheme.colors.heartWaveBackground,
waveLineColors: List<Color> = JetLaggedTheme.extraColors.heartWave,
pathBackground: Color = JetLaggedTheme.extraColors.heartWaveBackground,
) {
if (waveLineColors.size < 2) {
throw IllegalArgumentException("waveLineColors requires 2+ colors; $waveLineColors")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ private fun DayLabel(dayOfWeek: DayOfWeek) {
@Composable
private fun HoursHeader(hours: List<Int>) {
val brushColors = listOf(
JetLaggedTheme.colors.sleepChartPrimary,
JetLaggedTheme.colors.sleepChartSecondary,
JetLaggedTheme.extraColors.sleepChartPrimary,
JetLaggedTheme.extraColors.sleepChartSecondary,
)
Row(
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ private fun SleepType.heightSleepType(): Float {
@Composable
fun colorForSleepType(sleepType: SleepType): Color =
when (sleepType) {
SleepType.Awake -> JetLaggedTheme.colors.sleepAwake
SleepType.REM -> JetLaggedTheme.colors.sleepRem
SleepType.Light -> JetLaggedTheme.colors.sleepLight
SleepType.Deep -> JetLaggedTheme.colors.sleepDeep
SleepType.Awake -> JetLaggedTheme.extraColors.sleepAwake
SleepType.REM -> JetLaggedTheme.extraColors.sleepRem
SleepType.Light -> JetLaggedTheme.extraColors.sleepLight
SleepType.Deep -> JetLaggedTheme.extraColors.sleepDeep
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fun JetLaggedTheme(
}

object JetLaggedTheme {
val colors: JetLaggedExtraColors
val extraColors: JetLaggedExtraColors
@Composable
get() = LocalExtraColors.current
}

0 comments on commit 98e0270

Please sign in to comment.