-
Notifications
You must be signed in to change notification settings - Fork 76
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
Magnifier for iOS 17+ #1000
Magnifier for iOS 17+ #1000
Conversation
What is the correct way to get local |
@alexzhirkevich afaik for now we don't have such API |
PR looks good to me. Although, it shouldn't go to the next release, so I'll leave this PR without an approval for now. |
There is 1 issue. Then I checked Can it potentially be some expensive calls in selection logic? Here is what i'm talking about (jb-main and magnifier): jbmain.MP4magnifier.MP4 |
@alexzhirkevich Sorry for the delay, the team is busy with the upcoming 1.6.0 release. We'll come back to this after that |
@alexzhirkevich |
Fixed conflicts, but found a bug. |
Fixed it. The problem was when |
...skikoMain/kotlin/androidx/compose/foundation/text/CupertinoTextFieldPointerModifier.skiko.kt
Show resolved
Hide resolved
...skikoMain/kotlin/androidx/compose/foundation/text/CupertinoTextFieldPointerModifier.skiko.kt
Outdated
Show resolved
Hide resolved
...se/foundation/foundation/src/uikitMain/kotlin/androidx/compose/foundation/Magnifier.uikit.kt
Outdated
Show resolved
Hide resolved
...on/src/uikitMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.uikit.kt
Show resolved
Hide resolved
Just to warn: because of the platform layers refactoring done here, it might be a problem with magnifier positioning. Depending on which MR is merged first, the bug may need to be fixed in another one. |
...kitMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.uikit.kt
Outdated
Show resolved
Hide resolved
...se/foundation/foundation/src/uikitMain/kotlin/androidx/compose/foundation/Magnifier.uikit.kt
Outdated
Show resolved
Hide resolved
…mpose/foundation/Magnifier.uikit.kt
...kitMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.uikit.kt
Outdated
Show resolved
Hide resolved
…mpose/foundation/text/selection/TextFieldSelectionManager.uikit.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from my side. Thank you for the feature!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me too
thank you for PR!
The PR is related to a crash on pre iOS 17 devices The symbol UITextLoupeSession is uniquely referenced here. |
} | ||
|
||
internal fun isPlatformMagnifierSupported() = | ||
available(OS.Ios to OSVersion(major = 17)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a check for iOS version. It is implemented incorrectly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's implemented correctly, but the problem is due to linking. K/N can see the symbol and tried to link it during the launch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll promote this problem to K/N team, the only known workaround as of now is to use strings and C-apis directly to avoid mentioning the symbol altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use strings and C-apis directly
Do you mean using cinterop like here or something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I actually meant barebone ObjC runtime, but @ASalavei came with a much better solution to simply hide the symbols from cinterop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simply hide the symbols from cinterop
I thought about it too. Nice solution.
I seen some places in skiko where iOS 13 is checked the same way and class/method is loaded. Should it be fixed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Methods are not a big deal, ObjC will simply throw unrecognised selector exception in case we don't do a version check. The classes are a problem (currently), can you leave a link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one place in Skiko, and it seems like No, there are no iOS 13 specific classes, only a method call, which is wrapped into proper check.
Proposed Changes
Testing
Test: try magnifier in all types of text fields
Issues Fixed
Partly: JetBrains/compose-multiplatform#3692