skiptools / skip-ui

SwiftUI for Android
https://skip.tools
GNU Lesser General Public License v3.0
128 stars 14 forks source link

Expose two customizations for `TextField` on Android #68

Closed boctor closed 1 month ago

boctor commented 1 month ago

If these customizations aren't provided, then the previous behavior is maintained:

Example usage:

    let textField = TextField("My TextField", text: $text)
    #if SKIP
    textField.visualTransformation = MyCustomVisualTransformation()
    textField.onValueChange = { newValue in
      text.wrappedValue = updateText(newValue)
    }
    #endif

Skip Pull Request Checklist:

aabewhite commented 1 month ago

Thanks! I'm curious about the motivation here. What are you using the visual transformation for, and how are you accomplishing the same on the iOS side? And why the onChange block rather than using SwiftUI's own onChange modifier?

I think we're close to landing on a more comprehensive way of doing Android-specific component customization. So I'll be honest that I don't think we'll use this patch, but seeing what you need and understanding the motivations is definitely helping shape the API we're coming up with.

boctor commented 1 month ago

Closing since these customizations are now possible with the Material 3 component customization API in #70