Compare commits

..

1 Commits

Author SHA1 Message Date
86a7020c2b feat(CON-171) : Summary consent screen
feat(CON-172) : Detail consent screen
feat(-) : Send consent to BO to save them
2025-01-07 14:47:59 +01:00
3 changed files with 6 additions and 5 deletions

View File

@ -91,7 +91,7 @@ fun DemoNavGraph(navHostController: NavHostController) {
}, },
consentium = Consentium( consentium = Consentium(
context = context, context = context,
"ApplicationId", applicationId = "ApplicationId",
), ),
colors = ConsentiumDefaults.colors( colors = ConsentiumDefaults.colors(
primary = Primary, primary = Primary,

View File

@ -12,7 +12,7 @@ import androidx.core.graphics.ColorUtils
object ConsentiumDefaults { object ConsentiumDefaults {
private const val SURFACE_PRIMARY_COLOR_BLEND_RATIO = 0.1f private const val OUTLINE_COLOR_BLEND_RATIO = 0.1f
private object Typography { private object Typography {
private val DEFAULT_LINE_HEIGHT = 24.sp private val DEFAULT_LINE_HEIGHT = 24.sp
@ -101,7 +101,7 @@ object ConsentiumDefaults {
ColorUtils.blendARGB( ColorUtils.blendARGB(
onPrimary.toArgb(), onPrimary.toArgb(),
primary.toArgb(), primary.toArgb(),
SURFACE_PRIMARY_COLOR_BLEND_RATIO, OUTLINE_COLOR_BLEND_RATIO,
) )
), ),
error: Color = MaterialTheme.colorScheme.error, error: Color = MaterialTheme.colorScheme.error,

View File

@ -1,5 +1,6 @@
package fr.openium.consentium_ui.ui.utils package fr.openium.consentium_ui.ui.utils
import android.text.ParcelableSpan
import android.text.Spanned import android.text.Spanned
import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.SpanStyle
@ -13,7 +14,7 @@ fun htmlToAnnotatedString(html: String): AnnotatedString {
return buildAnnotatedString { return buildAnnotatedString {
val text = spanned.toString() val text = spanned.toString()
var start = 0 var start = 0
spanned.getSpans(0, spanned.length, Any::class.java).forEach { span -> spanned.getSpans(0, spanned.length, Any::class.java).map { it as ParcelableSpan }.forEach { span ->
val startSpan = spanned.getSpanStart(span) val startSpan = spanned.getSpanStart(span)
val endSpan = spanned.getSpanEnd(span) val endSpan = spanned.getSpanEnd(span)
@ -36,7 +37,7 @@ fun htmlToAnnotatedString(html: String): AnnotatedString {
} }
} }
fun Any.toSpanStyle(): SpanStyle { fun ParcelableSpan.toSpanStyle(): SpanStyle {
return when (this) { return when (this) {
is android.text.style.StyleSpan -> { is android.text.style.StyleSpan -> {
when (style) { when (style) {