[TIMOB-13543] Android: add support for activityEnterAnimation and activityExitAnimation for Window.close method
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-10T20:37:14.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | 2013 Sprint 14, 2013 Sprint 14 API, Release 3.1.2, Release 3.2.0 |
Components | Android |
Labels | activityExitAnimation, android, close, exalture, module_window, open, qe-testadded, window |
Reporter | Carter Lathrop |
Assignee | Biju pm |
Created | 2013-04-12T14:09:27.000+0000 |
Updated | 2013-10-23T23:15:18.000+0000 |
Description
*Problem*
The ability to animate enter and exit activities on opening windows is working fine, but this is only useful when you need to progress forward in an apps UI. If one wants to close windows and go backwards (hit the back button) they cannot use the animations which only work on win.open() and not on win.close(). The pull request below allows the ability to use the activityAnimations when closing a window.
test case for the pull request
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
var button = Ti.UI.createButton({title:'open'});
button.addEventListener('click', function (){
var win = Ti.UI.createWindow({
backgroundColor:'blue',
modal:false
});
win.addEventListener('android:back', function(){
win.close({
activityExitAnimation: Ti.Android.R.anim.slide_out_right
});
})
win.open({
activityEnterAnimation: Ti.Android.R.anim.fade_in,
})
})
win.add(button);
win.open();
pull request https://github.com/appcelerator/titanium_mobile/pull/4152
Martin, what version of Ti SDK are you experiencing this on?
Unable to reproduce with 3.0.2GA and 3.1.xx on Android 4.1.2. Fading working as expected on both exit and entrance to new blue window. Can you please provide more details as well as steps to reproduce so that I may have better luck reproducing this issue? For reference on how to submit a bug report: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report Regards, Carter
This feature was introduced for 3.2.0 and as mentioned in the environment this bugs is on 3.2.0 master In fact after working on it it apperas that activityExitAnimtation doesn't do what we expect it to do. It doesn't hanfdle the closing of your window but how the current window disappear. So it s much of a new addition tu support window close animation
You won't be able to test this with any official release. It s not yet in. You have to build and use the master branch
Martin, wasn't this implemented in 3.1? I made a mistake using 3.0.2 before, I thought it was implemented then. Regardless this is a bug due to the activityEnterAnimation working but the exit is not. Thanks for bringing this to our attention, Carter
Docs say 3.1: http://docs.appcelerator.com/titanium/3.0/#!/api/openWindowParams-property-activityExitAnimation
Yes you are right. That s it. It often misunderstood what activityExitAnimation does and I did! My pull request add what I was expecting it to do, it adds support for animation when closing a heavyweight window I will update my test case tomorrow to ahow its full potential( alreDy using it and it s working great)
Maybe you could rename that ticket to "support for activityEnterAnimation and activityExitAnimation for Window.close method"
I'm pretty sure that activityEnterAnimation is working, it's just activityExitAnimation that is not triggering. Am I missing something?
Both were working. While creating that pullrequest i thought the exit one wasn't working I was expexting it to define the animation when I close my window I was wrong. My pull request adds the support for what I was missing: animation upon window close. The two properties can be used for Aactivity.start and Activity.finish
Ok, so the activityEnterAnimation is for the new window that is being opened and the activityExitAnimation is for the OLD window that is being opened over, for some reason I didn't realize this before. Now I understand your need for the close activityAnimations for when you want to return to previous windows using an animation, Ill change around the ticket description to reflect this.
I didn't realized that either. That's why my bug request was misleading you. Sorry
Ok, made the changes, feel free to add to it for clarity. I may have removed your first test code on accident, if you want to replace it, go ahead if you think it is needed.
I ll update the testcase tomorrow to show the full potential
Ok, thanks again for your input and pull request. Engineering will review it asap.
new test case showing the full power of it
Everything else seems fine to me. Thanks for your work
add support enter animation and exit animation for window close activity https://github.com/appcelerator/titanium_mobile/pull/4344
Fixed as a part of https://github.com/appcelerator/titanium_mobile/pull/4417
Updated Label. Closing as Fixed. Verified with: Studio: 3.1.2.201307261628 SDK: 3.1.2.v20130726192706 acs:1.0.4 alloy:1.2.0-alpha titanium:3.1.1 titanium-code-processor:1.0.2-alpha OS: OSX 10.8.4 Device: Google Nexus 7 (v4.2.1) activityEnterAnimation and activityExitAnimation working well both for Window.close and Window.open method.