Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIMOB: 2196: Borderstroke issue fixed #248

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.checkout.frames.cvvinputfield.api.CVVComponentApi
import com.checkout.frames.cvvinputfield.api.CVVComponentMediator
import com.checkout.frames.cvvinputfield.models.CVVComponentConfig
import com.checkout.frames.cvvinputfield.style.DefaultCVVInputFieldStyle
import com.checkout.frames.model.BorderStroke
import com.checkout.frames.model.CornerRadius
import com.checkout.frames.model.Padding
import com.checkout.frames.model.Shape
Expand All @@ -25,7 +26,7 @@ import com.checkout.frames.style.component.base.ContainerStyle
import com.checkout.frames.style.component.base.InputFieldStyle
import com.checkout.frames.style.component.base.TextStyle

@Suppress("MagicNumber")
@Suppress("MagicNumber", "LongMethod")
@Composable
fun CVVTokenizationScreen(navController: NavHostController) {
val cvvTokenizationViewModel: CVVTokenizationViewModel = viewModel()
Expand Down Expand Up @@ -78,6 +79,10 @@ fun CVVTokenizationScreen(navController: NavHostController) {
color = PaymentFormConstants.backgroundColor,
shape = Shape.Circle,
cornerRadius = CornerRadius(9),
borderStroke = BorderStroke(
width = 2,
color = 0XFF00CC2D,
),
),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.checkout.frames.mapper

import android.annotation.SuppressLint
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand All @@ -26,6 +27,7 @@ import com.checkout.frames.utils.extensions.disabledIndicatorColor
import com.checkout.frames.utils.extensions.errorIndicatorColor
import com.checkout.frames.utils.extensions.focusedIndicatorColor
import com.checkout.frames.utils.extensions.toComposeShape
import com.checkout.frames.utils.extensions.toComposeStroke
import com.checkout.frames.utils.extensions.toComposeTextStyle
import com.checkout.frames.utils.extensions.unfocusedIndicatorColor
import com.checkout.frames.view.TextLabel
Expand All @@ -51,12 +53,14 @@ internal class InputFieldStyleToViewStyleMapper(
@SuppressLint("ModifierFactoryExtensionFunction")
private fun provideModifier(containerStyle: ContainerStyle): Modifier = with(containerStyle) {
var modifier = Modifier.background(Color.Transparent)

val composeShape = shape.toComposeShape(cornerRadius)
height?.let { modifier = modifier.height(it.dp) }
modifier = width?.let { modifier.width(it.dp) } ?: modifier.fillMaxWidth()
margin?.let { modifier = modifier.padding(it.start.dp, it.top.dp, it.end.dp, it.bottom.dp) }
padding?.let { modifier = modifier.padding(it.start.dp, it.top.dp, it.end.dp, it.bottom.dp) }

borderStroke?.let { modifier = modifier.border(it.toComposeStroke(), composeShape) }

return modifier
}

Expand Down