When opening and closing a dialog, the parent window should fire a "blur" and "focus" event respectively. This is to match iOS' behavior.
Steps to reproduce:
- Build and run the below code on Android.
- Tap on the "Show Alert" button.
- View the Android log. Notice that a "blur" event was not received.
- Close the alert dialog.
- View the Android log. Notice that a "focus" event was not received.
Opening a dialog should fire the window's "blur" event.
Close a dialog should fire the window's "focus" event.
The window's focus/blur events are correctly fired when displaying a child window or when doing a suspend/resume. This is only an issue with displaying dialogs within a window.
Override the Java Activity.onWindowFocusChanged() method. This method will be invoked when opening/closing dialogs and child activities.
We'll need to re-evaluate the focus/blur handling via our TiBaseActivity class' onResume() and onPause() methods since the onWindowFocusChanged() method provides what we need. The current handling is used to handle focus/blur for TabGroup tabs.