Is there actually a possibility to override some m...
# compose-android
c
Is there actually a possibility to override some modifiers? I know that order of modifiers do matter. Suppose I want to use this component from a third party library with no means to edit the source code
Copy code
@Composable
fun SomeComponent(modifier: Modifier = Modifier) {
    Box(
        modifier = modifier
            .size(48.dp)
            .background(Color.Red)
    )
}
And I want to give it a Blue background... How could I go about to do that?
s
You copy paste the source code into your project 😅
c
Is that really the only way to go... damn xD The actual thing I need, is to override the border size of the OutlinedTextField together with the placeholder verticalPadding... and to copy paste that complete part is... a pain in the ass just for those values... 😅
s
Yeah material3 isn’t always meant to be extended like that, here’s a previous discussion around this https://kotlinlang.slack.com/archives/CJLTWPH7S/p1693424292146409?thread_ts=1693412597.428539&cid=CJLTWPH7S
c
Hmm, okay thank you for the explanation, I'll see what I can do and discuss with the design team 😅
s
If your design specs don’t match 1:1 with the m3 ones, you simply need to bring in the component to your codebase. We did it here https://github.com/HedvigInsurance/android/tree/a5ecf3057ec744b4ac17d5a742da742efc[…]kotlin/com/hedvig/android/core/designsystem/component/textfield as well, and yeah it’s some upfront investment but then you get complete freedom. We managed to add some things to it that would be impossible otherwise, so it’s worth it.
c
Oh, haha now that I see that project I remember you recently helped me out with a different problem I had. Thank you very much for this as well, will help me quite a lot!
s
Heh, glad I could help you twice then 😊