-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[WIP][iOS]Add TextField OCR engine side support #29229
Conversation
The new API |
This is dependent on flutter/flutter#85555 |
b1a8771
to
2962099
Compare
I want to use |
…InputPlugin test.
Hi @chunhtai Could you give this PR a review? Thx😄 |
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.
This LGTM, @LongCatIsLooong would you mind also taking a look?
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
@@ -1621,6 +1634,11 @@ - (NSString*)contrastMode { | |||
} | |||
} | |||
|
|||
- (BOOL)captureTextFromCameraEnabled { | |||
UITextField* textField = [self textField]; | |||
return [textField canPerformAction:@selector(captureTextFromCamera:) withSender:nil]; |
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.
Is there a notification you can listen to, if the value you get here changes?
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.
For instance will the value become false, if the user rejects the camera permission?
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.
This api invokes system internal camera API and it seems that is will not ask users for camera permission..
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.
iOSDemo 2.zip
Here is demo code. I didn't request any permission
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.
Without the capability of monitoring the results of this canPerformAction:
call I think it would be better to implement this feature in a way that's similar to paste: introduce an API that allows the developer to query whether live text is currently enabled on the platform, otherwise they may get outdated value?
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.
Got it. I will take a look. Thx
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.
Ah I thought you could still turn camera access off in Settings? (don't have a test device available atm, I'll give this a try tomorrow)
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.
Yeah if you disable camera access in Settings -> Screen Time -> Content & Privacy Restrictions -> Allowed Apps, the text edit menu item will be gone.
Oh,I didn't find this place before😯😯.
Got it. I will find a better solution,Thx😁😁
发自我的iPhone
…------------------ Original ------------------
From: LongCatIsLooong ***@***.***>
Date: Thu,Jun 2,2022 0:59 AM
To: flutter/engine ***@***.***>
Cc: WenJingRui ***@***.***>, Author ***@***.***>
Subject: Re: [flutter/engine] [iOS]Add TextField OCR engine side support (PR #29229)
@LongCatIsLooong commented on this pull request.
In shell/platform/darwin/ios/framework/Source/FlutterViewController.mm:
> @@ -1621,6 +1634,11 @@ - (NSString*)contrastMode { } } +- (BOOL)captureTextFromCameraEnabled { + UITextField* textField = [self textField]; + return [textField ***@***.***(captureTextFromCamera:) withSender:nil];
Yeah if you disable camera access in Settings -> Screen Time -> Content & Privacy Restrictions -> Allowed Apps, the text edit menu item will be gone.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi @jmagman @LongCatIsLooong |
Preview:
https://user-images.githubusercontent.com/49340347/137671033-cf99050f-e4f3-47eb-a346-1b7e4063a2b8.mp4
Related PR in flutter framework (WIP)
flutter/flutter#96637
List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#91896
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.