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

CMP-5786 iOS TF2: Implement textFieldMagnifierNode #1549

Open
wants to merge 12 commits into
base: jb-main
Choose a base branch
from

Conversation

alexzhirkevich
Copy link

@alexzhirkevich alexzhirkevich commented Sep 8, 2024

Fixes 5786

Testing

Snippet for testing
val style = TextStyle(fontSize = 22.sp)
var textFieldState by remember { mutableStateOf("I am TextField") }
val textFieldState2 = remember { TextFieldState("I am TextField 2") }
Column(Modifier.fillMaxWidth().verticalScroll(rememberScrollState()).imePadding()) {
    BasicTextField(
        textFieldState,
        onValueChange = { textFieldState = it },
        Modifier.padding(16.dp).fillMaxWidth(),
        textStyle = style
    )
    Box(Modifier.height(16.dp))
    BasicTextField(
        textFieldState2, Modifier.padding(16.dp).fillMaxWidth(), textStyle = style
    )

    val s3 = remember { TextFieldState(loremIpsum(wordCount = 10)) }
    BasicTextField(
        state = s3,
        textStyle = style,
        modifier = Modifier
            .padding(16.dp)
            .padding(start = 100.dp)
            .width(200.dp)
            .border(1.dp, Color.Black)
    )

    val s6 = remember { TextFieldState("SingleLine scrollable " + loremIpsum(wordCount = 50)) }
    BasicTextField(
        state = s6,
        textStyle = style,
        modifier = Modifier.padding(16.dp).padding(start = 100.dp).width(200.dp)
            .border(1.dp, Color.Black),
        lineLimits = TextFieldLineLimits.SingleLine
    )

    val s4 = remember { TextFieldState("Multiline scrollable " + loremIpsum(wordCount = 50)) }
    BasicTextField(
        state = s4,
        textStyle = style,
        modifier = Modifier.padding(16.dp).padding(start = 100.dp).width(200.dp)
            .border(1.dp, Color.Black),
        lineLimits = TextFieldLineLimits.MultiLine(maxHeightInLines = 6)
    )

    val s5 = remember { TextFieldState(loremIpsum(wordCount = 30)) }

    BasicTextField(
        state = s5,
        textStyle = style,
        modifier = Modifier.padding(50.dp).fillMaxWidth(),
        decorator = {
            TextFieldDefaults.TextFieldDecorationBox(
                innerTextField = it,
                enabled = true,
                interactionSource = remember { MutableInteractionSource() },
                singleLine = false,
                value = s5.text.toString(),
                visualTransformation = VisualTransformation.None,
                leadingIcon = {
                    Icon(
                        imageVector = Icons.Default.Star,
                        contentDescription = null
                    )
                },
                trailingIcon = {
                    Icon(
                        imageVector = Icons.Default.Star,
                        contentDescription = null
                    )
                }
            )
        }
    )
}

This should be tested by QA

Release Notes

Features - iOS

  • Magnifier support for BasicTextField(TextFieldState)

Copy link
Collaborator

@ASalavei ASalavei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you for the MR!

CI checks are not listed here, but I can confirm that they all passed successfully.
cc @igordmn .

@igordmn
Copy link
Collaborator

igordmn commented Sep 9, 2024

CI checks are not listed here

You should create pull/1549 branch and push. Then CI checks will run

@ASalavei
Copy link
Collaborator

ASalavei commented Sep 9, 2024

CI checks are not listed here

You should create pull/1549 branch and push. Then CI checks will run

@igordmn , that what I did: https://github.com/JetBrains/compose-multiplatform-core/tree/pull/1549
It went well on CI, but hasn't beed added to checks here.

@alexzhirkevich
Copy link
Author

alexzhirkevich commented Sep 10, 2024

hasn't beed added to checks here.

It was added to the last commit you pushed to that branch. it probably needs to be the last commit of the PR to appear on the PR itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants