[TIMOB-891] Android: window focus, blur events missing
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Marshall Culpepper |
Created | 2011-04-15T02:38:38.000+0000 |
Updated | 2011-04-17T01:54:35.000+0000 |
Description
Implement window focus/blur
Attachments
File | Date | Size |
---|---|---|
screen-shot-2011-03-19-at-214.png | 2011-04-15T02:38:39.000+0000 | 123748 |
This is crucial to how my apps work when users change tabs. Since a few of the tabs use the same code in different contexts - eg: twitter timelines for friends, mentions, favorites etc. I suppose I could code around it for now and use copies of various scripts.
Any idea when this might get addressed?
It's a bit of a showstopper.
@kosso can you paste a boiled down use case for you app? we'd like to get this fixed
Hi,
Try this: http://pastie.org/1035404">http://pastie.org/1035404
It contains the JS required for app.js and test.js - for a simple test
The use case for this is for (example) a Twitter client, where each tab is used for the list of tweets.
They all the use same functions based in app.js but with differnt contexts and 'request_type' (eg: friends, mentions, favorites, etc.) - The API requests and all the tableView building all uses functions in app.js too.
It seems that Ti on Android does not support the Window focus event which I use to see if the user has changed tab (and if it needs to request more data etc) and also it seems that it also does not support the ability for me to attach the name of the function in app.js as a window property when I build it - which works fine in iOS.
Hope this helps! ;)
K
Hi
The window focus and blur events are crucial for us!
We use the window blur event to cancel pending asynchronous HTTP requests that we don't wish to continue when the user selects another tab bar option, for example.
Thanks
Jon
Hi,
I just noticed that it does not work in 1.3.2, too. We want to use the 'blur' to open a specific window cause we do not want to display the previous opened window when the user presses the back button.
Hope this will be fixed/implemented soon.
Thanks
(from [17c619b957a9ace9c405b4e2ebc61dddbcd15b22]) [#891 state:resolved] Fake fired after context loaded, fire during onStart if the proxy is available for focus. Fire in onStop if there is a proxy for blur. http://github.com/appcelerator/titanium_mobile/commit/17c619b957a9ace9c405b4e2ebc61dddbcd15b22"> http://github.com/appcelerator/titanium_mobile/commit/17c619b957a9a...
This issue is still broken in 1.6.1
Tried the same code as copied from http://pastie.org/1035404">http://pastie.org/1035404.
This is the output when switching between the windows.
[INFO] Deployed testing ... Application should be running. [INFO] [18,725] this is test.js : request_type:test_one [INFO] [17,47175] this is test.js : request_type:test_two
Testing on android emulator