Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1314] Android: 2D matrix was not working

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-30T07:14:43.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules, Titanium SDK & CLI
Labelsandroid
ReporterAshish
AssigneeMotiur Rahman
Created2015-09-11T05:58:36.000+0000
Updated2016-03-08T07:37:43.000+0000

Description

2D matrix was not working in android. i want to implement feature similar to 3D matrix in IOS to move image/View on the screen kindly suggest me alternative way to implement this feature in android. we have tried the below code it doesnt work for android if(Alloy.Globals.isAndroid == false) { var olt = Titanium.UI.create3DMatrix(), curX, curY; view.addEventListener('touchstart', function(e) { curX = e.x; curY = e.y; }); view.addEventListener('touchmove', function(e) { var deltaX = e.x - curX, deltaY = e.y - curY; olt = olt.translate(deltaX, deltaY, 0); view.animate({ transform : olt, duration : 100 }); }); }

Comments

  1. Papia Chowdhury 2015-09-16

    Hello, I have tested this issue. 2D matrix is working in my environment. *Testing Environment:* Appcelerator Studio, build: 4.3.0.201509031836 AppC CLI: 5.0.0-50 Titanium SDK: 4.1.1 GA Android Emulator: Google Nexus 4 - 4.1.1 OS X version: 10.9.5 *Steps to test:* 1. Create a classic project 2. Replace app.js with following code 3. Run project Click on animate button and observe that it's working for android. *Test Case:*
       var win = Ti.UI.createWindow();
       var label = Ti.UI.createLabel({
       	font : {
       		fontSize : 50
       	},
       	text : 'Appcelerator',
       	textAlign : 'center',
       	top : 100,
       });
       win.add(label);
       var button = Ti.UI.createButton({
       	title : 'Animate',
       	bottom : 20,
       	width : 200,
       	height : 40
       });
       win.add(button);
       button.addEventListener('click', function() {
       	var t1 = Ti.UI.create2DMatrix();
       	t1 = t1.translate(0, 300);
       	var a1 = Ti.UI.createAnimation();
       	a1.transform = t1;
       	a1.duration = 800;
       	label.animate(a1);
       });
       win.open(); 
       
    Thanks

JSON Source