Open coen22 opened 2 years ago
Thanks @coen22! This sounds like a cool new feature that would be useful for .NET MAUI devs!
There are two changes I'd like to make to this Proposal:
Behavior
instead of Effect
Behavior
instead of Effect
Effects aren't recommended for .NET MAUI.
Long story short, they were a lightweight way to add functionality to Xamarin.Forms controls to avoid the overhead of creating/writing/leveraging Custom Renderers. Since Custom Renderers no longer exist in .NET MAUI, Effects are essentially obsolete.
For the .NET MAUI Community Toolkit, we are implementing the functionality of Effects from Xamarin.CommunityToolkit by adding them as Behaviors. @pictos is leading this effort and has documented more information on it in this Proposal: https://github.com/CommunityToolkit/Maui/issues/124
I recommend leveraging the .NET MAUI interfaces to implement/enable this AutoComplete feature for all IText
elements.
This will ensure that all future/new IText
elements as well as all custom-made IText
elements will be able to leverage this feature.
I recommend opening a Discussion to chat about the API Surface and implementation for this feature. This is the best way to avoid additional rework in the future for this Proposal.
@brminnick thank you for your feedback. I'll create a discussion.
@coen22 can you link the discussion if you created it ? I'm interesting to propose on my app autofill hints one time code with sms otp. Until now i don't find any working solutions.
Thx
@coen22 can you link the discussion if you created it ? I'm interesting to propose on my app autofill hints one time code with sms otp. Until now i don't find any working solutions.
Thx
Here you go https://github.com/CommunityToolkit/Maui/discussions/374
In your XAML just add Entry.Behaviours Although I didn’t implement SMS OTP, you can find this page as a reference on Android https://developer.android.com/reference/androidx/autofill/HintConstants#AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE()
I wrote a little blog post showing how you can get OTP working on iOS: https://danielheddelin.blogspot.com/2024/06/otp-auto-fill-entry-for-ios-with-net.html
Autofill Hints
Summary
I would like to request to add autofill to MCT. Autofill is common in HTML, where the browsers remembers a user's details and fills them in. This is also possible on the OS level in Android, iOS and (I think also) macOS.
Motivation
It's nice for users to log in with a tap on their screen and it makes it easier to sign up for within an app.
Detailed Design
I've included the implementation that I have in Xamarin Forms. The namespaces have already been renamed.
This is the API class.
The Android class:
The iOS (and similarly macOS) class:
Usage Syntax
XAML Usage
Drawbacks
Currently the Android C# wrapper has limited support. The View class doesn't have all strings (e.g. AUTOFILL_HINT_PERSON_NAME_GIVEN), but they can be added manually. https://developer.android.com/guide/topics/text/autofill-optimize
Alternatives
N/A
Unresolved Questions
What is the 'correct' way of implementing this in MAUI? (now it's XF Compat)
Does Windows have something similar to Autofill?