How to use PasswordBox on Android?
Noesis (and WPF) provide a PasswordBox control to let the user enter a password.
In the Unity player (on Windows) this works perfectly, but on Android it doesn't:
* First of all, while typing all the characters are visible. Typically on Android, all the characters would be replaced by '*' except the last entered character which is displayed for a short time.
* But more importantly, the data that is entered by the user is never actually copied into the PasswordBox!
XAML code:
Code-behind:
In the Unity player (on Windows) this works perfectly, but on Android it doesn't:
* First of all, while typing all the characters are visible. Typically on Android, all the characters would be replaced by '*' except the last entered character which is displayed for a short time.
* But more importantly, the data that is entered by the user is never actually copied into the PasswordBox!
XAML code:
Code: Select all
<PasswordBox PasswordChar="*" x:Name="_passwordBox"/>
Code: Select all
public LogInV()
{
this.Loaded += LogInV_Loaded;
}
void LogInV_Loaded(BaseComponent sender, RoutedEventArgs e)
{
_passwordBox = FindName<PasswordBox>("_passwordBox");
if (_passwordBox == null)
{
_log.Log("_passwordBox not found");
return;
}
_passwordBox.PasswordChanged += _passwordBox_PasswordChanged;
}
void _passwordBox_PasswordChanged(BaseComponent sender, RoutedEventArgs e)
{
// THIS CODE WILL NEVER BE INVOKED ON ANDROID![/color]
var password = _passwordBox.GetPassword();
_log.Log("password changed: [" + password + "]");
}
-
-
sfernandez
Site Admin
- Posts: 3197
- Joined:
Re: How to use PasswordBox on Android?
It was a bug, our script was not taking into account the PasswordBox type to open the TouchScreenKeyboard.
Please overwrite the script at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisGUISystem.cs with the one attached here and this issue will be solved.
Please overwrite the script at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisGUISystem.cs with the one attached here and this issue will be solved.
- Attachments
-
- NoesisGUISystem.zip
- (3.15 KiB) Downloaded 203 times
Re: How to use PasswordBox on Android?
Thanks for the fix, it now works as expected. I've noticed that this fix hasn't made it in the latest release (1.1.8), hopefully it will be in the next one. But for now my problem is solved.
Re: How to use PasswordBox on Android?
Yes, it was too late to be included in v1.1.8. v1.1.9 will make it.
thanks!
thanks!
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests