mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
build: initialize project structure
Set up Android project configuration, Gradle build scripts, typography, and default resource assets.
This commit is contained in:
1 parent
0a595f619a
commit
f13d46f778
65 files changed
+6056
-11
No files matched your search
@@ -0,0 +1,49 @@
|
||||
package com.example.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
// Dark Palette (Default & Organic Elegant)
|
||||
val DarkPrimary = Color(0xFF8CD4A8)
|
||||
val DarkOnPrimary = Color(0xFF0F3820)
|
||||
val DarkPrimaryContainer = Color(0xFF1E482E)
|
||||
val DarkOnPrimaryContainer = Color(0xFFC5F2D7)
|
||||
|
||||
val DarkSecondary = Color(0xFFF0B87A)
|
||||
val DarkOnSecondary = Color(0xFF452B07)
|
||||
val DarkSecondaryContainer = Color(0xFF5D3E10)
|
||||
val DarkOnSecondaryContainer = Color(0xFFFCE7CB)
|
||||
|
||||
val DarkTertiary = Color(0xFF8DCED8)
|
||||
val DarkOnTertiary = Color(0xFF00363D)
|
||||
|
||||
val DarkBackground = Color(0xFF111513)
|
||||
val DarkOnBackground = Color(0xFFE2E7E2)
|
||||
val DarkSurface = Color(0xFF191F1C)
|
||||
val DarkOnSurface = Color(0xFFE2E7E2)
|
||||
val DarkSurfaceVariant = Color(0xFF242C27)
|
||||
val DarkOnSurfaceVariant = Color(0xFFBAC3BC)
|
||||
val DarkOutline = Color(0xFF536056)
|
||||
val DarkOutlineVariant = Color(0xFF2C362F)
|
||||
|
||||
// Light Palette (Warm Linen & Forest)
|
||||
val LightPrimary = Color(0xFF246944)
|
||||
val LightOnPrimary = Color(0xFFFFFFFF)
|
||||
val LightPrimaryContainer = Color(0xFFC5F2D7)
|
||||
val LightOnPrimaryContainer = Color(0xFF062112)
|
||||
|
||||
val LightSecondary = Color(0xFF865306)
|
||||
val LightOnSecondary = Color(0xFFFFFFFF)
|
||||
val LightSecondaryContainer = Color(0xFFFCE7CB)
|
||||
val LightOnSecondaryContainer = Color(0xFF2C1700)
|
||||
|
||||
val LightTertiary = Color(0xFF1A6773)
|
||||
val LightOnTertiary = Color(0xFFFFFFFF)
|
||||
|
||||
val LightBackground = Color(0xFFF8F9F5)
|
||||
val LightOnBackground = Color(0xFF191F1C)
|
||||
val LightSurface = Color(0xFFFFFFFF)
|
||||
val LightOnSurface = Color(0xFF191F1C)
|
||||
val LightSurfaceVariant = Color(0xFFE3E9E3)
|
||||
val LightOnSurfaceVariant = Color(0xFF424A44)
|
||||
val LightOutline = Color(0xFF727A73)
|
||||
val LightOutlineVariant = Color(0xFFC2C9C2)
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.example.ui.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
enum class AppThemeMode(val displayName: String) {
|
||||
DARK("Sombre élégant (défaut)"),
|
||||
LIGHT("Clair lin & forêt"),
|
||||
SYSTEM("Suivre le système")
|
||||
}
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = DarkPrimary,
|
||||
onPrimary = DarkOnPrimary,
|
||||
primaryContainer = DarkPrimaryContainer,
|
||||
onPrimaryContainer = DarkOnPrimaryContainer,
|
||||
secondary = DarkSecondary,
|
||||
onSecondary = DarkOnSecondary,
|
||||
secondaryContainer = DarkSecondaryContainer,
|
||||
onSecondaryContainer = DarkOnSecondaryContainer,
|
||||
tertiary = DarkTertiary,
|
||||
onTertiary = DarkOnTertiary,
|
||||
background = DarkBackground,
|
||||
onBackground = DarkOnBackground,
|
||||
surface = DarkSurface,
|
||||
onSurface = DarkOnSurface,
|
||||
surfaceVariant = DarkSurfaceVariant,
|
||||
onSurfaceVariant = DarkOnSurfaceVariant,
|
||||
outline = DarkOutline,
|
||||
outlineVariant = DarkOutlineVariant
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = LightPrimary,
|
||||
onPrimary = LightOnPrimary,
|
||||
primaryContainer = LightPrimaryContainer,
|
||||
onPrimaryContainer = LightOnPrimaryContainer,
|
||||
secondary = LightSecondary,
|
||||
onSecondary = LightOnSecondary,
|
||||
secondaryContainer = LightSecondaryContainer,
|
||||
onSecondaryContainer = LightOnSecondaryContainer,
|
||||
tertiary = LightTertiary,
|
||||
onTertiary = LightOnTertiary,
|
||||
background = LightBackground,
|
||||
onBackground = LightOnBackground,
|
||||
surface = LightSurface,
|
||||
onSurface = LightOnSurface,
|
||||
surfaceVariant = LightSurfaceVariant,
|
||||
onSurfaceVariant = LightOnSurfaceVariant,
|
||||
outline = LightOutline,
|
||||
outlineVariant = LightOutlineVariant
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun SatieaTheme(
|
||||
themeMode: AppThemeMode = AppThemeMode.DARK,
|
||||
dynamicColor: Boolean = false,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val darkTheme = when (themeMode) {
|
||||
AppThemeMode.DARK -> true
|
||||
AppThemeMode.LIGHT -> false
|
||||
AppThemeMode.SYSTEM -> isSystemInDarkTheme()
|
||||
}
|
||||
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
darkTheme -> DarkColorScheme
|
||||
else -> LightColorScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.example.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.R
|
||||
|
||||
val FrauncesFontFamily = FontFamily(
|
||||
Font(R.font.fraunces, FontWeight.Normal),
|
||||
Font(R.font.fraunces, FontWeight.SemiBold),
|
||||
Font(R.font.fraunces, FontWeight.Bold)
|
||||
)
|
||||
|
||||
val PlusJakartaSansFontFamily = FontFamily(
|
||||
Font(R.font.plus_jakarta_sans, FontWeight.Normal),
|
||||
Font(R.font.plus_jakarta_sans, FontWeight.Medium),
|
||||
Font(R.font.plus_jakarta_sans, FontWeight.SemiBold),
|
||||
Font(R.font.plus_jakarta_sans, FontWeight.Bold)
|
||||
)
|
||||
|
||||
val Typography = Typography(
|
||||
displayLarge = TextStyle(
|
||||
fontFamily = FrauncesFontFamily,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 40.sp,
|
||||
lineHeight = 48.sp,
|
||||
letterSpacing = (-0.5).sp
|
||||
),
|
||||
displayMedium = TextStyle(
|
||||
fontFamily = FrauncesFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 32.sp,
|
||||
lineHeight = 38.sp
|
||||
),
|
||||
headlineLarge = TextStyle(
|
||||
fontFamily = FrauncesFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 26.sp,
|
||||
lineHeight = 32.sp
|
||||
),
|
||||
headlineMedium = TextStyle(
|
||||
fontFamily = FrauncesFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 22.sp,
|
||||
lineHeight = 28.sp
|
||||
),
|
||||
titleLarge = TextStyle(
|
||||
fontFamily = FrauncesFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 19.sp,
|
||||
lineHeight = 24.sp
|
||||
),
|
||||
titleMedium = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 22.sp
|
||||
),
|
||||
titleSmall = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp
|
||||
),
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp
|
||||
),
|
||||
bodyMedium = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp
|
||||
),
|
||||
bodySmall = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp
|
||||
),
|
||||
labelLarge = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 20.sp
|
||||
),
|
||||
labelMedium = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp
|
||||
),
|
||||
labelSmall = TextStyle(
|
||||
fontFamily = PlusJakartaSansFontFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 11.sp,
|
||||
lineHeight = 14.sp
|
||||
)
|
||||
)
|
||||
Reference in new issue
Block a user