How to keep soft keyboard opened on iOS. Flash Builder 4 - ios

I'm building chat application for mobile devices with Adobe Flash Builder 4.6.
I have s:TextInput for message entering and s:Button for sending message.
When user enters message and taps "Send" keyboard goes down. I want to keep it opened.
I can use textInput.setFocus() and setFocus with setTimeout(), but it gives unexpected results sometimes. For example soft keyboard can jump or goes down without resizing stage.
Could you recommend good solution for keeping soft keyboard opened when taping outside text input (focus should left in text input).

What worked for me was:
Create a listener for the TextInput focus out event
Put textInput.setFocus() code in that listener handler
When I want the textInput to be able to focus out for specific cases I create a lockFocus variable for the listener to check first before deciding to reassign focus or not.
Hope that helps!

Related

React Native KeyboardAvoidingView on iOS does not update its position when the view behind gets updated

I'm using the KeyboardAvoidingView in a dynamic form where errors are being displayed or disappear while typing.
On Android, everything works fine and the KeyboardAvoidingView "moves" when an error appears, to always show the keyboard right below the input field.
However on iOS, whenever an error appears at the top of the input, the input gets pushed down, and the keyboard doesn't move. Because of that, the input gets behind the keyboard and can't be seen while the user is typing.
Is there a simple fix for that, or do you necessarily need to play with a useEffect to update the position of the keyboard manually?
I'm also open to any other alternative, if there is!

How to prevent the input field from losing focus when the user taps elsewhere in the screen?

How do I prevent an input field from losing focus when the user taps elsewhere other than the onscreen keyboard and the input field?
What I would like to happen is that even if the player taps on a button elsewhere, the keyboard remains up, and when they tap on the keyboard to type, the focus is still on the input field.
I should also note that I am working with Unity3D and UGUI. I have built my Unity project and am modifying the iOS keyboard functionality via Keyboard.mm. I'm doing this primarily because how the TouchScreenKeyboard works out of the box from Unity3D doesn't fit my requirements.
I don't know about unity, but some things to try:
When a keyboard is showing, remember the current focused field, and
when any other element is touched, hand back the focus to the
remembered field after the touch was processed.
Remember the focus
field, and when the user touches the keyboard again, set the focus to
the remembered field.
Next to remembering the focus field and set the focus again when needed I fear there will be not many solutions, independent from the framework you're working in.

Is there a way with Xamarin.Forms to detect the software keyboard in my iOS app?

I have a Xamarin.Forms application with a login screen. I have added code to move the controls out of the way, when one of the Entry fields gets focus. I move the views back down in the Unfocus event handlers. In the simulator I can prevent the software keyboard from popping up. Unfortunately my event handlers still move the view up and down even without the keyboard.
Is there a way to detect the keyboard's appearance in Xamarin.Forms, while in the event handlers on the ContentPage?
I don't think there is support for this out of the box and thus I'd go with DependencyService and implement it by myself.
You could use ContentPage.LayoutChanged event.
It works because the keyboard doesn't display over the content page as one would guess, but under it, in the same layer, so it push the page up.

What is the equivalent of Android Toast in RIM?

In android, there is a function call Toast and it show instantly without involve in time. I tried to use Status in RIM but it must run in the invokeLater and cannot set the time less than 1 second. So it cannot display instantly.
Any other built in that same with Toast or Status?
No there is not afaik. Toast was "invented" in a way by Android.
Previous OS's have used popup boxes with confirmation buttons. A Toast is almost like a popup box with a timer attached to it.
Of course, #Signare gives the common replacement correctly for what you would "normally" do on BlackBerry. Dialog.alert(String)
If you want something more "Androidy", this is something we want to implement at Cobi, but have not gotten around to yet due to time constraints working on client work.
There are 2 unique aspects to a Toast compared to the "old" way of doing things:
the popup only shows for a short time
the popup does not block the user from interacting with the background screen at all
To create the popup screen, look at the PopupScreen class - and you pass in a layout manager of your own that will be displayed.
You could start a timer when the screen is shown (we have not implemented this yet) and that could close the screen for you.
As far as not blocking the user - this is the major difference - and I do not know if it can be done if you use the PopupScreen class. Perhaps if your PopupScreen passes all keypresses through to the underlying screen, this may be possible.
In some of our apps, we have a custom field, defined in our base MainScreen subclass, that can be positioned over the rest of the fields on the screen. This allows the user to continue interacting with the screen while the field is displayed. I cannot share that code at the moment here.

detecting notificationbox close event - firefox addons

We are using to display custom notifications for a
Firefox addon. All is good, except that we also need to do some custom
cleanup activity when the user presses the red [x] button (in Windows)
on the right side of our notification bar to close it (or technically
"hide" it).
That said, what would be the best way to detect or get an indication
that the user has pressed the red [x] button to close/hide the
notification?
There is this event AlertClose as the document say but how to handle it?
i tried this but no effect..
notificationobj.addEventListener('AlertClose',function() { alert('closed'); },false)
The bad news is the "AlertClose" is only fired in Firefox Mobile. We should move the event to the toolkit so all apps get the support. I don't have any good ideas, except using a DOM mutation event to watch for "DOMNodeRemoved".

Resources