Fix #114: Consolidate brand colors into :api resources (colors only)

Add api/src/main/res/values/colors.xml mirroring the Theme.kt palette so
:notifications and :work can reference brand colors via R.color.* instead
of inlining hex literals. Replace inline 0xFF0a1628 in FgsLimitNotifier
and ForegroundNotifier, and 0xFFea4335 in AuthRequestNotifier, with
ContextCompat.getColor(context, ApiR.color.rouse_*) lookups.

Theme.kt stays as-is (option a in the plan); palette is duplicated but
XML mirrors the Kotlin source of truth. Strings and dimens migration
will land in follow-up PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Monk 2026-04-14 20:05:00 -04:00
parent 96b2f97873
commit 86b763ef78
4 changed files with 41 additions and 3 deletions

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Shared brand palette for modules that cannot depend on :app
(:notifications, :work, etc.).
These values MIRROR the Kotlin Color vals in
app/src/main/java/com/rousecontext/app/ui/theme/Theme.kt.
Keep them in sync. The :app module continues to use the Compose
Color literals directly; this file exists so non-Compose consumers
can reach the same palette via R.color.*.
-->
<resources>
<!-- Brand palette -->
<color name="rouse_navy_dark">#FF0A1628</color>
<color name="rouse_navy_primary">#FF1A2744</color>
<color name="rouse_navy_light">#FF2A3A5C</color>
<color name="rouse_amber_accent">#FFEF9F27</color>
<color name="rouse_amber_dark">#FFBA7517</color>
<color name="rouse_surface_dark">#FF0F1C32</color>
<color name="rouse_warm_white">#FFFAF8F4</color>
<color name="rouse_surface_light">#FFF5F4F0</color>
<color name="rouse_warning_container_dark">#FF3A2800</color>
<color name="rouse_on_warning_container_dark">#FFFFE0A0</color>
<color name="rouse_warning_container_light">#FFFFF3E0</color>
<color name="rouse_on_warning_container_light">#FF5D4200</color>
<color name="rouse_success_green">#FF4CAF50</color>
<color name="rouse_alert_container_dark">#FF3A0000</color>
<color name="rouse_alert_container_light">#FFFFEBEE</color>
<color name="rouse_alert_content_dark">#FFFF6B6B</color>
<color name="rouse_alert_content_light">#FFBA1A1A</color>
<color name="rouse_code_box_border_empty">#FF404950</color>
<!-- Semantic (notification accents) -->
<color name="rouse_notification_auth_accent">#FFEA4335</color>
</resources>

View file

@ -5,6 +5,7 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.rousecontext.api.R as ApiR
/**
@ -78,7 +79,7 @@ class AuthRequestNotifier(
NotificationChannels.AUTH_REQUEST_CHANNEL_ID
)
.setSmallIcon(ApiR.drawable.ic_stat_rouse)
.setColor(0xFFea4335.toInt())
.setColor(ContextCompat.getColor(context, ApiR.color.rouse_notification_auth_accent))
.setContentTitle("Approval Required")
.setContentText("Code: $displayCode - Tap to approve or deny")
.setSubText(integration)

View file

@ -3,6 +3,7 @@ package com.rousecontext.notifications
import android.app.NotificationManager
import android.content.Context
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.rousecontext.api.R as ApiR
/**
@ -36,7 +37,7 @@ object FgsLimitNotifier {
.setContentText(TEXT)
.setStyle(NotificationCompat.BigTextStyle().bigText(TEXT))
.setSmallIcon(ApiR.drawable.ic_stat_rouse)
.setColor(0xFF0a1628.toInt())
.setColor(ContextCompat.getColor(context, ApiR.color.rouse_navy_dark))
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setAutoCancel(true)
.build()

View file

@ -3,6 +3,7 @@ package com.rousecontext.notifications
import android.app.Notification
import android.content.Context
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.rousecontext.api.R as ApiR
/**
@ -23,7 +24,7 @@ object ForegroundNotifier {
.setContentTitle("Rouse Context")
.setContentText(message)
.setSmallIcon(ApiR.drawable.ic_stat_rouse)
.setColor(0xFF0a1628.toInt())
.setColor(ContextCompat.getColor(context, ApiR.color.rouse_navy_dark))
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.build()