|
|
@ -2,14 +2,13 @@ package fr.iut.alldev.allin.ui.core
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import androidx.compose.foundation.BorderStroke
|
|
|
|
import androidx.compose.foundation.BorderStroke
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.foundation.layout.*
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
import androidx.compose.material3.Card
|
|
|
|
import androidx.compose.material3.*
|
|
|
|
import androidx.compose.material3.CardDefaults
|
|
|
|
|
|
|
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
|
|
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
|
|
|
|
import androidx.compose.ui.draw.alpha
|
|
|
|
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
|
|
|
@ -28,23 +27,34 @@ fun AllInChip(
|
|
|
|
shape = RoundedCornerShape(50),
|
|
|
|
shape = RoundedCornerShape(50),
|
|
|
|
onClick = onClick,
|
|
|
|
onClick = onClick,
|
|
|
|
border = if(!isSelected) BorderStroke(1.dp, AllInTheme.themeColors.border) else null,
|
|
|
|
border = if(!isSelected) BorderStroke(1.dp, AllInTheme.themeColors.border) else null,
|
|
|
|
colors = CardDefaults.cardColors(containerColor = with(AllInTheme){
|
|
|
|
colors = CardDefaults.cardColors(
|
|
|
|
|
|
|
|
containerColor = with(AllInTheme){
|
|
|
|
if(isSelected) colors.allIn_Purple else themeColors.background
|
|
|
|
if(isSelected) colors.allIn_Purple else themeColors.background
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
Box{
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = text,
|
|
|
|
text = text,
|
|
|
|
modifier = Modifier.padding(vertical = 8.dp, horizontal = 22.dp),
|
|
|
|
modifier = Modifier
|
|
|
|
|
|
|
|
.padding(vertical = 8.dp, horizontal = 22.dp)
|
|
|
|
|
|
|
|
.alpha(if(isSelected) 0f else 1f),
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
style = with(AllInTheme.typography) {
|
|
|
|
style = AllInTheme.typography.r,
|
|
|
|
if (isSelected) h1 else r
|
|
|
|
color = AllInTheme.themeColors.on_background_2
|
|
|
|
},
|
|
|
|
)
|
|
|
|
color = with(AllInTheme){
|
|
|
|
if(isSelected) {
|
|
|
|
if(isSelected) colors.white else themeColors.on_background_2
|
|
|
|
Text(
|
|
|
|
}
|
|
|
|
text = text,
|
|
|
|
|
|
|
|
modifier = modifier.align(Alignment.Center),
|
|
|
|
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
|
|
|
|
style = AllInTheme.typography.h1,
|
|
|
|
|
|
|
|
color = AllInTheme.colors.white
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Preview
|
|
|
|
@Preview
|
|
|
|