Skip to content

Commit d8c5bd8

Browse files
authored
Merge pull request #55 from joreilly/theme
add missing theme files
2 parents c9975b4 + 1b475ad commit d8c5bd8

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package dev.johnoreilly.vertexai.ui.theme
2+
3+
import androidx.compose.material3.ColorScheme
4+
import androidx.compose.material3.darkColorScheme
5+
import androidx.compose.material3.lightColorScheme
6+
import androidx.compose.ui.graphics.Color
7+
8+
// Firebase AI Logic inspired colors
9+
val FirebaseBlue = Color(0xFF1A73E8)
10+
val FirebaseLightBlue = Color(0xFF4285F4)
11+
val FirebaseAmber = Color(0xFFF57C00)
12+
val FirebaseRed = Color(0xFFEA4335)
13+
val FirebaseGreen = Color(0xFF34A853)
14+
val FirebaseYellow = Color(0xFFFBBC04)
15+
16+
// Light theme background colors
17+
val LightBackground = Color(0xFFF8F9FA)
18+
val LightSurface = Color(0xFFFFFFFF)
19+
val LightSurfaceVariant = Color(0xFFE1E3E1)
20+
21+
// Dark theme background colors
22+
val DarkBackground = Color(0xFF1F1F1F)
23+
val DarkSurface = Color(0xFF121212)
24+
val DarkSurfaceVariant = Color(0xFF2D2D2D)
25+
26+
// Text colors
27+
val LightOnBackground = Color(0xFF1F1F1F)
28+
val DarkOnBackground = Color(0xFFF8F9FA)
29+
30+
// Firebase AI Logic inspired light theme
31+
val FirebaseAILogicLightColors = lightColorScheme(
32+
primary = FirebaseBlue,
33+
onPrimary = Color.White,
34+
primaryContainer = FirebaseLightBlue.copy(alpha = 0.15f),
35+
onPrimaryContainer = FirebaseBlue,
36+
secondary = FirebaseAmber,
37+
onSecondary = Color.White,
38+
secondaryContainer = FirebaseAmber.copy(alpha = 0.15f),
39+
onSecondaryContainer = FirebaseAmber,
40+
tertiary = FirebaseGreen,
41+
onTertiary = Color.White,
42+
tertiaryContainer = FirebaseGreen.copy(alpha = 0.15f),
43+
onTertiaryContainer = FirebaseGreen,
44+
error = FirebaseRed,
45+
onError = Color.White,
46+
errorContainer = FirebaseRed.copy(alpha = 0.15f),
47+
onErrorContainer = FirebaseRed,
48+
background = LightBackground,
49+
onBackground = LightOnBackground,
50+
surface = LightSurface,
51+
onSurface = LightOnBackground,
52+
surfaceVariant = LightSurfaceVariant,
53+
onSurfaceVariant = LightOnBackground.copy(alpha = 0.7f)
54+
)
55+
56+
// Firebase AI Logic inspired dark theme
57+
val FirebaseAILogicDarkColors = darkColorScheme(
58+
primary = FirebaseLightBlue,
59+
onPrimary = Color.White,
60+
primaryContainer = FirebaseBlue.copy(alpha = 0.25f),
61+
onPrimaryContainer = Color.White,
62+
secondary = FirebaseAmber,
63+
onSecondary = Color.Black,
64+
secondaryContainer = FirebaseAmber.copy(alpha = 0.25f),
65+
onSecondaryContainer = FirebaseAmber,
66+
tertiary = FirebaseGreen,
67+
onTertiary = Color.Black,
68+
tertiaryContainer = FirebaseGreen.copy(alpha = 0.25f),
69+
onTertiaryContainer = FirebaseGreen,
70+
error = FirebaseRed,
71+
onError = Color.White,
72+
errorContainer = FirebaseRed.copy(alpha = 0.25f),
73+
onErrorContainer = FirebaseRed,
74+
background = DarkBackground,
75+
onBackground = DarkOnBackground,
76+
surface = DarkSurface,
77+
onSurface = DarkOnBackground,
78+
surfaceVariant = DarkSurfaceVariant,
79+
onSurfaceVariant = DarkOnBackground.copy(alpha = 0.7f)
80+
)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
package dev.johnoreilly.vertexai.ui.theme
2+
3+
import androidx.compose.foundation.isSystemInDarkTheme
4+
import androidx.compose.material3.MaterialTheme
5+
import androidx.compose.material3.Typography
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.text.TextStyle
8+
import androidx.compose.ui.text.font.FontFamily
9+
import androidx.compose.ui.text.font.FontWeight
10+
import androidx.compose.ui.unit.sp
11+
12+
// Typography based on Material3 defaults with Firebase styling
13+
private val AppTypography = Typography(
14+
displayLarge = TextStyle(
15+
fontWeight = FontWeight.Normal,
16+
fontSize = 57.sp,
17+
lineHeight = 64.sp,
18+
letterSpacing = (-0.25).sp
19+
),
20+
displayMedium = TextStyle(
21+
fontWeight = FontWeight.Normal,
22+
fontSize = 45.sp,
23+
lineHeight = 52.sp,
24+
letterSpacing = 0.sp
25+
),
26+
displaySmall = TextStyle(
27+
fontWeight = FontWeight.Normal,
28+
fontSize = 36.sp,
29+
lineHeight = 44.sp,
30+
letterSpacing = 0.sp
31+
),
32+
headlineLarge = TextStyle(
33+
fontWeight = FontWeight.SemiBold,
34+
fontSize = 32.sp,
35+
lineHeight = 40.sp,
36+
letterSpacing = 0.sp
37+
),
38+
headlineMedium = TextStyle(
39+
fontWeight = FontWeight.SemiBold,
40+
fontSize = 28.sp,
41+
lineHeight = 36.sp,
42+
letterSpacing = 0.sp
43+
),
44+
headlineSmall = TextStyle(
45+
fontWeight = FontWeight.SemiBold,
46+
fontSize = 24.sp,
47+
lineHeight = 32.sp,
48+
letterSpacing = 0.sp
49+
),
50+
titleLarge = TextStyle(
51+
fontWeight = FontWeight.SemiBold,
52+
fontSize = 22.sp,
53+
lineHeight = 28.sp,
54+
letterSpacing = 0.sp
55+
),
56+
titleMedium = TextStyle(
57+
fontWeight = FontWeight.SemiBold,
58+
fontSize = 16.sp,
59+
lineHeight = 24.sp,
60+
letterSpacing = 0.15.sp
61+
),
62+
titleSmall = TextStyle(
63+
fontWeight = FontWeight.Bold,
64+
fontSize = 14.sp,
65+
lineHeight = 20.sp,
66+
letterSpacing = 0.1.sp
67+
),
68+
bodyLarge = TextStyle(
69+
fontWeight = FontWeight.Normal,
70+
fontSize = 16.sp,
71+
lineHeight = 24.sp,
72+
letterSpacing = 0.5.sp
73+
),
74+
bodyMedium = TextStyle(
75+
fontWeight = FontWeight.Normal,
76+
fontSize = 14.sp,
77+
lineHeight = 20.sp,
78+
letterSpacing = 0.25.sp
79+
),
80+
bodySmall = TextStyle(
81+
fontWeight = FontWeight.Normal,
82+
fontSize = 12.sp,
83+
lineHeight = 16.sp,
84+
letterSpacing = 0.4.sp
85+
),
86+
labelLarge = TextStyle(
87+
fontWeight = FontWeight.Medium,
88+
fontSize = 14.sp,
89+
lineHeight = 20.sp,
90+
letterSpacing = 0.1.sp
91+
),
92+
labelMedium = TextStyle(
93+
fontWeight = FontWeight.Medium,
94+
fontSize = 12.sp,
95+
lineHeight = 16.sp,
96+
letterSpacing = 0.5.sp
97+
),
98+
labelSmall = TextStyle(
99+
fontWeight = FontWeight.Medium,
100+
fontSize = 11.sp,
101+
lineHeight = 16.sp,
102+
letterSpacing = 0.5.sp
103+
)
104+
)
105+
106+
@Composable
107+
fun FirebaseAILogicTheme(
108+
darkTheme: Boolean = isSystemInDarkTheme(),
109+
content: @Composable () -> Unit
110+
) {
111+
val colorScheme = if (darkTheme) {
112+
FirebaseAILogicDarkColors
113+
} else {
114+
FirebaseAILogicLightColors
115+
}
116+
117+
MaterialTheme(
118+
colorScheme = colorScheme,
119+
typography = AppTypography,
120+
content = content
121+
)
122+
}

0 commit comments

Comments
 (0)