Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3176] Android: Add support for custom activity close animation

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-04-22T15:19:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJesper Jonsson
AssigneeShak Hossain
Created2013-04-22T10:32:56.000+0000
Updated2016-03-08T07:57:34.000+0000

Description

Problem

The open window method have activityEnterAnimation and activityExitAnimation that can be used to specify the animation of the transition between the current and the new activity. The same properties should be available to the close window method so the close animation can be customized. When implemented the attached project should be able to transition both on open and close.

Test case

var win = Ti.UI.createWindow({
   backgroundColor : '#fff',
   orientationModes : [Titanium.UI.PORTRAIT],
   exitOnClose : true,
   navBarHidden : true
});
win.open();
var button = Titanium.UI.createButton({
   title: 'Open new window',
   width: 300,
   height: 75
});
button.addEventListener('click',function(e) {
   var win2 = Ti.UI.createWindow({
	   backgroundColor : '#0ff',
	   orientationModes : [Titanium.UI.PORTRAIT],
	   navBarHidden : true
	});
	win2.addEventListener('android:back', function() {
		win2.close({
			activityEnterAnimation: Titanium.App.Android.R.anim.slide_in_right,
    		activityExitAnimation: Titanium.App.Android.R.anim.slide_out_left
		});
		
		win2.removeEventListener('android:back', arguments.callee);
	})
	win2.open({
		activityEnterAnimation: Ti.Android.R.anim.slide_in_left,
    	activityExitAnimation: Ti.Android.R.anim.slide_out_right
	});
});
win.add(button);

Attachments

FileDateSize
Project.zip2013-04-22T10:32:56.000+0000751071

Comments

  1. Jesper Jonsson 2013-04-22

  2. Daniel Sefton 2013-04-22

    Hi Jesper, Thanks, so I'll close this as duplicate - you can interject in TIMOB-13543 if there's anything you think they're missing.

JSON Source