Kristof
Topic Author
Posts: 19
Joined: 22 Apr 2014, 14:44

How to use PasswordBox on Android?

19 May 2014, 14:35

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:
<PasswordBox PasswordChar="*" x:Name="_passwordBox"/>
Code-behind:
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 + "]");
}
 
User avatar
sfernandez
Site Admin
Posts: 3197
Joined: 22 Dec 2011, 19:20

Re: How to use PasswordBox on Android?

20 May 2014, 12:42

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.
Attachments
NoesisGUISystem.zip
(3.15 KiB) Downloaded 203 times
 
Kristof
Topic Author
Posts: 19
Joined: 22 Apr 2014, 14:44

Re: How to use PasswordBox on Android?

27 May 2014, 12:01

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.
 
User avatar
jsantos
Site Admin
Posts: 4195
Joined: 20 Jan 2012, 17:18
Contact:

Re: How to use PasswordBox on Android?

27 May 2014, 12:05

Yes, it was too late to be included in v1.1.8. v1.1.9 will make it.

thanks!

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests