Add AllInColorToken to provide colors instead of AllInTheme
continuous-integration/drone/push Build is passing Details

pull/5/head
avalin 1 year ago
parent 9bf19b70a2
commit fda26944d3

@ -7,7 +7,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.SolidColor
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.data.model.bet.BetStatus import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInColorToken
@StringRes @StringRes
fun BetStatus.getTitleId(): Int { fun BetStatus.getTitleId(): Int {
@ -39,20 +39,20 @@ fun BetStatus.getDateEndLabelId(): Int {
@Composable @Composable
fun BetStatus.getColor(): Color { fun BetStatus.getColor(): Color {
return when (this) { return when (this) {
BetStatus.FINISHED -> AllInTheme.colors.allInBetFinish BetStatus.FINISHED -> AllInColorToken.allInBetFinish
BetStatus.IN_PROGRESS -> AllInTheme.colors.allInBetInProgress BetStatus.IN_PROGRESS -> AllInColorToken.allInBetInProgress
BetStatus.WAITING -> AllInTheme.colors.allInBetWaiting BetStatus.WAITING -> AllInColorToken.allInBetWaiting
else -> AllInTheme.colors.allInBetFinish // TODO else -> AllInColorToken.allInBetFinish // TODO
} }
} }
@Composable @Composable
fun BetStatus.getTextColor(): Color { fun BetStatus.getTextColor(): Color {
return when (this) { return when (this) {
BetStatus.FINISHED -> AllInTheme.colors.allInBetFinishText BetStatus.FINISHED -> AllInColorToken.allInBetFinishText
BetStatus.IN_PROGRESS -> AllInTheme.colors.allInBetInProgressText BetStatus.IN_PROGRESS -> AllInColorToken.allInBetInProgressText
BetStatus.WAITING -> AllInTheme.colors.allInBetWaitingText BetStatus.WAITING -> AllInColorToken.allInBetWaitingText
else -> AllInTheme.colors.allInBetFinishText // TODO else -> AllInColorToken.allInBetFinishText // TODO
} }
} }
@ -70,8 +70,8 @@ fun BetStatus.getBetHistoryPhrase(won: Boolean): Int {
fun BetStatus.getBetHistoryStatusColor(won: Boolean): Brush { fun BetStatus.getBetHistoryStatusColor(won: Boolean): Brush {
return when (this) { return when (this) {
BetStatus.FINISHED -> BetStatus.FINISHED ->
if (won) AllInTheme.colors.allInMainGradient else AllInTheme.colors.allInDarkGradient if (won) AllInColorToken.allInMainGradient else AllInColorToken.allInDarkGradient
else -> SolidColor(AllInTheme.colors.allInDarkGrey100) else -> SolidColor(AllInColorToken.allInDarkGrey100)
} }
} }

@ -2,91 +2,12 @@ package fr.iut.alldev.allin.theme
import androidx.compose.runtime.Immutable import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
@Immutable @Immutable
data class AllInColors( data class AllInColors(
val allInDark: Color,
val allInDarkGrey300: Color,
val allInDarkGrey200: Color,
val allInDarkGrey100: Color,
val allInDarkGrey50: Color,
val allInGrey: Color,
val allInLightGrey300: Color,
val allInLightGrey200: Color,
val allInLightGrey100: Color,
val allInLightGrey50: Color,
val allInWhite: Color,
val white: Color,
val black: Color,
val allInPink: Color,
val allInMint: Color,
val allInPurple: Color,
val allInLoginPurple: Color,
val allInBlue: Color,
val allInDarkBlue: Color,
val allInBarPurple: Color,
val allInBarPink: Color,
val allInBarViolet: Color,
val allInBetFinish: Color,
val allInBetInProgress: Color,
val allInBetWaiting: Color,
val allInBetFinishText: Color,
val allInBetInProgressText: Color,
val allInBetWaitingText: Color,
val allInMainGradient: Brush,
val allInMainGradientReverse: Brush,
val allInBar1stGradient: Brush,
val allInBar2ndGradient: Brush,
val allInTextGradient: Brush,
val allInLoginGradient: Brush,
val allInDarkGradient: Brush,
)
internal val LocalColors = staticCompositionLocalOf {
AllInColors(
allInDark = Color.Unspecified,
allInDarkGrey300 = Color.Unspecified,
allInDarkGrey200 = Color.Unspecified,
allInDarkGrey100 = Color.Unspecified,
allInDarkGrey50 = Color.Unspecified,
allInGrey = Color.Unspecified,
allInLightGrey300 = Color.Unspecified,
allInLightGrey200 = Color.Unspecified,
allInLightGrey100 = Color.Unspecified,
allInLightGrey50 = Color.Unspecified,
allInWhite = Color.Unspecified,
white = Color.Unspecified,
black = Color.Unspecified,
allInPink = Color.Unspecified,
allInPurple = Color.Unspecified,
allInLoginPurple = Color.Unspecified,
allInBarPurple = Color.Unspecified,
allInBarPink = Color.Unspecified,
allInBarViolet = Color.Unspecified,
allInBlue = Color.Unspecified,
allInMint = Color.Unspecified,
allInDarkBlue = Color.Unspecified,
allInBetFinish = Color.Unspecified,
allInBetInProgress = Color.Unspecified,
allInBetWaiting = Color.Unspecified,
allInBetFinishText = Color.Unspecified,
allInBetInProgressText = Color.Unspecified,
allInBetWaitingText = Color.Unspecified,
allInMainGradient = SolidColor(Color.Unspecified),
allInMainGradientReverse = SolidColor(Color.Unspecified),
allInBar1stGradient = SolidColor(Color.Unspecified),
allInBar2ndGradient = SolidColor(Color.Unspecified),
allInTextGradient = SolidColor(Color.Unspecified),
allInLoginGradient = SolidColor(Color.Unspecified),
allInDarkGradient = SolidColor(Color.Unspecified)
)
}
@Immutable
data class AllInThemeColors(
val mainSurface: Color, val mainSurface: Color,
val onMainSurface: Color, val onMainSurface: Color,
val background: Color, val background: Color,
@ -99,8 +20,8 @@ data class AllInThemeColors(
val disabledBorder: Color, val disabledBorder: Color,
) )
internal val LocalThemeColors = staticCompositionLocalOf { internal val LocalColors = staticCompositionLocalOf {
AllInThemeColors( AllInColors(
mainSurface = Color.Unspecified, mainSurface = Color.Unspecified,
onMainSurface = Color.Unspecified, onMainSurface = Color.Unspecified,
background = Color.Unspecified, background = Color.Unspecified,
@ -113,3 +34,75 @@ internal val LocalThemeColors = staticCompositionLocalOf {
disabledBorder = Color.Unspecified disabledBorder = Color.Unspecified
) )
} }
internal object AllInColorToken {
val black = Color(0xFF000000)
val allInDark = Color(0xFF2A2A2A)
val allInDarkGrey300 = Color(0xFF1c1c1c)
val allInDarkGrey200 = Color(0xFF262626)
val allInDarkGrey100 = Color(0xFF393939)
val allInDarkGrey50 = Color(0xFF454545)
val allInGrey = Color(0xFF525252)
val allInLightGrey300 = Color(0XFFAAAAAA)
val allInLightGrey200 = Color(0XFFC5C5C5)
val allInLightGrey100 = Color(0XFFEBEBEB)
val allInLightGrey50 = Color(0XFFF7F7F7)
val allInWhite = Color(0xFFEBEBF6)
val white = Color(0xFFFFFFFF)
val allInDarkBlue = Color(0xFF323078)
val allInBlue = Color(0xFF6a89fa)
val allInPurple = Color(0xFF7D79FF)
val allInLoginPurple = Color(0xFF7F7BFB)
val allInBarPurple = Color(0xFF846AC9)
val allInPink = Color(0xFFFF2A89)
val allInBarPink = Color(0xFFFE2B8A)
val allInBarViolet = Color(0xFFC249A8)
val allInMint = Color(0xFFC4DEE9)
val allInBetFinish = Color(0xFF353535)
val allInBetInProgress = Color(0xFF604BDB)
val allInBetWaiting = Color(0xFFDF3B9A)
val allInBetFinishText = Color(0xFFA7A7A7)
val allInBetInProgressText = Color(0xFF4636A3)
val allInBetWaitingText = Color(0xFF852E6C)
val allInMainGradient = Brush.linearGradient(
0.0f to Color(0xFFf951a8),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFF199fee),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
)
val allInMainGradientReverse = Brush.linearGradient(
0.0f to Color(0xFF199fee),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFFf951a8),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
)
val allInBar1stGradient = Brush.horizontalGradient(
0.0f to Color(0xFF2599F8),
1.0f to Color(0xFF846AC9)
)
val allInBar2ndGradient = Brush.horizontalGradient(
0.0f to Color(0xFFFE2B8A),
1.0f to Color(0xFFC249A8)
)
val allInTextGradient = Brush.horizontalGradient(
0.0f to Color(0xFFF876C1),
1.0f to Color(0xFF2399F8)
)
val allInLoginGradient = Brush.linearGradient(
0.0f to Color(0xFFEC1794),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFF00EEEE),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
)
val allInDarkGradient = Brush.horizontalGradient(
0.0f to Color(0xFF595959),
1.0f to Color(0xFF000000)
)
}

@ -6,8 +6,6 @@ import androidx.compose.material.ripple.RippleTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
@ -19,75 +17,6 @@ import fr.iut.alldev.allin.R
fun AllInTheme( fun AllInTheme(
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
val customColors = AllInColors(
allInDark = Color(0xFF2A2A2A),
allInDarkGrey300 = Color(0xFF1c1c1c),
allInDarkGrey200 = Color(0xFF262626),
allInDarkGrey100 = Color(0xFF393939),
allInDarkGrey50 = Color(0xFF454545),
allInGrey = Color(0xFF525252),
allInLightGrey300 = Color(0XFFAAAAAA),
allInLightGrey200 = Color(0XFFC5C5C5),
allInLightGrey100 = Color(0XFFEBEBEB),
allInLightGrey50 = Color(0XFFF7F7F7),
allInWhite = Color(0xFFEBEBF6),
white = Color(0xFFFFFFFF),
black = Color(0xFF000000),
allInPink = Color(0xFFFF2A89),
allInPurple = Color(0xFF7D79FF),
allInLoginPurple = Color(0xFF7F7BFB),
allInBarPurple = Color(0xFF846AC9),
allInBarPink = Color(0xFFFE2B8A),
allInBarViolet = Color(0xFFC249A8),
allInBlue = Color(0xFF6a89fa),
allInMint = Color(0xFFC4DEE9),
allInDarkBlue = Color(0xFF323078),
allInBetFinish = Color(0xFF353535),
allInBetInProgress = Color(0xFF604BDB),
allInBetWaiting = Color(0xFFDF3B9A),
allInBetFinishText = Color(0xFFA7A7A7),
allInBetInProgressText = Color(0xFF4636A3),
allInBetWaitingText = Color(0xFF852E6C),
allInMainGradient = Brush.linearGradient(
0.0f to Color(0xFFf951a8),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFF199fee),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
),
allInMainGradientReverse = Brush.linearGradient(
0.0f to Color(0xFF199fee),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFFf951a8),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
),
allInBar1stGradient = Brush.horizontalGradient(
0.0f to Color(0xFF2599F8),
1.0f to Color(0xFF846AC9)
),
allInBar2ndGradient = Brush.horizontalGradient(
0.0f to Color(0xFFFE2B8A),
1.0f to Color(0xFFC249A8)
),
allInTextGradient = Brush.horizontalGradient(
0.0f to Color(0xFFF876C1),
1.0f to Color(0xFF2399F8)
),
allInLoginGradient = Brush.linearGradient(
0.0f to Color(0xFFEC1794),
0.5f to Color(0xFFaa7ef3),
1.0f to Color(0xFF00EEEE),
start = Offset(0f, Float.POSITIVE_INFINITY),
end = Offset(Float.POSITIVE_INFINITY, 0f)
),
allInDarkGradient = Brush.horizontalGradient(
0.0f to Color(0xFF595959),
1.0f to Color(0xFF000000)
)
)
val customTypography = AllInTypography( val customTypography = AllInTypography(
h1 = TextStyle( h1 = TextStyle(
fontFamily = fontFamilyPlusJakartaSans, fontFamily = fontFamilyPlusJakartaSans,
@ -120,30 +49,30 @@ fun AllInTheme(
) )
val customTheme = if (isSystemInDarkTheme()) { val customTheme = if (isSystemInDarkTheme()) {
AllInThemeColors( AllInColors(
mainSurface = customColors.allInDarkGrey300, mainSurface = AllInColorToken.allInDarkGrey300,
onMainSurface = customColors.allInWhite, onMainSurface = AllInColorToken.allInWhite,
background = customColors.allInDarkGrey200, background = AllInColorToken.allInDarkGrey200,
onBackground = customColors.white, onBackground = AllInColorToken.white,
tint1 = customColors.white, tint1 = AllInColorToken.white,
background2 = customColors.allInDark, background2 = AllInColorToken.allInDark,
onBackground2 = customColors.allInLightGrey200, onBackground2 = AllInColorToken.allInLightGrey200,
border = customColors.allInDarkGrey100, border = AllInColorToken.allInDarkGrey100,
disabled = customColors.allInDarkGrey200, disabled = AllInColorToken.allInDarkGrey200,
disabledBorder = customColors.allInDarkGrey100 disabledBorder = AllInColorToken.allInDarkGrey100
) )
} else { } else {
AllInThemeColors( AllInColors(
mainSurface = customColors.allInWhite, mainSurface = AllInColorToken.allInWhite,
onMainSurface = customColors.allInDark, onMainSurface = AllInColorToken.allInDark,
background = customColors.white, background = AllInColorToken.white,
onBackground = customColors.allInDarkBlue, onBackground = AllInColorToken.allInDarkBlue,
tint1 = customColors.allInLoginPurple, tint1 = AllInColorToken.allInLoginPurple,
background2 = customColors.allInLightGrey50, background2 = AllInColorToken.allInLightGrey50,
onBackground2 = customColors.allInLightGrey300, onBackground2 = AllInColorToken.allInLightGrey300,
border = customColors.allInLightGrey100, border = AllInColorToken.allInLightGrey100,
disabled = customColors.allInLightGrey100, disabled = AllInColorToken.allInLightGrey100,
disabledBorder = customColors.allInLightGrey200 disabledBorder = AllInColorToken.allInLightGrey200
) )
} }
@ -154,21 +83,15 @@ fun AllInTheme(
) )
CompositionLocalProvider( CompositionLocalProvider(
LocalColors provides customColors,
LocalIcons provides customIcons, LocalIcons provides customIcons,
LocalTypography provides customTypography, LocalTypography provides customTypography,
LocalThemeColors provides customTheme LocalColors provides customTheme
) { ) {
content() content()
} }
} }
object AllInTheme { object AllInTheme {
val colors: AllInColors
@Composable
@ReadOnlyComposable
get() = LocalColors.current
val icons: AllInIcons val icons: AllInIcons
@Composable @Composable
@ReadOnlyComposable @ReadOnlyComposable
@ -179,10 +102,10 @@ object AllInTheme {
@ReadOnlyComposable @ReadOnlyComposable
get() = LocalTypography.current get() = LocalTypography.current
val themeColors: AllInThemeColors val colors: AllInColors
@Composable @Composable
@ReadOnlyComposable @ReadOnlyComposable
get() = LocalThemeColors.current get() = LocalColors.current
} }

@ -90,7 +90,7 @@ fun BetScreen(
modifier = Modifier modifier = Modifier
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
0.5f to AllInTheme.themeColors.mainSurface, 0.5f to AllInTheme.colors.mainSurface,
1f to Color.Transparent 1f to Color.Transparent
) )
) )

@ -59,11 +59,11 @@ fun BetScreenCard(
} }
HorizontalDivider( HorizontalDivider(
thickness = 1.dp, thickness = 1.dp,
color = AllInTheme.themeColors.border color = AllInTheme.colors.border
) )
Column( Column(
Modifier Modifier
.background(AllInTheme.themeColors.background2) .background(AllInTheme.colors.background2)
) { ) {
Row( Row(
modifier = Modifier modifier = Modifier
@ -80,7 +80,7 @@ fun BetScreenCard(
players.size players.size
), ),
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.themeColors.onBackground2 color = AllInTheme.colors.onBackground2
) )
} }
RainbowButton( RainbowButton(

@ -24,6 +24,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ext.shadow import fr.iut.alldev.allin.ext.shadow
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.HighlightedText import fr.iut.alldev.allin.ui.core.HighlightedText
@ -43,8 +44,8 @@ fun BetScreenPopularCard(
if (isSystemInDarkTheme()) { if (isSystemInDarkTheme()) {
it.shadow( it.shadow(
colors = listOf( colors = listOf(
AllInTheme.colors.allInPink, AllInColorToken.allInPink,
AllInTheme.colors.allInBlue AllInColorToken.allInBlue
), ),
blurRadius = 10.dp, blurRadius = 10.dp,
alpha = .5f, alpha = .5f,
@ -60,9 +61,9 @@ fun BetScreenPopularCard(
} }
} }
.fillMaxWidth(), .fillMaxWidth(),
backgroundColor = AllInTheme.colors.allInDark, backgroundColor = AllInColorToken.allInDark,
borderWidth = 2.dp, borderWidth = 2.dp,
borderBrush = AllInTheme.colors.allInMainGradient borderBrush = AllInColorToken.allInMainGradient
) { ) {
Column(modifier = Modifier.padding(13.dp)) { Column(modifier = Modifier.padding(13.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
@ -70,19 +71,19 @@ fun BetScreenPopularCard(
painter = painterResource(id = R.drawable.allin_fire), painter = painterResource(id = R.drawable.allin_fire),
modifier = Modifier.size(15.dp), modifier = Modifier.size(15.dp),
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInPink tint = AllInColorToken.allInPink
) )
Spacer(modifier = Modifier.width(3.dp)) Spacer(modifier = Modifier.width(3.dp))
Text( Text(
text = stringResource(id = R.string.Popular), text = stringResource(id = R.string.Popular),
color = AllInTheme.colors.allInPink, color = AllInColorToken.allInPink,
fontSize = 17.sp, fontSize = 17.sp,
style = AllInTheme.typography.h2 style = AllInTheme.typography.h2
) )
} }
Text( Text(
text = title, text = title,
color = AllInTheme.colors.white, color = AllInColorToken.white,
fontSize = 20.sp, fontSize = 20.sp,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
modifier = Modifier.padding(vertical = 22.dp) modifier = Modifier.padding(vertical = 22.dp)
@ -97,15 +98,15 @@ fun BetScreenPopularCard(
query = nbPlayers.toString(), query = nbPlayers.toString(),
highlightStyle = SpanStyle( highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = AllInTheme.colors.allInPink color = AllInColorToken.allInPink
), ),
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 15.sp fontSize = 15.sp
) )
Text( Text(
text = " - ", text = " - ",
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 15.sp fontSize = 15.sp
) )
@ -123,9 +124,9 @@ fun BetScreenPopularCard(
query = pointsText, query = pointsText,
highlightStyle = SpanStyle( highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = AllInTheme.colors.allInPink color = AllInColorToken.allInPink
), ),
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 15.sp fontSize = 15.sp
) )

@ -50,6 +50,7 @@ import fr.iut.alldev.allin.data.model.bet.YesNoBet
import fr.iut.alldev.allin.data.model.bet.vo.BetAnswerDetail import fr.iut.alldev.allin.data.model.bet.vo.BetAnswerDetail
import fr.iut.alldev.allin.data.model.bet.vo.BetDetail import fr.iut.alldev.allin.data.model.bet.vo.BetDetail
import fr.iut.alldev.allin.ext.formatToSimple import fr.iut.alldev.allin.ext.formatToSimple
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInBottomSheet import fr.iut.alldev.allin.ui.core.AllInBottomSheet
import fr.iut.alldev.allin.ui.core.AllInButton import fr.iut.alldev.allin.ui.core.AllInButton
@ -89,13 +90,13 @@ fun BetConfirmationBottomSheetAnswer(
text: String, text: String,
odds: Float, odds: Float,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
color: Color = AllInTheme.colors.allInBlue, color: Color = AllInColorToken.allInBlue,
isSelected: Boolean, isSelected: Boolean,
locale: Locale, locale: Locale,
onClick: () -> Unit onClick: () -> Unit
) { ) {
val backColor = if (isSelected) AllInTheme.colors.allInPurple else AllInTheme.colors.white val backColor = if (isSelected) AllInColorToken.allInPurple else AllInColorToken.white
val contentColor = if (isSelected) AllInTheme.colors.white else null val contentColor = if (isSelected) AllInColorToken.white else null
AllInCard( AllInCard(
backgroundColor = backColor, backgroundColor = backColor,
@ -117,7 +118,7 @@ fun BetConfirmationBottomSheetAnswer(
AllInCard( AllInCard(
radius = 50.dp, radius = 50.dp,
backgroundColor = contentColor ?: AllInTheme.colors.allInPurple, backgroundColor = contentColor ?: AllInColorToken.allInPurple,
modifier = Modifier.align(Alignment.CenterEnd) modifier = Modifier.align(Alignment.CenterEnd)
) { ) {
Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) { Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) {
@ -191,7 +192,7 @@ fun ConfirmationAnswers(
BetConfirmationBottomSheetAnswer( BetConfirmationBottomSheetAnswer(
text = it.response, text = it.response,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
odds = it.odds, odds = it.odds,
locale = locale, locale = locale,
onClick = { onClick(it.response) }, onClick = { onClick(it.response) },
@ -240,7 +241,7 @@ fun ConfirmationAnswers(
BetConfirmationBottomSheetAnswer( BetConfirmationBottomSheetAnswer(
text = it.response, text = it.response,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
odds = it.odds, odds = it.odds,
locale = locale, locale = locale,
onClick = { onClick(it.response) }, onClick = { onClick(it.response) },
@ -264,7 +265,7 @@ fun BetConfirmationBottomSheetContent(
) { ) {
var selectedAnswer by remember { mutableStateOf<String?>(null) } var selectedAnswer by remember { mutableStateOf<String?>(null) }
AllInMarqueeBox(backgroundColor = AllInTheme.colors.allInDarkGrey300) { AllInMarqueeBox(backgroundColor = AllInColorToken.allInDarkGrey300) {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
@ -279,7 +280,7 @@ fun BetConfirmationBottomSheetContent(
) { ) {
Icon( Icon(
imageVector = Icons.Default.Close, imageVector = Icons.Default.Close,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(24.dp) modifier = Modifier.size(24.dp)
) )
@ -288,7 +289,7 @@ fun BetConfirmationBottomSheetContent(
Icon( Icon(
painter = AllInTheme.icons.logo(), painter = AllInTheme.icons.logo(),
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
modifier = Modifier modifier = Modifier
.size(40.dp) .size(40.dp)
.align(Alignment.TopCenter) .align(Alignment.TopCenter)
@ -310,14 +311,14 @@ fun BetConfirmationBottomSheetContent(
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.background(AllInTheme.colors.allInMainGradient) .background(AllInColorToken.allInMainGradient)
.padding(16.dp), .padding(16.dp),
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
Text( Text(
text = stringResource(id = R.string.Finished), text = stringResource(id = R.string.Finished),
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 24.sp fontSize = 24.sp
) )
@ -325,7 +326,7 @@ fun BetConfirmationBottomSheetContent(
} }
Text( Text(
text = "Ce bet est arrivé à la date de fin. Vous devez à présent distribuer les gains en validant le pari gagnant.", text = "Ce bet est arrivé à la date de fin. Vous devez à présent distribuer les gains en validant le pari gagnant.",
color = AllInTheme.colors.allInLightGrey200, color = AllInColorToken.allInLightGrey200,
style = AllInTheme.typography.p2, style = AllInTheme.typography.p2,
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
@ -335,7 +336,7 @@ fun BetConfirmationBottomSheetContent(
Text( Text(
text = "Veuillez choisir la réponse finale :", text = "Veuillez choisir la réponse finale :",
fontSize = 20.sp, fontSize = 20.sp,
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) )
@ -346,9 +347,9 @@ fun BetConfirmationBottomSheetContent(
} }
if (selectedAnswer != null) { if (selectedAnswer != null) {
AllInButton( AllInButton(
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
text = stringResource(id = R.string.Validate), text = stringResource(id = R.string.Validate),
textColor = AllInTheme.colors.white, textColor = AllInColorToken.white,
radius = 5.dp, radius = 5.dp,
onClick = { selectedAnswer?.let(onConfirm) }, onClick = { selectedAnswer?.let(onConfirm) },
modifier = Modifier.align(Alignment.BottomCenter) modifier = Modifier.align(Alignment.BottomCenter)

@ -8,6 +8,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -17,7 +18,7 @@ fun BetCreationScreenBottomText(
) { ) {
Text( Text(
text = text, text = text,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,

@ -102,7 +102,7 @@ fun BetCreationScreenContent(
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
0f to Color.Transparent, 0f to Color.Transparent,
0.50f to AllInTheme.themeColors.mainSurface 0.50f to AllInTheme.colors.mainSurface
) )
), ),
) { ) {

@ -8,6 +8,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
@ -24,7 +25,7 @@ fun BetCreationScreenDateTimeButton(
) { ) {
Text( Text(
text = text, text = text,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
fontSize = 16.sp, fontSize = 16.sp,
modifier = Modifier.padding(horizontal = 23.dp, vertical = 9.dp) modifier = Modifier.padding(horizontal = 23.dp, vertical = 9.dp)

@ -16,6 +16,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
import fr.iut.alldev.allin.ui.core.AllInRadioButton import fr.iut.alldev.allin.ui.core.AllInRadioButton
@ -33,8 +34,8 @@ fun BetCreationScreenFriendLine(
.fillMaxWidth() .fillMaxWidth()
.clickable(onClick = onClick) .clickable(onClick = onClick)
.background( .background(
if (isSelected) AllInTheme.colors.allInPurple.copy(alpha = .13f) if (isSelected) AllInColorToken.allInPurple.copy(alpha = .13f)
else AllInTheme.themeColors.background else AllInTheme.colors.background
) )
.padding(15.dp), .padding(15.dp),
horizontalArrangement = Arrangement.spacedBy(7.dp), horizontalArrangement = Arrangement.spacedBy(7.dp),
@ -49,14 +50,14 @@ fun BetCreationScreenFriendLine(
text = username, text = username,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
) )
AllInCoinCount( AllInCoinCount(
amount = allCoinsAmount, amount = allCoinsAmount,
color = AllInTheme.colors.allInPurple color = AllInColorToken.allInPurple
) )
} }
} }

@ -116,7 +116,7 @@ fun QuestionTabPrivacySection(
} }
if (idx != 0) { if (idx != 0) {
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
} }
BetCreationScreenFriendLine( BetCreationScreenFriendLine(
username = "Dave", username = "Dave",

@ -14,7 +14,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.ui.core.AllInTextField import fr.iut.alldev.allin.ui.core.AllInTextField
import fr.iut.alldev.allin.ui.core.AllInTitleInfo import fr.iut.alldev.allin.ui.core.AllInTitleInfo
@ -44,7 +44,7 @@ internal fun QuestionTabThemePhraseSection(
placeholderFontSize = 13.sp, placeholderFontSize = 13.sp,
onValueChange = setBetTheme, onValueChange = setBetTheme,
errorText = betThemeError, errorText = betThemeError,
borderColor = AllInTheme.colors.white borderColor = AllInColorToken.white
) )
Spacer(modifier = Modifier.height(10.dp)) Spacer(modifier = Modifier.height(10.dp))
AllInTitleInfo( AllInTitleInfo(
@ -65,6 +65,6 @@ internal fun QuestionTabThemePhraseSection(
multiLine = true, multiLine = true,
onValueChange = setBetPhrase, onValueChange = setBetPhrase,
errorText = betPhraseError, errorText = betPhraseError,
borderColor = AllInTheme.colors.white borderColor = AllInColorToken.white
) )
} }

@ -24,6 +24,7 @@ import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.data.model.bet.BetStatus import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.ext.getBetHistoryPhrase import fr.iut.alldev.allin.ext.getBetHistoryPhrase
import fr.iut.alldev.allin.ext.getBetHistoryStatusColor import fr.iut.alldev.allin.ext.getBetHistoryStatusColor
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.preview.BetStatusPreviewProvider import fr.iut.alldev.allin.ui.preview.BetStatusPreviewProvider
@ -40,7 +41,7 @@ val betHistoryStatusInlineContent = mapOf(
) { ) {
Icon( Icon(
painter = AllInTheme.icons.allCoins(), painter = AllInTheme.icons.allCoins(),
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(24.dp) modifier = Modifier.size(24.dp)
) )
@ -70,7 +71,7 @@ fun BetHistoryBetStatus(
appendInlineContent(betHistoryStatusModId, "[icon]") appendInlineContent(betHistoryStatusModId, "[icon]")
append(betHistoryPhrase.substringAfter("[icon]")) append(betHistoryPhrase.substringAfter("[icon]"))
}, },
color = AllInTheme.colors.white, color = AllInColorToken.white,
inlineContent = betHistoryStatusInlineContent, inlineContent = betHistoryStatusInlineContent,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 24.sp fontSize = 24.sp

@ -15,6 +15,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.data.model.bet.BetStatus import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.ext.asPaddingValues import fr.iut.alldev.allin.ext.asPaddingValues
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -39,7 +40,7 @@ fun <T> GenericHistory(
Text( Text(
text = title, text = title,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
color = AllInTheme.colors.allInGrey, color = AllInColorToken.allInGrey,
fontSize = 24.sp, fontSize = 24.sp,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()

@ -22,6 +22,7 @@ import fr.iut.alldev.allin.data.ext.formatToTime
import fr.iut.alldev.allin.data.model.bet.Bet import fr.iut.alldev.allin.data.model.bet.Bet
import fr.iut.alldev.allin.data.model.bet.BetStatus import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.data.model.bet.YesNoBet import fr.iut.alldev.allin.data.model.bet.YesNoBet
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.betResult.components.BetResultBottomSheetBetCard import fr.iut.alldev.allin.ui.betResult.components.BetResultBottomSheetBetCard
import fr.iut.alldev.allin.ui.betResult.components.BetResultBottomSheetContentCoinAmount import fr.iut.alldev.allin.ui.betResult.components.BetResultBottomSheetContentCoinAmount
@ -70,7 +71,7 @@ fun BetResultBottomSheetContent(
odds: Float, odds: Float,
onClose: () -> Unit onClose: () -> Unit
) { ) {
AllInMarqueeBox(backgroundBrush = AllInTheme.colors.allInMainGradientReverse) { AllInMarqueeBox(backgroundBrush = AllInColorToken.allInMainGradientReverse) {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
@ -85,7 +86,7 @@ fun BetResultBottomSheetContent(
) { ) {
Icon( Icon(
imageVector = Icons.Default.Close, imageVector = Icons.Default.Close,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(24.dp) modifier = Modifier.size(24.dp)
) )
@ -94,7 +95,7 @@ fun BetResultBottomSheetContent(
Icon( Icon(
painter = AllInTheme.icons.logo(), painter = AllInTheme.icons.logo(),
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
modifier = Modifier modifier = Modifier
.size(40.dp) .size(40.dp)
.align(Alignment.TopCenter) .align(Alignment.TopCenter)

@ -16,6 +16,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
@ -30,7 +31,7 @@ fun BetResultBottomSheetBetCardStats(
Column( Column(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.background(AllInTheme.themeColors.background2) .background(AllInTheme.colors.background2)
.padding(horizontal = 19.dp, vertical = 11.dp), .padding(horizontal = 19.dp, vertical = 11.dp),
verticalArrangement = Arrangement.spacedBy(12.dp) verticalArrangement = Arrangement.spacedBy(12.dp)
) { ) {
@ -42,12 +43,12 @@ fun BetResultBottomSheetBetCardStats(
Text( Text(
text = stringResource(id = R.string.bet_result_stake), text = stringResource(id = R.string.bet_result_stake),
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.themeColors.onMainSurface color = AllInTheme.colors.onMainSurface
) )
AllInCoinCount( AllInCoinCount(
amount = stake, amount = stake,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
textStyle = AllInTheme.typography.sm1, textStyle = AllInTheme.typography.sm1,
position = IconPosition.TRAILING position = IconPosition.TRAILING
) )
@ -60,12 +61,12 @@ fun BetResultBottomSheetBetCardStats(
Text( Text(
text = stringResource(id = R.string.bet_result_winnings), text = stringResource(id = R.string.bet_result_winnings),
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.colors.allInPurple color = AllInColorToken.allInPurple
) )
AllInCoinCount( AllInCoinCount(
amount = winnings, amount = winnings,
textStyle = AllInTheme.typography.sm1, textStyle = AllInTheme.typography.sm1,
brush = AllInTheme.colors.allInMainGradient, brush = AllInColorToken.allInMainGradient,
position = IconPosition.TRAILING position = IconPosition.TRAILING
) )
} }
@ -78,17 +79,17 @@ fun BetResultBottomSheetBetCardStats(
Text( Text(
text = stringResource(id = R.string.bet_result_odds), text = stringResource(id = R.string.bet_result_odds),
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.themeColors.onBackground2 color = AllInTheme.colors.onBackground2
) )
AllInCard( AllInCard(
radius = 8.dp, radius = 8.dp,
backgroundBrush = AllInTheme.colors.allInMainGradient backgroundBrush = AllInColorToken.allInMainGradient
) { ) {
Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) { Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) {
Text( Text(
text = "$odds", text = "$odds",
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
color = AllInTheme.colors.white color = AllInColorToken.white
) )
} }
} }

@ -19,6 +19,7 @@ import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -54,18 +55,18 @@ fun BetResultBottomSheetContentCongratulations(
horizontalArrangement = Arrangement.spacedBy(8.dp) horizontalArrangement = Arrangement.spacedBy(8.dp)
) { ) {
Text( Text(
text= stringResource(id = R.string.bet_result_congratulations), text = stringResource(id = R.string.bet_result_congratulations),
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 25.sp, fontSize = 25.sp,
fontStyle = FontStyle.Italic, fontStyle = FontStyle.Italic,
color = AllInTheme.colors.white color = AllInColorToken.white
) )
Text( Text(
text = "${username.uppercase()} !", text = "${username.uppercase()} !",
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 30.sp, fontSize = 30.sp,
fontStyle = FontStyle.Italic, fontStyle = FontStyle.Italic,
color = AllInTheme.colors.white color = AllInColorToken.white
) )
} }
} }

@ -17,6 +17,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
import fr.iut.alldev.allin.ui.core.IconPosition import fr.iut.alldev.allin.ui.core.IconPosition
@ -33,7 +34,7 @@ fun BetResultBottomSheetContentCoinAmount(
Text( Text(
text = stringResource(id = R.string.bet_result_you_win), text = stringResource(id = R.string.bet_result_you_win),
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.colors.white, color = AllInColorToken.white,
fontSize = 20.sp fontSize = 20.sp
) )
@ -42,7 +43,7 @@ fun BetResultBottomSheetContentCoinAmount(
.border( .border(
width = 2.dp, width = 2.dp,
shape = RoundedCornerShape(100.dp), shape = RoundedCornerShape(100.dp),
color = AllInTheme.colors.white color = AllInColorToken.white
) )
.padding(vertical = 22.dp, horizontal = 33.dp) .padding(vertical = 22.dp, horizontal = 33.dp)
@ -51,7 +52,7 @@ fun BetResultBottomSheetContentCoinAmount(
amount = amount, amount = amount,
textStyle = AllInTheme.typography.h1, textStyle = AllInTheme.typography.h1,
position = IconPosition.TRAILING, position = IconPosition.TRAILING,
color = AllInTheme.colors.white, color = AllInColorToken.white,
size = 60, size = 60,
modifier = Modifier modifier = Modifier
.align(Alignment.Center) .align(Alignment.Center)
@ -61,7 +62,7 @@ fun BetResultBottomSheetContentCoinAmount(
amount = amount, amount = amount,
textStyle = AllInTheme.typography.h1, textStyle = AllInTheme.typography.h1,
position = IconPosition.TRAILING, position = IconPosition.TRAILING,
color = AllInTheme.colors.white.copy(alpha = .32f), color = AllInColorToken.white.copy(alpha = .32f),
size = 60, size = 60,
modifier = Modifier.align(Alignment.Center) modifier = Modifier.align(Alignment.Center)
) )

@ -19,6 +19,7 @@ import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.ext.getColor import fr.iut.alldev.allin.ext.getColor
import fr.iut.alldev.allin.ext.getTextColor import fr.iut.alldev.allin.ext.getTextColor
import fr.iut.alldev.allin.ext.getTitleId import fr.iut.alldev.allin.ext.getTitleId
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.betStatus.SHEET_HEIGHT import fr.iut.alldev.allin.ui.betStatus.SHEET_HEIGHT
import fr.iut.alldev.allin.ui.preview.BetStatusPreviewProvider import fr.iut.alldev.allin.ui.preview.BetStatusPreviewProvider
@ -50,7 +51,7 @@ fun BetStatusBottomSheetBack(
) )
Icon( Icon(
painter = painterResource(id = R.drawable.allin_exit), painter = painterResource(id = R.drawable.allin_exit),
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
contentDescription = null contentDescription = null
) )
} }

@ -28,6 +28,7 @@ import fr.iut.alldev.allin.data.model.bet.YES_VALUE
import fr.iut.alldev.allin.data.model.bet.YesNoBet import fr.iut.alldev.allin.data.model.bet.YesNoBet
import fr.iut.alldev.allin.data.model.bet.vo.BetDetail import fr.iut.alldev.allin.data.model.bet.vo.BetDetail
import fr.iut.alldev.allin.ext.formatToSimple import fr.iut.alldev.allin.ext.formatToSimple
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.preview.BetDetailPreviewProvider import fr.iut.alldev.allin.ui.preview.BetDetailPreviewProvider
@ -68,7 +69,7 @@ fun BetDetail.getParticipationAnswers(): List<@Composable RowScope.() -> Unit> {
this@getParticipationAnswers.getAnswerOfResponse(bet.nameTeam2)?.let { this@getParticipationAnswers.getAnswerOfResponse(bet.nameTeam2)?.let {
ParticipationAnswerLine( ParticipationAnswerLine(
text = it.response, text = it.response,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
odds = it.odds, odds = it.odds,
locale = locale locale = locale
) )
@ -90,7 +91,7 @@ fun BetDetail.getParticipationAnswers(): List<@Composable RowScope.() -> Unit> {
this@getParticipationAnswers.getAnswerOfResponse(NO_VALUE)?.let { this@getParticipationAnswers.getAnswerOfResponse(NO_VALUE)?.let {
ParticipationAnswerLine( ParticipationAnswerLine(
text = it.response, text = it.response,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
odds = it.odds, odds = it.odds,
locale = locale locale = locale
) )
@ -103,7 +104,7 @@ fun BetDetail.getParticipationAnswers(): List<@Composable RowScope.() -> Unit> {
@Composable @Composable
private fun ParticipationAnswerLine( private fun ParticipationAnswerLine(
text: String, text: String,
color: Color = AllInTheme.colors.allInBlue, color: Color = AllInColorToken.allInBlue,
locale: Locale, locale: Locale,
odds: Float odds: Float
) { ) {
@ -121,12 +122,12 @@ private fun ParticipationAnswerLine(
AllInCard( AllInCard(
radius = 50.dp, radius = 50.dp,
backgroundColor = AllInTheme.colors.allInPurple backgroundColor = AllInColorToken.allInPurple
) { ) {
Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) { Box(Modifier.padding(vertical = 4.dp, horizontal = 8.dp)) {
Text( Text(
text = "x${odds.formatToSimple(locale)}", text = "x${odds.formatToSimple(locale)}",
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h2 style = AllInTheme.typography.h2
) )
} }

@ -26,6 +26,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInBottomSheet import fr.iut.alldev.allin.ui.core.AllInBottomSheet
import fr.iut.alldev.allin.ui.core.AllInButton import fr.iut.alldev.allin.ui.core.AllInButton
@ -58,7 +59,7 @@ fun BetStatusParticipationBottomSheet(
sheetVisibility = sheetVisibility, sheetVisibility = sheetVisibility,
onDismiss = onDismiss, onDismiss = onDismiss,
state = state, state = state,
containerColor = AllInTheme.themeColors.background2 containerColor = AllInTheme.colors.background2
) { ) {
BetStatusParticipationBottomSheetContent( BetStatusParticipationBottomSheetContent(
betPhrase = betPhrase, betPhrase = betPhrase,
@ -103,15 +104,15 @@ private fun BetStatusParticipationBottomSheetContent(
Text( Text(
text = stringResource(id = R.string.place_your_bets), text = stringResource(id = R.string.place_your_bets),
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier.padding(start = 18.dp) modifier = Modifier.padding(start = 18.dp)
) )
AllInTopBarCoinCounter( AllInTopBarCoinCounter(
amount = coinAmount, amount = coinAmount,
backgroundColor = AllInTheme.colors.allInBlue, backgroundColor = AllInColorToken.allInBlue,
textColor = AllInTheme.colors.white, textColor = AllInColorToken.white,
iconColor = AllInTheme.colors.white, iconColor = AllInColorToken.white,
) )
} }
Column( Column(
@ -120,7 +121,7 @@ private fun BetStatusParticipationBottomSheetContent(
Text( Text(
text = betPhrase, text = betPhrase,
style = AllInTheme.typography.p2, style = AllInTheme.typography.p2,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
modifier = Modifier.padding(vertical = 30.dp) modifier = Modifier.padding(vertical = 30.dp)
) )
AllInSelectionBox( AllInSelectionBox(
@ -137,7 +138,7 @@ private fun BetStatusParticipationBottomSheetContent(
setValue = setStake, setValue = setStake,
textStyle = AllInTheme.typography.h1.copy( textStyle = AllInTheme.typography.h1.copy(
fontSize = 20.sp, fontSize = 20.sp,
color = AllInTheme.themeColors.onBackground color = AllInTheme.colors.onBackground
), ),
placeholder = stringResource(id = R.string.bet_result_stake), placeholder = stringResource(id = R.string.bet_result_stake),
trailingIcon = AllInTheme.icons.allCoins(), trailingIcon = AllInTheme.icons.allCoins(),
@ -146,10 +147,10 @@ private fun BetStatusParticipationBottomSheetContent(
) )
} }
Spacer(modifier = Modifier.height(100.dp)) Spacer(modifier = Modifier.height(100.dp))
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
Column( Column(
modifier = Modifier modifier = Modifier
.background(AllInTheme.themeColors.background) .background(AllInTheme.colors.background)
.padding(7.dp), .padding(7.dp),
verticalArrangement = Arrangement.spacedBy(7.dp) verticalArrangement = Arrangement.spacedBy(7.dp)
) { ) {
@ -161,18 +162,18 @@ private fun BetStatusParticipationBottomSheetContent(
Text( Text(
text = stringResource(id = R.string.Possible_winnings), text = stringResource(id = R.string.Possible_winnings),
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
color = AllInTheme.themeColors.onBackground color = AllInTheme.colors.onBackground
) )
AllInCoinCount( AllInCoinCount(
amount = stake?.let { (it + (it * odds)).roundToInt() } ?: 0, amount = stake?.let { (it + (it * odds)).roundToInt() } ?: 0,
color = AllInTheme.themeColors.onBackground color = AllInTheme.colors.onBackground
) )
} }
AllInButton( AllInButton(
enabled = enabled, enabled = enabled,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
text = stringResource(id = R.string.Participate), text = stringResource(id = R.string.Participate),
textColor = AllInTheme.colors.white, textColor = AllInColorToken.white,
radius = 5.dp, radius = 5.dp,
onClick = onButtonClick, onClick = onButtonClick,
modifier = Modifier.navigationBarsPadding() modifier = Modifier.navigationBarsPadding()

@ -29,7 +29,7 @@ fun BetStatusWinner(
coinAmount: Int, coinAmount: Int,
username: String, username: String,
multiplier: Float, multiplier: Float,
color: Color = AllInTheme.themeColors.onMainSurface, color: Color = AllInTheme.colors.onMainSurface,
) { ) {
Column { Column {
HorizontalDivider(color = color.copy(alpha = .4f)) HorizontalDivider(color = color.copy(alpha = .4f))

@ -8,6 +8,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInTextIcon import fr.iut.alldev.allin.ui.core.AllInTextIcon
import fr.iut.alldev.allin.ui.core.IconPosition import fr.iut.alldev.allin.ui.core.IconPosition
@ -24,7 +25,7 @@ fun BinaryDetailsLine(
) { ) {
AllInTextIcon( AllInTextIcon(
text = yesText, text = yesText,
color = AllInTheme.colors.allInBlue, color = AllInColorToken.allInBlue,
icon = icon, icon = icon,
position = IconPosition.LEADING, position = IconPosition.LEADING,
size = 15, size = 15,
@ -32,7 +33,7 @@ fun BinaryDetailsLine(
) )
AllInTextIcon( AllInTextIcon(
text = noText, text = noText,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
icon = icon, icon = icon,
position = IconPosition.TRAILING, position = IconPosition.TRAILING,
size = 15, size = 15,

@ -11,6 +11,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.data.ext.toPercentageString import fr.iut.alldev.allin.data.ext.toPercentageString
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.PercentagePositionnedElement import fr.iut.alldev.allin.ui.core.PercentagePositionnedElement
import fr.iut.alldev.allin.ui.core.StatBar import fr.iut.alldev.allin.ui.core.StatBar
@ -26,7 +27,7 @@ fun BinaryStatBar(
Row { Row {
Text( Text(
text = response1, text = response1,
color = AllInTheme.colors.allInBlue, color = AllInColorToken.allInBlue,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontStyle = FontStyle.Italic, fontStyle = FontStyle.Italic,
fontSize = 30.sp, fontSize = 30.sp,
@ -37,7 +38,7 @@ fun BinaryStatBar(
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontStyle = FontStyle.Italic, fontStyle = FontStyle.Italic,
fontSize = 30.sp, fontSize = 30.sp,
color = AllInTheme.colors.allInBarPink, color = AllInColorToken.allInBarPink,
textAlign = TextAlign.End, textAlign = TextAlign.End,
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
) )
@ -49,7 +50,7 @@ fun BinaryStatBar(
Text( Text(
text = response1Percentage.toPercentageString(), text = response1Percentage.toPercentageString(),
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
color = AllInTheme.colors.allInBarPurple color = AllInColorToken.allInBarPurple
) )
} }
} }

@ -7,6 +7,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInTextIcon import fr.iut.alldev.allin.ui.core.AllInTextIcon
import fr.iut.alldev.allin.ui.core.IconPosition import fr.iut.alldev.allin.ui.core.IconPosition
@ -24,9 +25,9 @@ fun SimpleDetailsLine(
AllInTextIcon( AllInTextIcon(
text = text, text = text,
color = if (isWin) { color = if (isWin) {
AllInTheme.colors.allInBarViolet AllInColorToken.allInBarViolet
} else { } else {
AllInTheme.colors.allInBlue AllInColorToken.allInBlue
}, },
icon = icon, icon = icon,
position = IconPosition.TRAILING, position = IconPosition.TRAILING,

@ -21,6 +21,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.data.ext.toPercentageString import fr.iut.alldev.allin.data.ext.toPercentageString
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -34,9 +35,9 @@ fun SimpleStatBar(
Text( Text(
text = response, text = response,
color = if (isWin) { color = if (isWin) {
AllInTheme.colors.allInBarPink AllInColorToken.allInBarPink
} else { } else {
AllInTheme.colors.allInBlue AllInColorToken.allInBlue
}, },
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
fontStyle = FontStyle.Italic, fontStyle = FontStyle.Italic,
@ -60,9 +61,9 @@ fun SimpleStatBar(
) )
.background( .background(
if (isWin) { if (isWin) {
AllInTheme.colors.allInBar2ndGradient AllInColorToken.allInBar2ndGradient
} else { } else {
AllInTheme.colors.allInBar1stGradient AllInColorToken.allInBar1stGradient
} }
) )
) )
@ -70,12 +71,14 @@ fun SimpleStatBar(
Icon( Icon(
painter = painterResource(id = R.drawable.fire_solid), painter = painterResource(id = R.drawable.fire_solid),
tint = if (isWin) { tint = if (isWin) {
AllInTheme.colors.allInBarViolet AllInColorToken.allInBarViolet
} else { } else {
AllInTheme.colors.allInBarPurple AllInColorToken.allInBarPurple
}, },
contentDescription = null, contentDescription = null,
modifier = Modifier.size(32.dp).offset((-7).dp) modifier = Modifier
.size(32.dp)
.offset((-7).dp)
) )
Text( Text(
modifier = Modifier.let { itModifier -> modifier = Modifier.let { itModifier ->
@ -87,9 +90,9 @@ fun SimpleStatBar(
fontSize = if (isWin) 24.sp else 16.sp fontSize = if (isWin) 24.sp else 16.sp
), ),
color = if (isWin) { color = if (isWin) {
AllInTheme.colors.allInBarViolet AllInColorToken.allInBarViolet
} else { } else {
AllInTheme.colors.allInBarPurple AllInColorToken.allInBarPurple
} }
) )
} }

@ -50,6 +50,7 @@ import androidx.core.os.ConfigurationCompat
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.data.ext.formatToMediumDateNoYear import fr.iut.alldev.allin.data.ext.formatToMediumDateNoYear
import fr.iut.alldev.allin.data.ext.formatToTime import fr.iut.alldev.allin.data.ext.formatToTime
import fr.iut.alldev.allin.data.model.User
import fr.iut.alldev.allin.data.model.bet.BetStatus import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.data.model.bet.CustomBet import fr.iut.alldev.allin.data.model.bet.CustomBet
import fr.iut.alldev.allin.data.model.bet.MatchBet import fr.iut.alldev.allin.data.model.bet.MatchBet
@ -60,6 +61,7 @@ import fr.iut.alldev.allin.ext.asPaddingValues
import fr.iut.alldev.allin.ext.formatToSimple import fr.iut.alldev.allin.ext.formatToSimple
import fr.iut.alldev.allin.ext.getDateEndLabelId import fr.iut.alldev.allin.ext.getDateEndLabelId
import fr.iut.alldev.allin.ext.getDateStartLabelId import fr.iut.alldev.allin.ext.getDateStartLabelId
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.betStatus.components.BetStatusWinner import fr.iut.alldev.allin.ui.betStatus.components.BetStatusWinner
import fr.iut.alldev.allin.ui.betStatus.components.BinaryDetailsLine import fr.iut.alldev.allin.ui.betStatus.components.BinaryDetailsLine
@ -82,6 +84,7 @@ class BetStatusBottomSheetBetDisplayer(
@Composable @Composable
private fun DisplayBet( private fun DisplayBet(
betDetail: BetDetail, betDetail: BetDetail,
currentUser: User,
statBar: LazyListScope.() -> Unit statBar: LazyListScope.() -> Unit
) { ) {
Box(Modifier) { Box(Modifier) {
@ -116,18 +119,18 @@ class BetStatusBottomSheetBetDisplayer(
if (betDetail.bet.betStatus == BetStatus.FINISHED) { if (betDetail.bet.betStatus == BetStatus.FINISHED) {
BetStatusWinner( BetStatusWinner(
answer = YES_VALUE, answer = YES_VALUE,
color = AllInTheme.colors.allInBlue, color = AllInColorToken.allInBlue,
coinAmount = 442, coinAmount = 442,
username = "Imri", username = "Imri",
multiplier = 1.2f multiplier = 1.2f
) )
} else { } else {
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
} }
LazyColumn( LazyColumn(
modifier = Modifier modifier = Modifier
.fillMaxHeight() .fillMaxHeight()
.background(AllInTheme.themeColors.background2) .background(AllInTheme.colors.background2)
.nestedScroll(object : NestedScrollConnection { .nestedScroll(object : NestedScrollConnection {
override fun onPostScroll( override fun onPostScroll(
consumed: Offset, consumed: Offset,
@ -145,7 +148,7 @@ class BetStatusBottomSheetBetDisplayer(
Text( Text(
text = stringResource(id = R.string.bet_status_participants_list), text = stringResource(id = R.string.bet_status_participants_list),
fontSize = 20.sp, fontSize = 20.sp,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
modifier = Modifier.padding(vertical = 36.dp) modifier = Modifier.padding(vertical = 36.dp)
) )
@ -159,7 +162,7 @@ class BetStatusBottomSheetBetDisplayer(
allCoinsAmount = it.stake allCoinsAmount = it.stake
) )
HorizontalDivider( HorizontalDivider(
color = AllInTheme.themeColors.border, color = AllInTheme.colors.border,
modifier = Modifier.padding(vertical = 8.dp, horizontal = 25.dp) modifier = Modifier.padding(vertical = 8.dp, horizontal = 25.dp)
) )
} }
@ -181,14 +184,18 @@ class BetStatusBottomSheetBetDisplayer(
} }
} }
} }
if (betDetail.bet.betStatus != BetStatus.FINISHED && betDetail.userParticipation == null) { if (
betDetail.bet.betStatus != BetStatus.FINISHED &&
betDetail.userParticipation == null &&
betDetail.bet.creator != currentUser.username
) {
RainbowButton( RainbowButton(
modifier = Modifier modifier = Modifier
.align(Alignment.BottomCenter) .align(Alignment.BottomCenter)
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
.2f to Color.Transparent, .2f to Color.Transparent,
.5f to AllInTheme.themeColors.background2 .5f to AllInTheme.colors.background2
) )
) )
.padding(7.dp) .padding(7.dp)
@ -249,7 +256,8 @@ class BetStatusBottomSheetBetDisplayer(
private fun LazyListScope.displayMultiStatBar( private fun LazyListScope.displayMultiStatBar(
betDetail: BetDetail, betDetail: BetDetail,
responses: List<String> responses: List<String>,
locale: Locale
) { ) {
val responsesWithDetail = responses.mapNotNull { val responsesWithDetail = responses.mapNotNull {
betDetail.getAnswerOfResponse(it) betDetail.getAnswerOfResponse(it)
@ -260,9 +268,6 @@ class BetStatusBottomSheetBetDisplayer(
itemsIndexed(responsesWithDetail.toList().sortedByDescending { it.second }) { idx, (answer, percentage) -> itemsIndexed(responsesWithDetail.toList().sortedByDescending { it.second }) { idx, (answer, percentage) ->
val isWin = remember { idx == 0 } val isWin = remember { idx == 0 }
val configuration = LocalConfiguration.current
val locale = remember { ConfigurationCompat.getLocales(configuration).get(0) ?: Locale.getDefault() }
SimpleStatBar( SimpleStatBar(
percentage = percentage, percentage = percentage,
response = answer.response, response = answer.response,
@ -295,8 +300,8 @@ class BetStatusBottomSheetBetDisplayer(
} }
@Composable @Composable
override fun DisplayYesNoBet(betDetail: BetDetail) { override fun DisplayYesNoBet(betDetail: BetDetail, currentUser: User) {
DisplayBet(betDetail = betDetail) { DisplayBet(betDetail = betDetail, currentUser = currentUser) {
displayBinaryStatBar( displayBinaryStatBar(
betDetail = betDetail, betDetail = betDetail,
response1 = YES_VALUE, response1 = YES_VALUE,
@ -308,10 +313,10 @@ class BetStatusBottomSheetBetDisplayer(
} }
@Composable @Composable
override fun DisplayMatchBet(betDetail: BetDetail) { override fun DisplayMatchBet(betDetail: BetDetail, currentUser: User) {
val matchBet = remember { betDetail.bet as MatchBet } val matchBet = remember { betDetail.bet as MatchBet }
DisplayBet(betDetail = betDetail) { DisplayBet(betDetail = betDetail, currentUser = currentUser) {
displayBinaryStatBar( displayBinaryStatBar(
betDetail = betDetail, betDetail = betDetail,
response1 = matchBet.nameTeam1, response1 = matchBet.nameTeam1,
@ -321,10 +326,12 @@ class BetStatusBottomSheetBetDisplayer(
} }
@Composable @Composable
override fun DisplayCustomBet(betDetail: BetDetail) { override fun DisplayCustomBet(betDetail: BetDetail, currentUser: User) {
val customBet = remember { betDetail.bet as CustomBet } val customBet = remember { betDetail.bet as CustomBet }
val configuration = LocalConfiguration.current
val locale = remember { ConfigurationCompat.getLocales(configuration).get(0) ?: Locale.getDefault() }
DisplayBet(betDetail = betDetail) { DisplayBet(betDetail = betDetail, currentUser = currentUser) {
if (customBet.possibleAnswers.size == 2) { if (customBet.possibleAnswers.size == 2) {
displayBinaryStatBar( displayBinaryStatBar(
betDetail = betDetail, betDetail = betDetail,
@ -334,7 +341,8 @@ class BetStatusBottomSheetBetDisplayer(
} else { } else {
displayMultiStatBar( displayMultiStatBar(
betDetail = betDetail, betDetail = betDetail,
responses = customBet.getResponses() responses = customBet.getResponses(),
locale = locale
) )
} }
} }
@ -356,14 +364,14 @@ fun BetStatusParticipant(
text = username, text = username,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
) )
AllInCoinCount( AllInCoinCount(
amount = allCoinsAmount, amount = allCoinsAmount,
color = AllInTheme.colors.allInPurple color = AllInColorToken.allInPurple
) )
} }
} }
@ -375,8 +383,11 @@ private fun BetStatusBottomSheetPreview(
@PreviewParameter(BetDetailPreviewProvider::class) bet: BetDetail @PreviewParameter(BetDetailPreviewProvider::class) bet: BetDetail
) { ) {
AllInTheme { AllInTheme {
BetStatusBottomSheetBetDisplayer { BetStatusBottomSheetBetDisplayer(
openParticipateSheet = {}
}.DisplayBet(bet) ).DisplayBet(
betDetail = bet,
currentUser = User(id = "x", username = "aaa", email = "aaa", coins = 150)
)
} }
} }

@ -9,6 +9,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -43,16 +44,16 @@ fun AllInAlertDialog(
text = confirmText, text = confirmText,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.h1.copy( style = AllInTheme.typography.h1.copy(
brush = AllInTheme.colors.allInMainGradient brush = AllInColorToken.allInMainGradient
) )
) )
} }
}, },
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
containerColor = AllInTheme.themeColors.mainSurface, containerColor = AllInTheme.colors.mainSurface,
titleContentColor = AllInTheme.themeColors.onMainSurface, titleContentColor = AllInTheme.colors.onMainSurface,
textContentColor = AllInTheme.themeColors.onBackground2, textContentColor = AllInTheme.colors.onBackground2,
) )
} }
} }

@ -14,17 +14,17 @@ import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
@Composable @Composable
fun AllInBottomSheet( fun AllInBottomSheet(
sheetVisibility: Boolean, sheetVisibility: Boolean,
onDismiss: ()->Unit, onDismiss: () -> Unit,
state: SheetState, state: SheetState,
scrimColor: Color = BottomSheetDefaults.ScrimColor, scrimColor: Color = BottomSheetDefaults.ScrimColor,
containerColor: Color = AllInTheme.themeColors.background, containerColor: Color = AllInTheme.colors.background,
dragHandle: (@Composable ()->Unit)? = { BottomSheetDefaults.DragHandle() }, dragHandle: (@Composable () -> Unit)? = { BottomSheetDefaults.DragHandle() },
content: @Composable ColumnScope.()->Unit content: @Composable ColumnScope.() -> Unit
) { ) {
val localDensity = LocalDensity.current val localDensity = LocalDensity.current
val localLayoutDirection = LocalLayoutDirection.current val localLayoutDirection = LocalLayoutDirection.current
if(sheetVisibility) { if (sheetVisibility) {
ModalBottomSheet( ModalBottomSheet(
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
sheetState = state, sheetState = state,

@ -11,6 +11,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -34,7 +35,7 @@ fun AllInButton(
text = text, text = text,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
color = if(enabled) textColor else AllInTheme.themeColors.disabledBorder, color = if (enabled) textColor else AllInTheme.colors.disabledBorder,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier modifier = Modifier
.padding(vertical = 15.dp) .padding(vertical = 15.dp)
@ -48,7 +49,7 @@ fun AllInButton(
private fun AllInButtonPreview() { private fun AllInButtonPreview() {
AllInTheme { AllInTheme {
AllInButton( AllInButton(
color = AllInTheme.colors.allInLoginPurple, color = AllInColorToken.allInLoginPurple,
text = "Connexion", text = "Connexion",
textColor = Color.White textColor = Color.White
) { ) {
@ -62,7 +63,7 @@ private fun AllInButtonPreview() {
private fun AllInButtonDisabledPreview() { private fun AllInButtonDisabledPreview() {
AllInTheme { AllInTheme {
AllInButton( AllInButton(
color = AllInTheme.colors.allInLoginPurple, color = AllInColorToken.allInLoginPurple,
text = "Connexion", text = "Connexion",
textColor = Color.White, textColor = Color.White,
enabled = false enabled = false

@ -35,12 +35,12 @@ fun AllInCard(
radius: Dp = 15.dp, radius: Dp = 15.dp,
shape: Shape? = null, shape: Shape? = null,
enabled: Boolean = true, enabled: Boolean = true,
backgroundColor: Color = AllInTheme.themeColors.background, backgroundColor: Color = AllInTheme.colors.background,
disabledBackgroundColor: Color = AllInTheme.themeColors.disabled, disabledBackgroundColor: Color = AllInTheme.colors.disabled,
backgroundBrush: Brush? = null, backgroundBrush: Brush? = null,
borderWidth: Dp? = null, borderWidth: Dp? = null,
borderColor: Color = AllInTheme.themeColors.border, borderColor: Color = AllInTheme.colors.border,
disabledBorderColor: Color = AllInTheme.themeColors.disabledBorder, disabledBorderColor: Color = AllInTheme.colors.disabledBorder,
borderBrush: Brush? = null, borderBrush: Brush? = null,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
@ -92,12 +92,12 @@ fun AllInBouncyCard(
onClick: (() -> Unit)? = null, onClick: (() -> Unit)? = null,
radius: Dp = 15.dp, radius: Dp = 15.dp,
enabled: Boolean = true, enabled: Boolean = true,
backgroundColor: Color = AllInTheme.themeColors.background, backgroundColor: Color = AllInTheme.colors.background,
disabledBackgroundColor: Color = AllInTheme.themeColors.disabled, disabledBackgroundColor: Color = AllInTheme.colors.disabled,
backgroundBrush: Brush? = null, backgroundBrush: Brush? = null,
borderWidth: Dp? = null, borderWidth: Dp? = null,
borderColor: Color = AllInTheme.themeColors.border, borderColor: Color = AllInTheme.colors.border,
disabledBorderColor: Color = AllInTheme.themeColors.disabledBorder, disabledBorderColor: Color = AllInTheme.colors.disabledBorder,
borderBrush: Brush? = null, borderBrush: Brush? = null,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {

@ -13,6 +13,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
@ -24,14 +25,14 @@ fun AllInChip(
isSelected: Boolean = false, isSelected: Boolean = false,
onClick: () -> Unit = {}, onClick: () -> Unit = {},
radius: Dp = 50.dp, radius: Dp = 50.dp,
selectedColor: Color = AllInTheme.colors.allInPurple, selectedColor: Color = AllInColorToken.allInPurple,
unselectedColor: Color = AllInTheme.themeColors.background, unselectedColor: Color = AllInTheme.colors.background,
) { ) {
Card( Card(
modifier = modifier, modifier = modifier,
shape = AbsoluteSmoothCornerShape(radius, 100), shape = AbsoluteSmoothCornerShape(radius, 100),
onClick = onClick, onClick = onClick,
border = if (!isSelected) BorderStroke(1.dp, AllInTheme.themeColors.border) else null, border = if (!isSelected) BorderStroke(1.dp, AllInTheme.colors.border) else null,
colors = CardDefaults.cardColors( colors = CardDefaults.cardColors(
containerColor = if (isSelected) selectedColor else unselectedColor containerColor = if (isSelected) selectedColor else unselectedColor
) )
@ -45,7 +46,7 @@ fun AllInChip(
.alpha(if (isSelected) 0f else 1f), .alpha(if (isSelected) 0f else 1f),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
color = AllInTheme.themeColors.onBackground2 color = AllInTheme.colors.onBackground2
) )
if (isSelected) { if (isSelected) {
Text( Text(
@ -53,7 +54,7 @@ fun AllInChip(
modifier = modifier.align(Alignment.Center), modifier = modifier.align(Alignment.Center),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
color = AllInTheme.colors.white color = AllInColorToken.white
) )
} }
} }

@ -7,6 +7,7 @@ import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -36,6 +37,6 @@ fun AllInCoinCount(
@Composable @Composable
private fun AllInCoinCountPreview() { private fun AllInCoinCountPreview() {
AllInTheme { AllInTheme {
AllInCoinCount(amount = 542, color = AllInTheme.colors.allInPurple) AllInCoinCount(amount = 542, color = AllInColorToken.allInPurple)
} }
} }

@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import java.time.ZonedDateTime import java.time.ZonedDateTime
import java.util.* import java.util.*
@ -41,7 +42,7 @@ fun AllInDatePicker(
Text( Text(
text = stringResource(id = R.string.Validate), text = stringResource(id = R.string.Validate),
style = AllInTheme.typography.h1.copy( style = AllInTheme.typography.h1.copy(
brush = AllInTheme.colors.allInMainGradient brush = AllInColorToken.allInMainGradient
) )
) )
} }
@ -50,36 +51,36 @@ fun AllInDatePicker(
TextButton(onClick = onDismiss) { TextButton(onClick = onDismiss) {
Text( Text(
text = stringResource(id = R.string.Cancel), text = stringResource(id = R.string.Cancel),
color = AllInTheme.themeColors.onBackground2, color = AllInTheme.colors.onBackground2,
style = AllInTheme.typography.sm1 style = AllInTheme.typography.sm1
) )
} }
}, },
colors = DatePickerDefaults.colors( colors = DatePickerDefaults.colors(
containerColor = AllInTheme.themeColors.mainSurface containerColor = AllInTheme.colors.mainSurface
) )
) { ) {
DatePicker( DatePicker(
state = datePickerState, state = datePickerState,
colors = DatePickerDefaults.colors( colors = DatePickerDefaults.colors(
todayDateBorderColor = AllInTheme.colors.allInBlue, todayDateBorderColor = AllInColorToken.allInBlue,
selectedDayContainerColor = AllInTheme.colors.allInBlue, selectedDayContainerColor = AllInColorToken.allInBlue,
todayContentColor = AllInTheme.colors.allInBlue, todayContentColor = AllInColorToken.allInBlue,
dayContentColor = AllInTheme.colors.allInBlue, dayContentColor = AllInColorToken.allInBlue,
dividerColor = AllInTheme.themeColors.border, dividerColor = AllInTheme.colors.border,
containerColor = AllInTheme.themeColors.background, containerColor = AllInTheme.colors.background,
titleContentColor = AllInTheme.themeColors.onMainSurface, titleContentColor = AllInTheme.colors.onMainSurface,
headlineContentColor = AllInTheme.themeColors.onMainSurface, headlineContentColor = AllInTheme.colors.onMainSurface,
subheadContentColor = AllInTheme.themeColors.onBackground2, subheadContentColor = AllInTheme.colors.onBackground2,
dateTextFieldColors = OutlinedTextFieldDefaults.colors( dateTextFieldColors = OutlinedTextFieldDefaults.colors(
focusedContainerColor = AllInTheme.themeColors.mainSurface, focusedContainerColor = AllInTheme.colors.mainSurface,
unfocusedContainerColor = AllInTheme.themeColors.mainSurface, unfocusedContainerColor = AllInTheme.colors.mainSurface,
focusedBorderColor = AllInTheme.colors.allInPurple, focusedBorderColor = AllInColorToken.allInPurple,
unfocusedBorderColor = AllInTheme.themeColors.border, unfocusedBorderColor = AllInTheme.colors.border,
focusedTextColor = AllInTheme.themeColors.onMainSurface, focusedTextColor = AllInTheme.colors.onMainSurface,
unfocusedTextColor = AllInTheme.themeColors.onMainSurface, unfocusedTextColor = AllInTheme.colors.onMainSurface,
focusedLabelColor = AllInTheme.colors.allInPurple, focusedLabelColor = AllInColorToken.allInPurple,
unfocusedLabelColor = AllInTheme.themeColors.onMainSurface, unfocusedLabelColor = AllInTheme.colors.onMainSurface,
) )
) )
) )

@ -33,7 +33,7 @@ import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
fun AllInDetailsDrawer( fun AllInDetailsDrawer(
text: String = stringResource(id = R.string.Details), text: String = stringResource(id = R.string.Details),
textColor: Color = AllInTheme.themeColors.onBackground2, textColor: Color = AllInTheme.colors.onBackground2,
content: @Composable ColumnScope.() -> Unit, content: @Composable ColumnScope.() -> Unit,
) { ) {
val interactionSource = remember { MutableInteractionSource() } val interactionSource = remember { MutableInteractionSource() }

@ -10,6 +10,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.ext.shadow import fr.iut.alldev.allin.ext.shadow
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -23,8 +24,8 @@ fun AllInGradientButton(
modifier = modifier modifier = modifier
.shadow( .shadow(
colors = listOf( colors = listOf(
AllInTheme.colors.allInPink, AllInColorToken.allInPink,
AllInTheme.colors.allInBlue AllInColorToken.allInBlue
), ),
blurRadius = 20.dp, blurRadius = 20.dp,
alpha = .5f, alpha = .5f,
@ -32,13 +33,13 @@ fun AllInGradientButton(
) )
.fillMaxWidth(), .fillMaxWidth(),
radius = 10.dp, radius = 10.dp,
backgroundBrush = AllInTheme.colors.allInMainGradient backgroundBrush = AllInColorToken.allInMainGradient
) { ) {
Text( Text(
text = text, text = text,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
color = AllInTheme.colors.white, color = AllInColorToken.white,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier modifier = Modifier
.padding(vertical = 15.dp) .padding(vertical = 15.dp)

@ -18,6 +18,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
@ -28,16 +29,16 @@ fun AllInIconChip(
isSelected: Boolean = false, isSelected: Boolean = false,
onClick: () -> Unit = {}, onClick: () -> Unit = {},
radius: Dp = 15.dp, radius: Dp = 15.dp,
selectedColor: Color = AllInTheme.colors.allInPurple, selectedColor: Color = AllInColorToken.allInPurple,
unselectedColor: Color = AllInTheme.themeColors.background, unselectedColor: Color = AllInTheme.colors.background,
leadingIcon: ImageVector, leadingIcon: ImageVector,
) { ) {
val contentColor = if (isSelected) AllInTheme.colors.white else selectedColor val contentColor = if (isSelected) AllInColorToken.white else selectedColor
Card( Card(
modifier = modifier, modifier = modifier,
shape = AbsoluteSmoothCornerShape(radius, 100), shape = AbsoluteSmoothCornerShape(radius, 100),
onClick = onClick, onClick = onClick,
border = if (!isSelected) BorderStroke(1.dp, AllInTheme.themeColors.border) else null, border = if (!isSelected) BorderStroke(1.dp, AllInTheme.colors.border) else null,
colors = CardDefaults.cardColors( colors = CardDefaults.cardColors(
containerColor = if (isSelected) selectedColor else unselectedColor containerColor = if (isSelected) selectedColor else unselectedColor
) )

@ -41,6 +41,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.window.DialogWindowProvider import androidx.compose.ui.window.DialogWindowProvider
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import kotlin.math.PI import kotlin.math.PI
import kotlin.math.abs import kotlin.math.abs
@ -50,7 +51,7 @@ import kotlin.math.max
fun AllInLoading( fun AllInLoading(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
visible: Boolean, visible: Boolean,
brush: Brush = AllInTheme.colors.allInMainGradient, brush: Brush = AllInColorToken.allInMainGradient,
) { ) {
val interactionSource = remember { MutableInteractionSource() } val interactionSource = remember { MutableInteractionSource() }
AnimatedVisibility( AnimatedVisibility(
@ -76,7 +77,7 @@ fun AllInLoading(
indication = null, indication = null,
onClick = {} onClick = {}
) )
.background(AllInTheme.themeColors.mainSurface.copy(alpha = .4f)) .background(AllInTheme.colors.mainSurface.copy(alpha = .4f))
) { ) {
AllInCircularProgressIndicator( AllInCircularProgressIndicator(
modifier = Modifier modifier = Modifier
@ -93,7 +94,7 @@ fun AllInLoading(
@Composable @Composable
fun AllInCircularProgressIndicator( fun AllInCircularProgressIndicator(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
brush: Brush = AllInTheme.colors.allInMainGradient, brush: Brush = AllInColorToken.allInMainGradient,
strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth, strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth,
strokeCap: StrokeCap = ProgressIndicatorDefaults.CircularIndeterminateStrokeCap, strokeCap: StrokeCap = ProgressIndicatorDefaults.CircularIndeterminateStrokeCap,
) { ) {

@ -19,18 +19,20 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
fun AllInMarqueeBox( fun AllInMarqueeBox(
backgroundColor: Color = AllInTheme.themeColors.mainSurface, backgroundColor: Color = AllInTheme.colors.mainSurface,
backgroundBrush: Brush? = null, backgroundBrush: Brush? = null,
content: @Composable BoxScope.() -> Unit content: @Composable BoxScope.() -> Unit
) { ) {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize().let { itModifier -> .fillMaxSize()
.let { itModifier ->
backgroundBrush?.let { backgroundBrush?.let {
itModifier.background(it) itModifier.background(it)
} ?: itModifier.background(backgroundColor) } ?: itModifier.background(backgroundColor)
@ -45,7 +47,7 @@ fun AllInMarqueeBox(
.scale(1.2f) .scale(1.2f)
.rotate(11f) .rotate(11f)
.basicMarquee(spacing = MarqueeSpacing(0.dp)), .basicMarquee(spacing = MarqueeSpacing(0.dp)),
tint = AllInTheme.colors.white.copy(alpha = .05f) tint = AllInColorToken.white.copy(alpha = .05f)
) )
content() content()
} }
@ -57,7 +59,7 @@ fun AllInMarqueeBox(
private fun AllInMarqueeBoxPreview() { private fun AllInMarqueeBoxPreview() {
AllInTheme { AllInTheme {
AllInMarqueeBox( AllInMarqueeBox(
backgroundBrush = AllInTheme.colors.allInMainGradient, backgroundBrush = AllInColorToken.allInMainGradient,
) { ) {
Text("CONTENT") Text("CONTENT")
} }

@ -6,6 +6,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -16,9 +17,9 @@ fun AllInRadioButton(
) { ) {
AllInCard( AllInCard(
radius = 100.dp, radius = 100.dp,
borderColor = AllInTheme.colors.allInMint, borderColor = AllInColorToken.allInMint,
borderWidth = if (!checked) 1.dp else null, borderWidth = if (!checked) 1.dp else null,
backgroundColor = if (checked) AllInTheme.colors.allInPurple else unCheckedColor, backgroundColor = if (checked) AllInColorToken.allInPurple else unCheckedColor,
modifier = modifier.size(12.dp) modifier = modifier.size(12.dp)
) {} ) {}
} }
@ -35,7 +36,7 @@ private fun AllInRadioButtonNotCheckedPreview() {
@Composable @Composable
private fun AllInRadioButtonNotCheckedFilledPreview() { private fun AllInRadioButtonNotCheckedFilledPreview() {
AllInTheme { AllInTheme {
AllInRadioButton(checked = false, unCheckedColor = AllInTheme.colors.allInMint) AllInRadioButton(checked = false, unCheckedColor = AllInColorToken.allInMint)
} }
} }

@ -23,6 +23,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -39,7 +40,7 @@ fun AllInRetractableCard(
AllInCard( AllInCard(
modifier = modifier.fillMaxWidth(), modifier = modifier.fillMaxWidth(),
borderWidth = borderWidth, borderWidth = borderWidth,
borderColor = AllInTheme.colors.allInPurple.copy(.5f) borderColor = AllInColorToken.allInPurple.copy(.5f)
) { ) {
Column( Column(
Modifier.animateContentSize() Modifier.animateContentSize()
@ -60,10 +61,10 @@ fun AllInRetractableCard(
query = boldText, query = boldText,
highlightStyle = SpanStyle( highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontStyle = AllInTheme.typography.h2.fontStyle fontStyle = AllInTheme.typography.h2.fontStyle
), ),
color = AllInTheme.themeColors.onBackground2, color = AllInTheme.colors.onBackground2,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 16.sp, fontSize = 16.sp,
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
@ -73,13 +74,13 @@ fun AllInRetractableCard(
if (isOpen) ExpandLess else ExpandMore if (isOpen) ExpandLess else ExpandMore
}, },
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInPurple, tint = AllInColorToken.allInPurple,
modifier = Modifier.size(30.dp) modifier = Modifier.size(30.dp)
) )
} }
AnimatedVisibility(isOpen) { AnimatedVisibility(isOpen) {
Column { Column {
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
content() content()
} }
} }

@ -21,14 +21,14 @@ fun AllInSectionButton(
) { ) {
val style = if (isSelected) { val style = if (isSelected) {
AllInTheme.typography.sm1.copy( AllInTheme.typography.sm1.copy(
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontSize = 15.sp, fontSize = 15.sp,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontWeight = FontWeight.ExtraBold fontWeight = FontWeight.ExtraBold
) )
} else { } else {
AllInTheme.typography.sm1.copy( AllInTheme.typography.sm1.copy(
color = AllInTheme.themeColors.onBackground2, color = AllInTheme.colors.onBackground2,
fontSize = 15.sp, fontSize = 15.sp,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontWeight = FontWeight.SemiBold fontWeight = FontWeight.SemiBold

@ -63,7 +63,7 @@ fun AllInSections(
.fillMaxWidth() .fillMaxWidth()
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
0.75f to AllInTheme.themeColors.mainSurface, 0.75f to AllInTheme.colors.mainSurface,
1f to Color.Transparent 1f to Color.Transparent
) )
), ),

@ -34,6 +34,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@ -66,13 +67,13 @@ private fun AllInSelectionLine(
Icon( Icon(
imageVector = it, imageVector = it,
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInPurple, tint = AllInColorToken.allInPurple,
modifier = Modifier.size(20.dp) modifier = Modifier.size(20.dp)
) )
} }
Text( Text(
text = text, text = text,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
@ -81,7 +82,7 @@ private fun AllInSelectionLine(
Icon( Icon(
imageVector = trailingIcon, imageVector = trailingIcon,
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInPurple, tint = AllInColorToken.allInPurple,
modifier = Modifier modifier = Modifier
.size(30.dp) .size(30.dp)
) )
@ -105,7 +106,7 @@ fun AllInSelectionBox(
modifier = modifier.fillMaxWidth(), modifier = modifier.fillMaxWidth(),
radius = 10.dp, radius = 10.dp,
borderWidth = borderWidth, borderWidth = borderWidth,
borderColor = AllInTheme.colors.allInPurple.copy(alpha = .42f) borderColor = AllInColorToken.allInPurple.copy(alpha = .42f)
) { ) {
Column( Column(
Modifier.animateContentSize() Modifier.animateContentSize()
@ -125,7 +126,7 @@ fun AllInSelectionBox(
) )
AnimatedVisibility(isOpen) { AnimatedVisibility(isOpen) {
Column { Column {
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
elements.filter { it != selected }.forEach { element -> elements.filter { it != selected }.forEach { element ->
AllInSelectionLine( AllInSelectionLine(
text = stringResource(id = element.textId), text = stringResource(id = element.textId),
@ -188,7 +189,7 @@ private fun AllInSelectionLine(
Icon( Icon(
imageVector = trailingIcon, imageVector = trailingIcon,
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInPurple, tint = AllInColorToken.allInPurple,
modifier = Modifier modifier = Modifier
.size(30.dp) .size(30.dp)
) )
@ -211,7 +212,7 @@ fun AllInSelectionBox(
modifier = modifier.fillMaxWidth(), modifier = modifier.fillMaxWidth(),
radius = 10.dp, radius = 10.dp,
borderWidth = borderWidth, borderWidth = borderWidth,
borderColor = AllInTheme.colors.allInPurple.copy(alpha = .42f) borderColor = AllInColorToken.allInPurple.copy(alpha = .42f)
) { ) {
Column(Modifier.animateContentSize()) { Column(Modifier.animateContentSize()) {
AllInSelectionLine( AllInSelectionLine(
@ -224,7 +225,7 @@ fun AllInSelectionBox(
) )
AnimatedVisibility(isOpen) { AnimatedVisibility(isOpen) {
Column { Column {
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
elements.filter { it != selected }.forEach { element -> elements.filter { it != selected }.forEach { element ->
AllInSelectionLine( AllInSelectionLine(
element = element, element = element,

@ -25,6 +25,7 @@ import androidx.core.text.isDigitsOnly
import fr.iut.alldev.allin.ext.formatToSimple import fr.iut.alldev.allin.ext.formatToSimple
import fr.iut.alldev.allin.ext.toFloatOrNull import fr.iut.alldev.allin.ext.toFloatOrNull
import fr.iut.alldev.allin.ext.verifyIsFloat import fr.iut.alldev.allin.ext.verifyIsFloat
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
import java.util.Locale import java.util.Locale
@ -46,10 +47,10 @@ fun AllInTextField(
keyboardType: KeyboardType = KeyboardType.Text, keyboardType: KeyboardType = KeyboardType.Text,
imeAction: ImeAction = ImeAction.Default, imeAction: ImeAction = ImeAction.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default,
borderColor: Color = AllInTheme.themeColors.onBackground2, borderColor: Color = AllInTheme.colors.onBackground2,
containerColor: Color = AllInTheme.themeColors.background, containerColor: Color = AllInTheme.colors.background,
textColor: Color = AllInTheme.themeColors.onMainSurface, textColor: Color = AllInTheme.colors.onMainSurface,
placeholderColor: Color = AllInTheme.themeColors.onBackground2, placeholderColor: Color = AllInTheme.colors.onBackground2,
onValueChange: (String) -> Unit, onValueChange: (String) -> Unit,
) { ) {
OutlinedTextField( OutlinedTextField(
@ -83,7 +84,7 @@ fun AllInTextField(
Icon( Icon(
painter = it, painter = it,
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInLightGrey300 tint = AllInColorToken.allInLightGrey300
) )
} }
}, },
@ -131,7 +132,7 @@ fun AllInPasswordField(
Icon( Icon(
imageVector = if (hidden) Icons.Default.VisibilityOff else Icons.Default.Visibility, imageVector = if (hidden) Icons.Default.VisibilityOff else Icons.Default.Visibility,
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.allInLightGrey300 tint = AllInColorToken.allInLightGrey300
) )
} }
}, },

@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@ -77,7 +78,7 @@ private fun AllInTextIconPreview() {
AllInTextIcon( AllInTextIcon(
text = "value", text = "value",
icon = rememberVectorPainter(image = Icons.Default.Fireplace), icon = rememberVectorPainter(image = Icons.Default.Fireplace),
color = AllInTheme.colors.allInBlue color = AllInColorToken.allInBlue
) )
} }
} }
@ -89,8 +90,8 @@ private fun AllInTextIconReversePreview() {
AllInTextIcon( AllInTextIcon(
text = "value", text = "value",
icon = AllInTheme.icons.allCoins(), icon = AllInTheme.icons.allCoins(),
color = AllInTheme.colors.allInBlue, color = AllInColorToken.allInBlue,
brush = AllInTheme.colors.allInMainGradient, brush = AllInColorToken.allInMainGradient,
position = IconPosition.LEADING position = IconPosition.LEADING
) )
} }

@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import java.util.* import java.util.*
@ -36,7 +37,7 @@ fun AllInTimePicker(
Text( Text(
text = stringResource(id = R.string.Validate), text = stringResource(id = R.string.Validate),
style = AllInTheme.typography.h1.copy( style = AllInTheme.typography.h1.copy(
brush = AllInTheme.colors.allInMainGradient brush = AllInColorToken.allInMainGradient
) )
) )
} }
@ -45,7 +46,7 @@ fun AllInTimePicker(
TextButton(onClick = onDismiss) { TextButton(onClick = onDismiss) {
Text( Text(
text = stringResource(id = R.string.Cancel), text = stringResource(id = R.string.Cancel),
color = AllInTheme.themeColors.onBackground2, color = AllInTheme.colors.onBackground2,
style = AllInTheme.typography.sm1 style = AllInTheme.typography.sm1
) )
} }
@ -54,16 +55,16 @@ fun AllInTimePicker(
TimePicker( TimePicker(
state = timePickerState, state = timePickerState,
colors = TimePickerDefaults.colors( colors = TimePickerDefaults.colors(
selectorColor = AllInTheme.colors.allInPurple, selectorColor = AllInColorToken.allInPurple,
containerColor = AllInTheme.themeColors.background, containerColor = AllInTheme.colors.background,
clockDialColor = AllInTheme.themeColors.background2, clockDialColor = AllInTheme.colors.background2,
clockDialUnselectedContentColor = AllInTheme.themeColors.onMainSurface, clockDialUnselectedContentColor = AllInTheme.colors.onMainSurface,
clockDialSelectedContentColor = AllInTheme.themeColors.background2, clockDialSelectedContentColor = AllInTheme.colors.background2,
) )
) )
}, },
containerColor = AllInTheme.themeColors.mainSurface containerColor = AllInTheme.colors.mainSurface
) )
} }

@ -66,14 +66,14 @@ fun AllInTitleInfo(
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
fontSize = 15.sp, fontSize = 15.sp,
color = AllInTheme.themeColors.onMainSurface color = AllInTheme.colors.onMainSurface
) )
Spacer(modifier = Modifier.width(5.dp)) Spacer(modifier = Modifier.width(5.dp))
AllInTooltip(text = tooltipText, state = tooltipState) { AllInTooltip(text = tooltipText, state = tooltipState) {
Icon( Icon(
imageVector = icon, imageVector = icon,
contentDescription = null, contentDescription = null,
tint = AllInTheme.themeColors.onMainSurface, tint = AllInTheme.colors.onMainSurface,
modifier = Modifier modifier = Modifier
.size(15.dp) .size(15.dp)
.alpha(.8f) .alpha(.8f)

@ -13,6 +13,7 @@ import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.* import androidx.compose.ui.unit.*
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
@ -30,7 +31,7 @@ fun AllInTooltip(
AllInPlainTooltip { AllInPlainTooltip {
Text( Text(
text = text, text = text,
color = AllInTheme.colors.allInLightGrey200, color = AllInColorToken.allInLightGrey200,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 12.sp fontSize = 12.sp
) )
@ -60,9 +61,9 @@ private val AllInPlainTooltipContentPadding =
@Composable @Composable
fun AllInPlainTooltip( fun AllInPlainTooltip(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
containerColor: Color = AllInTheme.colors.allInDark, containerColor: Color = AllInColorToken.allInDark,
borderWidth: Dp = 1.dp, borderWidth: Dp = 1.dp,
borderColor: Color = AllInTheme.colors.allInDarkGrey100, borderColor: Color = AllInColorToken.allInDarkGrey100,
shape: Shape = AbsoluteSmoothCornerShape(10.dp, 100), shape: Shape = AbsoluteSmoothCornerShape(10.dp, 100),
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
@ -120,7 +121,7 @@ private fun AllInTooltipPreview() {
AllInPlainTooltip(content = { AllInPlainTooltip(content = {
Text( Text(
text = "Généralement une question qui sera répondu par les utilisateurs.", text = "Généralement une question qui sera répondu par les utilisateurs.",
color = AllInTheme.colors.allInLightGrey200, color = AllInColorToken.allInLightGrey200,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 10.sp fontSize = 10.sp
) )

@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -34,8 +35,8 @@ fun ProfilePicture(
Card( Card(
modifier = modifier.size(size), modifier = modifier.size(size),
shape = shape, shape = shape,
colors = CardDefaults.cardColors(containerColor = AllInTheme.colors.allInDarkGrey100), colors = CardDefaults.cardColors(containerColor = AllInColorToken.allInDarkGrey100),
border = borderWidth?.let { BorderStroke(it, AllInTheme.colors.allInDarkGrey50) } border = borderWidth?.let { BorderStroke(it, AllInColorToken.allInDarkGrey50) }
) { ) {
Box(Modifier.fillMaxSize()) { Box(Modifier.fillMaxSize()) {
image?.let { image?.let {
@ -50,7 +51,7 @@ fun ProfilePicture(
} ?: run { } ?: run {
Icon( Icon(
imageVector = Icons.Default.PhotoCamera, imageVector = Icons.Default.PhotoCamera,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
contentDescription = null, contentDescription = null,
modifier = Modifier modifier = Modifier
.align(Alignment.Center) .align(Alignment.Center)

@ -11,6 +11,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -19,7 +20,7 @@ fun RainbowButton(
text: String, text: String,
onClick: () -> Unit, onClick: () -> Unit,
enabled: Boolean = true, enabled: Boolean = true,
rippleColor: Color = AllInTheme.colors.allInBlue, rippleColor: Color = AllInColorToken.allInBlue,
) { ) {
AllInRipple(rippleColor) { AllInRipple(rippleColor) {
AllInCard( AllInCard(
@ -32,11 +33,11 @@ fun RainbowButton(
with(AllInTheme.typography.h2) { with(AllInTheme.typography.h2) {
if (enabled) { if (enabled) {
copy( copy(
brush = AllInTheme.colors.allInTextGradient brush = AllInColorToken.allInTextGradient
) )
} else { } else {
copy( copy(
color = AllInTheme.themeColors.disabledBorder color = AllInTheme.colors.disabledBorder
) )
} }
} }

@ -19,14 +19,15 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
fun StatBar( fun StatBar(
percentage: Float, percentage: Float,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
leadingBrush: Brush = AllInTheme.colors.allInBar1stGradient, leadingBrush: Brush = AllInColorToken.allInBar1stGradient,
trailingBrush: Brush = AllInTheme.colors.allInBar2ndGradient, trailingBrush: Brush = AllInColorToken.allInBar2ndGradient,
icon: (@Composable () -> Unit)? = null, icon: (@Composable () -> Unit)? = null,
) { ) {
Box(modifier = modifier) { Box(modifier = modifier) {
@ -70,14 +71,14 @@ fun StatBar(
icon?.invoke() ?: when (percentage) { icon?.invoke() ?: when (percentage) {
0f -> Icon( 0f -> Icon(
painter = painterResource(id = R.drawable.fire_solid), painter = painterResource(id = R.drawable.fire_solid),
tint = AllInTheme.colors.allInPink, tint = AllInColorToken.allInPink,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(32.dp) modifier = Modifier.size(32.dp)
) )
1f -> Icon( 1f -> Icon(
painter = painterResource(id = R.drawable.fire_solid), painter = painterResource(id = R.drawable.fire_solid),
tint = AllInTheme.colors.allInPurple, tint = AllInColorToken.allInPurple,
contentDescription = null, contentDescription = null,
modifier = Modifier.size(32.dp) modifier = Modifier.size(32.dp)
) )

@ -51,7 +51,7 @@ fun BetCard(
} }
HorizontalDivider( HorizontalDivider(
thickness = 1.dp, thickness = 1.dp,
color = AllInTheme.themeColors.border color = AllInTheme.colors.border
) )
content() content()
} }

@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -23,15 +24,15 @@ fun BetDateTimeChip(
Card( Card(
modifier = modifier.wrapContentSize(), modifier = modifier.wrapContentSize(),
shape = RoundedCornerShape(50), shape = RoundedCornerShape(50),
border = BorderStroke(1.dp, AllInTheme.themeColors.border), border = BorderStroke(1.dp, AllInTheme.colors.border),
colors = CardDefaults.cardColors(containerColor = AllInTheme.themeColors.background) colors = CardDefaults.cardColors(containerColor = AllInTheme.colors.background)
) { ) {
Text( Text(
text = text, text = text,
modifier = Modifier.padding(vertical = 8.dp, horizontal = 16.dp), modifier = Modifier.padding(vertical = 8.dp, horizontal = 16.dp),
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
color = AllInTheme.colors.allInPurple color = AllInColorToken.allInPurple
) )
} }
} }

@ -28,7 +28,7 @@ fun BetDateTimeRow(
text = label, text = label,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
color = AllInTheme.themeColors.onBackground2 color = AllInTheme.colors.onBackground2
) )
BetDateTimeChip(date) BetDateTimeChip(date)
BetDateTimeChip(time) BetDateTimeChip(time)

@ -35,24 +35,24 @@ fun BetTitleHeader(
query = creator, query = creator,
highlightStyle = SpanStyle( highlightStyle = SpanStyle(
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
color = AllInTheme.themeColors.onMainSurface color = AllInTheme.colors.onMainSurface
), ),
fontSize = 12.sp, fontSize = 12.sp,
style = AllInTheme.typography.p2, style = AllInTheme.typography.p2,
color = AllInTheme.themeColors.onBackground2 color = AllInTheme.colors.onBackground2
) )
} }
Spacer(modifier = Modifier.height(11.dp)) Spacer(modifier = Modifier.height(11.dp))
Text( Text(
text = category, text = category,
fontSize = 15.sp, fontSize = 15.sp,
color = AllInTheme.themeColors.onBackground2, color = AllInTheme.colors.onBackground2,
style = AllInTheme.typography.sm2 style = AllInTheme.typography.sm2
) )
Text( Text(
text = title, text = title,
fontSize = 20.sp, fontSize = 20.sp,
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.h1 style = AllInTheme.typography.h1
) )
} }

@ -4,6 +4,7 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
@ -30,6 +31,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@ -53,7 +55,9 @@ fun AllInSnackbar(
SwipeToDismissBox( SwipeToDismissBox(
state = dismissState, state = dismissState,
backgroundContent = {}, backgroundContent = {},
modifier = Modifier.padding(8.dp) modifier = Modifier
.padding(vertical = 8.dp)
.navigationBarsPadding()
) { ) {
val snackbarType = remember { val snackbarType = remember {
if (snackbarData.visuals is AllInSnackbarVisualsImpl) { if (snackbarData.visuals is AllInSnackbarVisualsImpl) {
@ -65,7 +69,7 @@ fun AllInSnackbar(
AllInSnackbarContent( AllInSnackbarContent(
backgroundColor = snackbarType.getBackgroundColor(), backgroundColor = snackbarType.getBackgroundColor(),
contentColor = AllInTheme.colors.white, contentColor = AllInColorToken.white,
text = snackbarData.visuals.message, text = snackbarData.visuals.message,
icon = snackbarType.getIcon(), icon = snackbarType.getIcon(),
dismiss = { snackbarState.currentSnackbarData?.dismiss() } dismiss = { snackbarState.currentSnackbarData?.dismiss() }
@ -86,6 +90,7 @@ fun AllInSnackbarContent(
Surface( Surface(
shape = RoundedCornerShape(16.dp), shape = RoundedCornerShape(16.dp),
shadowElevation = 4.dp, shadowElevation = 4.dp,
modifier = Modifier.padding(horizontal = 8.dp)
) { ) {
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
@ -138,7 +143,7 @@ private fun AllInSnackbarContentPreview(
AllInTheme { AllInTheme {
AllInSnackbarContent( AllInSnackbarContent(
backgroundColor = snackbarType.getBackgroundColor(), backgroundColor = snackbarType.getBackgroundColor(),
contentColor = AllInTheme.colors.white, contentColor = AllInColorToken.white,
text = "Lorem Ipsum", text = "Lorem Ipsum",
icon = snackbarType.getIcon(), icon = snackbarType.getIcon(),
dismiss = {} dismiss = {}

@ -7,7 +7,7 @@ import androidx.compose.material.icons.filled.Info
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.ERROR import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.ERROR
import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.STANDARD import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.STANDARD
import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.SUCCESS import fr.iut.alldev.allin.ui.core.snackbar.SnackbarType.SUCCESS
@ -21,9 +21,9 @@ enum class SnackbarType {
@Composable @Composable
fun SnackbarType.getBackgroundColor(): Color = fun SnackbarType.getBackgroundColor(): Color =
when (this) { when (this) {
STANDARD -> AllInTheme.colors.allInDark STANDARD -> AllInColorToken.allInDark
SUCCESS -> AllInTheme.colors.allInPurple SUCCESS -> AllInColorToken.allInPurple
ERROR -> AllInTheme.colors.allInBetWaiting ERROR -> AllInColorToken.allInBetWaiting
} }
@Composable @Composable

@ -17,6 +17,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -25,7 +26,7 @@ fun AllInTopBar(
coinAmount: Int, coinAmount: Int,
) { ) {
TopAppBar( TopAppBar(
modifier = Modifier.background(AllInTheme.colors.allInMainGradient), modifier = Modifier.background(AllInColorToken.allInMainGradient),
colors = TopAppBarDefaults.topAppBarColors( colors = TopAppBarDefaults.topAppBarColors(
containerColor = Color.Transparent containerColor = Color.Transparent
), ),
@ -50,7 +51,7 @@ fun AllInTopBar(
Icon( Icon(
painter = AllInTheme.icons.logo(), painter = AllInTheme.icons.logo(),
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
modifier = Modifier modifier = Modifier
.size(40.dp) .size(40.dp)
.align(Alignment.Center) .align(Alignment.Center)

@ -16,15 +16,16 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
fun AllInTopBarCoinCounter( fun AllInTopBarCoinCounter(
amount: Int, amount: Int,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
backgroundColor: Color = AllInTheme.colors.white, backgroundColor: Color = AllInColorToken.white,
textColor: Color = AllInTheme.colors.allInDark, textColor: Color = AllInColorToken.allInDark,
iconColor: Color = AllInTheme.colors.allInBlue, iconColor: Color = AllInColorToken.allInBlue,
) { ) {
Card( Card(
modifier = modifier.wrapContentSize(), modifier = modifier.wrapContentSize(),

@ -34,6 +34,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInAlertDialog import fr.iut.alldev.allin.ui.core.AllInAlertDialog
import fr.iut.alldev.allin.ui.core.AllInGradientButton import fr.iut.alldev.allin.ui.core.AllInGradientButton
@ -70,7 +71,7 @@ fun LoginScreen(
Box( Box(
Modifier Modifier
.fillMaxSize() .fillMaxSize()
.background(AllInTheme.themeColors.mainSurface) .background(AllInTheme.colors.mainSurface)
.padding(horizontal = 44.dp) .padding(horizontal = 44.dp)
.safeContentPadding() .safeContentPadding()
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
@ -81,7 +82,7 @@ fun LoginScreen(
Text( Text(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.Login_title), text = stringResource(id = R.string.Login_title),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontSize = 40.sp fontSize = 40.sp
@ -90,7 +91,7 @@ fun LoginScreen(
Text( Text(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.Login_subtitle), text = stringResource(id = R.string.Login_subtitle),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontSize = 23.sp fontSize = 23.sp
@ -120,7 +121,7 @@ fun LoginScreen(
ClickableText( ClickableText(
text = AnnotatedString(stringResource(id = R.string.forgot_password)), text = AnnotatedString(stringResource(id = R.string.forgot_password)),
style = AllInTheme.typography.sm2.copy( style = AllInTheme.typography.sm2.copy(
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontSize = 15.sp, fontSize = 15.sp,
), ),
modifier = Modifier modifier = Modifier
@ -151,7 +152,7 @@ fun LoginScreen(
) { ) {
Text( Text(
text = stringResource(id = R.string.no_account), text = stringResource(id = R.string.no_account),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
modifier = Modifier.padding(end = 5.dp) modifier = Modifier.padding(end = 5.dp)
@ -159,7 +160,7 @@ fun LoginScreen(
ClickableText( ClickableText(
text = AnnotatedString(stringResource(id = R.string.Register)), text = AnnotatedString(stringResource(id = R.string.Register)),
style = AllInTheme.typography.p1.copy( style = AllInTheme.typography.p1.copy(
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
fontSize = 15.sp, fontSize = 15.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
) )

@ -26,6 +26,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
import fr.iut.alldev.allin.data.model.bet.BetStatus
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.betStatus.BetStatusBottomSheet import fr.iut.alldev.allin.ui.betStatus.BetStatusBottomSheet
import fr.iut.alldev.allin.ui.betStatus.vo.BetStatusBottomSheetBetDisplayer import fr.iut.alldev.allin.ui.betStatus.vo.BetStatusBottomSheetBetDisplayer
@ -138,15 +139,22 @@ fun MainScreen(
modifier = Modifier modifier = Modifier
.padding(top = it.calculateTopPadding()) .padding(top = it.calculateTopPadding())
.fillMaxSize() .fillMaxSize()
.background(AllInTheme.themeColors.mainSurface), .background(AllInTheme.colors.mainSurface),
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
AllInDrawerNavHost( AllInDrawerNavHost(
navController = navController, navController = navController,
selectBet = { bet, participate -> selectBet = { bet, participate ->
mainViewModel.openBetDetail(bet) mainViewModel.openBetDetail(bet) { detail ->
setParticipateSheetVisibility(participate) setStatusVisibility(true)
setStatusVisibility(true) if (
detail.bet.betStatus == BetStatus.IN_PROGRESS &&
detail.userParticipation == null &&
detail.bet.creator != currentUser?.username
) {
setParticipateSheetVisibility(participate)
}
}
}, },
setLoading = setLoading, setLoading = setLoading,
putSnackbarContent = { mainViewModel.putSnackbarContent(it) } putSnackbarContent = { mainViewModel.putSnackbarContent(it) }
@ -175,7 +183,9 @@ fun MainScreen(
sheetBackVisibility = sheetBackVisibility.value, sheetBackVisibility = sheetBackVisibility.value,
onDismiss = { setStatusVisibility(false) }, onDismiss = { setStatusVisibility(false) },
betDetail = selectedBet, betDetail = selectedBet,
displayBet = { betStatusDisplayer.DisplayBet(it) }, displayBet = { detail ->
currentUser?.let { user -> betStatusDisplayer.DisplayBet(betDetail = detail, currentUser = user) }
},
userCoinAmount = userCoins ?: 0, userCoinAmount = userCoins ?: 0,
onParticipate = { stake, response -> mainViewModel.participateToBet(stake, response) }, onParticipate = { stake, response -> mainViewModel.participateToBet(stake, response) },
participateSheetVisibility = participateSheetVisibility, participateSheetVisibility = participateSheetVisibility,

@ -76,9 +76,11 @@ class MainViewModel @Inject constructor(
} }
} }
fun openBetDetail(bet: Bet) { fun openBetDetail(bet: Bet, onGetBet: (BetDetail) -> Unit) {
viewModelScope.launch { viewModelScope.launch {
selectedBet.value = betRepository.getBet(bet.id, keystoreManager.getTokenOrEmpty()) val betDetail = betRepository.getBet(bet.id, keystoreManager.getTokenOrEmpty())
selectedBet.value = betDetail
onGetBet(betDetail)
} }
} }

@ -83,7 +83,7 @@ fun AllInNavHost(
}, },
modifier = modifier modifier = modifier
.fillMaxSize() .fillMaxSize()
.background(AllInTheme.themeColors.mainSurface), .background(AllInTheme.colors.mainSurface),
) { ) {
allInSplashScreen(navController) allInSplashScreen(navController)
allInWelcomeScreen(navController) allInWelcomeScreen(navController)

@ -22,6 +22,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.navigation.TopLevelDestination import fr.iut.alldev.allin.ui.navigation.TopLevelDestination
import fr.iut.alldev.allin.ui.navigation.drawer.components.DrawerCell import fr.iut.alldev.allin.ui.navigation.drawer.components.DrawerCell
@ -47,7 +48,7 @@ fun AllInDrawer(
drawerContent = { drawerContent = {
ModalDrawerSheet( ModalDrawerSheet(
drawerShape = RectangleShape, drawerShape = RectangleShape,
drawerContainerColor = AllInTheme.colors.allInDark drawerContainerColor = AllInColorToken.allInDark
) { ) {
DrawerHeader( DrawerHeader(
nbBets = nbBets, nbBets = nbBets,
@ -75,7 +76,7 @@ fun AllInDrawer(
Text( Text(
text = stringResource(id = R.string.Logout), text = stringResource(id = R.string.Logout),
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
color = AllInTheme.colors.allInDarkGrey50, color = AllInColorToken.allInDarkGrey50,
fontSize = 16.sp fontSize = 16.sp
) )
} }
@ -91,7 +92,7 @@ fun AllInDrawer(
Icon( Icon(
imageVector = Icons.Filled.Settings, imageVector = Icons.Filled.Settings,
modifier = Modifier.size(40.dp), modifier = Modifier.size(40.dp),
tint = AllInTheme.colors.allInDarkGrey50, tint = AllInColorToken.allInDarkGrey50,
contentDescription = null contentDescription = null
) )
} }

@ -17,6 +17,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@ -31,9 +32,9 @@ fun DrawerCell(
Card( Card(
onClick = onClick, onClick = onClick,
modifier = modifier, modifier = modifier,
border = BorderStroke(width = 1.dp, color = AllInTheme.colors.allInDarkGrey50), border = BorderStroke(width = 1.dp, color = AllInColorToken.allInDarkGrey50),
shape = RoundedCornerShape(20), shape = RoundedCornerShape(20),
colors = CardDefaults.cardColors(containerColor = AllInTheme.colors.allInDarkGrey100) colors = CardDefaults.cardColors(containerColor = AllInColorToken.allInDarkGrey100)
) { ) {
Row( Row(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 17.dp), modifier = Modifier.padding(horizontal = 10.dp, vertical = 17.dp),
@ -51,19 +52,19 @@ fun DrawerCell(
text = title, text = title,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
fontSize = 13.sp, fontSize = 13.sp,
color = AllInTheme.colors.white, color = AllInColorToken.white,
fontWeight = FontWeight.W700 fontWeight = FontWeight.W700
) )
Text( Text(
text = subtitle, text = subtitle,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
fontSize = 9.sp, fontSize = 9.sp,
color = AllInTheme.colors.allInLightGrey300, color = AllInColorToken.allInLightGrey300,
) )
} }
Icon( Icon(
imageVector = Icons.Default.ChevronRight, imageVector = Icons.Default.ChevronRight,
tint = AllInTheme.colors.allInDarkGrey50, tint = AllInColorToken.allInDarkGrey50,
contentDescription = null contentDescription = null
) )

@ -17,6 +17,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.ProfilePicture import fr.iut.alldev.allin.ui.core.ProfilePicture
@ -39,7 +40,7 @@ fun DrawerHeader(
Text( Text(
text = username, text = username,
fontSize = 20.sp, fontSize = 20.sp,
color = AllInTheme.colors.allInLightGrey200, color = AllInColorToken.allInLightGrey200,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = AllInTheme.typography.h2, style = AllInTheme.typography.h2,
) )

@ -5,6 +5,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -17,12 +18,12 @@ fun DrawerHeaderStat(
) { ) {
Text( Text(
text = value.toString(), text = value.toString(),
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h1 style = AllInTheme.typography.h1
) )
Text( Text(
text = label, text = label,
color = AllInTheme.colors.allInLightGrey300, color = AllInColorToken.allInLightGrey300,
style = AllInTheme.typography.p1 style = AllInTheme.typography.p1
) )
} }

@ -20,6 +20,7 @@ import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.data.model.User import fr.iut.alldev.allin.data.model.User
import fr.iut.alldev.allin.ext.asPaddingValues import fr.iut.alldev.allin.ext.asPaddingValues
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
@Composable @Composable
@ -36,7 +37,7 @@ fun RankingScreenContent(
Text( Text(
text = stringResource(id = R.string.ranking_title), text = stringResource(id = R.string.ranking_title),
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
color = AllInTheme.colors.allInGrey, color = AllInColorToken.allInGrey,
fontSize = 24.sp, fontSize = 24.sp,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()

@ -22,6 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex import androidx.compose.ui.zIndex
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
@ -58,7 +59,7 @@ fun RankingScreenFirst(
Text( Text(
text = username, text = username,
color = AllInTheme.themeColors.onBackground, color = AllInTheme.colors.onBackground,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
maxLines = 2, maxLines = 2,
@ -68,18 +69,18 @@ fun RankingScreenFirst(
) )
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.background(AllInTheme.themeColors.background2) .background(AllInTheme.colors.background2)
.padding(16.dp), .padding(16.dp),
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
AllInCoinCount( AllInCoinCount(
amount = coins, amount = coins,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
size = 20 size = 20
) )
} }
@ -97,13 +98,13 @@ fun RankingScreenFirst(
.padding(vertical = 55.dp) .padding(vertical = 55.dp)
.zIndex(500f) .zIndex(500f)
.clip(CircleShape) .clip(CircleShape)
.background(AllInTheme.colors.allInPurple) .background(AllInColorToken.allInPurple)
.size(30.dp), .size(30.dp),
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
Text( Text(
text = "1", text = "1",
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 20.sp, fontSize = 20.sp,
modifier = Modifier.padding(4.dp) modifier = Modifier.padding(4.dp)

@ -15,6 +15,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
@ -40,7 +41,7 @@ fun RankingScreenItem(
Text( Text(
text = "$position", text = "$position",
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 15.sp, fontSize = 15.sp,
softWrap = false, softWrap = false,
@ -53,7 +54,7 @@ fun RankingScreenItem(
Text( Text(
text = username, text = username,
color = AllInTheme.themeColors.onBackground, color = AllInTheme.colors.onBackground,
style = AllInTheme.typography.sm2, style = AllInTheme.typography.sm2,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
@ -63,7 +64,7 @@ fun RankingScreenItem(
AllInCoinCount( AllInCoinCount(
amount = coins, amount = coins,
color = AllInTheme.colors.allInPurple color = AllInColorToken.allInPurple
) )
} }
} }

@ -22,6 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex import androidx.compose.ui.zIndex
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInCard import fr.iut.alldev.allin.ui.core.AllInCard
import fr.iut.alldev.allin.ui.core.AllInCoinCount import fr.iut.alldev.allin.ui.core.AllInCoinCount
@ -58,7 +59,7 @@ fun RankingScreenSecond(
Text( Text(
text = username, text = username,
color = AllInTheme.themeColors.onBackground, color = AllInTheme.colors.onBackground,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
maxLines = 2, maxLines = 2,
@ -68,18 +69,18 @@ fun RankingScreenSecond(
) )
HorizontalDivider(color = AllInTheme.themeColors.border) HorizontalDivider(color = AllInTheme.colors.border)
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.background(AllInTheme.themeColors.background2) .background(AllInTheme.colors.background2)
.padding(16.dp), .padding(16.dp),
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
AllInCoinCount( AllInCoinCount(
amount = coins, amount = coins,
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
size = 20 size = 20
) )
} }
@ -97,13 +98,13 @@ fun RankingScreenSecond(
.padding(vertical = 44.dp) .padding(vertical = 44.dp)
.zIndex(500f) .zIndex(500f)
.clip(CircleShape) .clip(CircleShape)
.background(AllInTheme.colors.allInPurple) .background(AllInColorToken.allInPurple)
.size(25.dp), .size(25.dp),
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
Text( Text(
text = "2", text = "2",
color = AllInTheme.colors.white, color = AllInColorToken.white,
style = AllInTheme.typography.h1, style = AllInTheme.typography.h1,
fontSize = 15.sp, fontSize = 15.sp,
modifier = Modifier.padding(4.dp) modifier = Modifier.padding(4.dp)

@ -34,6 +34,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.ext.asPaddingValues import fr.iut.alldev.allin.ext.asPaddingValues
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInGradientButton import fr.iut.alldev.allin.ui.core.AllInGradientButton
import fr.iut.alldev.allin.ui.core.AllInLoading import fr.iut.alldev.allin.ui.core.AllInLoading
@ -65,7 +66,7 @@ fun RegisterScreenContent(
Box( Box(
Modifier Modifier
.fillMaxSize() .fillMaxSize()
.background(AllInTheme.themeColors.mainSurface) .background(AllInTheme.colors.mainSurface)
) { ) {
LazyColumn( LazyColumn(
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
@ -77,7 +78,7 @@ fun RegisterScreenContent(
.padding(top = 16.dp) .padding(top = 16.dp)
.fillMaxWidth(), .fillMaxWidth(),
text = stringResource(id = R.string.Hello_x, username), text = stringResource(id = R.string.Hello_x, username),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontSize = 40.sp, fontSize = 40.sp,
@ -87,7 +88,7 @@ fun RegisterScreenContent(
Text( Text(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.Register_title), text = stringResource(id = R.string.Register_title),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.sm1, style = AllInTheme.typography.sm1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontSize = 40.sp fontSize = 40.sp
@ -96,7 +97,7 @@ fun RegisterScreenContent(
Text( Text(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.Register_subtitle), text = stringResource(id = R.string.Register_subtitle),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
fontSize = 23.sp fontSize = 23.sp
@ -155,7 +156,7 @@ fun RegisterScreenContent(
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
.2f to Color.Transparent, .2f to Color.Transparent,
.5f to AllInTheme.themeColors.background .5f to AllInTheme.colors.background
) )
) )
.padding(40.dp) .padding(40.dp)
@ -172,7 +173,7 @@ fun RegisterScreenContent(
) { ) {
Text( Text(
text = stringResource(id = R.string.already_have_account), text = stringResource(id = R.string.already_have_account),
color = AllInTheme.themeColors.onMainSurface, color = AllInTheme.colors.onMainSurface,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
modifier = Modifier.padding(end = 5.dp) modifier = Modifier.padding(end = 5.dp)
@ -180,7 +181,7 @@ fun RegisterScreenContent(
ClickableText( ClickableText(
text = AnnotatedString(stringResource(id = R.string.Login)), text = AnnotatedString(stringResource(id = R.string.Login)),
style = AllInTheme.typography.p1.copy( style = AllInTheme.typography.p1.copy(
color = AllInTheme.colors.allInPurple, color = AllInColorToken.allInPurple,
fontSize = 15.sp, fontSize = 15.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
) )

@ -7,6 +7,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.Icon import fr.iut.alldev.allin.ui.core.Icon
@ -15,13 +16,13 @@ fun SplashScreenContent() {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(AllInTheme.colors.allInLoginGradient), .background(AllInColorToken.allInLoginGradient),
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
Icon( Icon(
painter = AllInTheme.icons.logo(), painter = AllInTheme.icons.logo(),
contentDescription = null, contentDescription = null,
tint = AllInTheme.colors.white, tint = AllInColorToken.white,
modifier = Modifier.fillMaxSize(.25f) modifier = Modifier.fillMaxSize(.25f)
) )
} }

@ -27,6 +27,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import fr.iut.alldev.allin.R import fr.iut.alldev.allin.R
import fr.iut.alldev.allin.theme.AllInColorToken
import fr.iut.alldev.allin.theme.AllInTheme import fr.iut.alldev.allin.theme.AllInTheme
import fr.iut.alldev.allin.ui.core.AllInButton import fr.iut.alldev.allin.ui.core.AllInButton
@ -39,7 +40,7 @@ fun WelcomeScreenContent(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.fillMaxHeight(.5f) .fillMaxHeight(.5f)
.background(AllInTheme.colors.allInLoginGradient) .background(AllInColorToken.allInLoginGradient)
) )
Box( Box(
Modifier Modifier
@ -47,7 +48,7 @@ fun WelcomeScreenContent(
.background( .background(
Brush.verticalGradient( Brush.verticalGradient(
.2f to Color.Transparent, .2f to Color.Transparent,
.5f to AllInTheme.themeColors.background .5f to AllInTheme.colors.background
) )
) )
) { ) {
@ -60,7 +61,7 @@ fun WelcomeScreenContent(
) { ) {
Text( Text(
text = stringResource(id = R.string.welcome_title), text = stringResource(id = R.string.welcome_title),
color = AllInTheme.themeColors.onBackground, color = AllInTheme.colors.onBackground,
fontSize = 30.sp, fontSize = 30.sp,
style = AllInTheme.typography.h1 style = AllInTheme.typography.h1
) )
@ -68,22 +69,22 @@ fun WelcomeScreenContent(
text = stringResource(id = R.string.welcome_appname), text = stringResource(id = R.string.welcome_appname),
fontSize = 60.sp, fontSize = 60.sp,
style = AllInTheme.typography.h1.copy( style = AllInTheme.typography.h1.copy(
brush = AllInTheme.colors.allInMainGradient brush = AllInColorToken.allInMainGradient
) )
) )
Spacer(modifier = Modifier.height(43.dp)) Spacer(modifier = Modifier.height(43.dp))
Text( Text(
text = stringResource(id = R.string.welcome_subtitle), text = stringResource(id = R.string.welcome_subtitle),
color = AllInTheme.themeColors.onBackground, color = AllInTheme.colors.onBackground,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.p1 style = AllInTheme.typography.p1
) )
Spacer(modifier = Modifier.height(78.dp)) Spacer(modifier = Modifier.height(78.dp))
AllInButton( AllInButton(
color = AllInTheme.themeColors.tint1, color = AllInTheme.colors.tint1,
text = stringResource(id = R.string.join), text = stringResource(id = R.string.join),
textColor = AllInTheme.themeColors.background, textColor = AllInTheme.colors.background,
onClick = navigateToRegister, onClick = navigateToRegister,
modifier = Modifier.padding(bottom = 13.dp) modifier = Modifier.padding(bottom = 13.dp)
) )
@ -94,7 +95,7 @@ fun WelcomeScreenContent(
) { ) {
Text( Text(
text = stringResource(id = R.string.already_have_account), text = stringResource(id = R.string.already_have_account),
color = AllInTheme.themeColors.tint1, color = AllInTheme.colors.tint1,
fontSize = 15.sp, fontSize = 15.sp,
style = AllInTheme.typography.p1, style = AllInTheme.typography.p1,
modifier = Modifier.padding(end = 5.dp) modifier = Modifier.padding(end = 5.dp)
@ -102,7 +103,7 @@ fun WelcomeScreenContent(
ClickableText( ClickableText(
text = AnnotatedString(stringResource(id = R.string.Login)), text = AnnotatedString(stringResource(id = R.string.Login)),
style = AllInTheme.typography.p1.copy( style = AllInTheme.typography.p1.copy(
color = AllInTheme.themeColors.tint1, color = AllInTheme.colors.tint1,
fontSize = 15.sp, fontSize = 15.sp,
fontWeight = FontWeight.Bold fontWeight = FontWeight.Bold
), ),

@ -1,6 +1,7 @@
package fr.iut.alldev.allin.vo.bet package fr.iut.alldev.allin.vo.bet
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import fr.iut.alldev.allin.data.model.User
import fr.iut.alldev.allin.data.model.bet.CustomBet import fr.iut.alldev.allin.data.model.bet.CustomBet
import fr.iut.alldev.allin.data.model.bet.MatchBet import fr.iut.alldev.allin.data.model.bet.MatchBet
import fr.iut.alldev.allin.data.model.bet.YesNoBet import fr.iut.alldev.allin.data.model.bet.YesNoBet
@ -8,20 +9,20 @@ import fr.iut.alldev.allin.data.model.bet.vo.BetDetail
interface BetDisplayer { interface BetDisplayer {
@Composable @Composable
fun DisplayBet(betDetail: BetDetail) { fun DisplayBet(betDetail: BetDetail, currentUser: User) {
when (betDetail.bet) { when (betDetail.bet) {
is CustomBet -> DisplayCustomBet(betDetail) is CustomBet -> DisplayCustomBet(betDetail, currentUser)
is MatchBet -> DisplayMatchBet(betDetail) is MatchBet -> DisplayMatchBet(betDetail, currentUser)
is YesNoBet -> DisplayYesNoBet(betDetail) is YesNoBet -> DisplayYesNoBet(betDetail, currentUser)
} }
} }
@Composable @Composable
fun DisplayYesNoBet(betDetail: BetDetail) fun DisplayYesNoBet(betDetail: BetDetail, currentUser: User)
@Composable @Composable
fun DisplayMatchBet(betDetail: BetDetail) fun DisplayMatchBet(betDetail: BetDetail, currentUser: User)
@Composable @Composable
fun DisplayCustomBet(betDetail: BetDetail) fun DisplayCustomBet(betDetail: BetDetail, currentUser: User)
} }

@ -74,7 +74,7 @@ class MockAllInApi : AllInApi {
response = body.response, response = body.response,
type = BetType.BINARY, type = BetType.BINARY,
status = BetStatus.WAITING, status = BetStatus.WAITING,
createdBy = "" createdBy = getUserFromToken(token)?.first?.username ?: ""
) )
) )
} }

Loading…
Cancel
Save