Skip to content

Commit

Permalink
PIMOB: 2196: Borderstroke issue fixed (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
chintan-soni-cko authored Oct 16, 2023
1 parent a984e91 commit 4bd9c48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 4bd9c48

Please sign in to comment.