[TIMOB-15803] Android: Add Matrix3D support
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | 3DMatrix, android, animation, matrix, parity |
Reporter | Radamantis Torres-Lechuga |
Assignee | Joshua Quick |
Created | 2013-11-23T00:09:50.000+0000 |
Updated | 2020-04-29T21:21:54.000+0000 |
Description
*Summary:*
On Android, we should add
Matrix3D
support like iOS.
https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Matrix3D
*Use Case:*
App devs would like to implement "flip" animations in a cross-platform manner.
*Work-Around:*
The Titanium View
type has the following Android-only properties that allow you to manipulate the view in 3D. Unfortunately, you can use these via our animation APIs.
* [rotationX](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-rotationX)
* [rotationY](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-rotationY)
* [translationZ](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-translationZ)
*Recommended Solution:*
Android already has a 3D matrix Java class that we can leverage.
https://developer.android.com/reference/android/graphics/Matrix
We can apply 2D and 3D matix animations by deriving our own Animation
Java class and apply the matrix transformations via its applyTransformation()
method.
https://developer.android.com/reference/android/view/animation/Animation
Examples that are similar to what we want (but not exactly) are...
https://github.com/Miserlou/Android-SDK-Samples/blob/master/ApiDemos/src/com/example/android/apis/animation/Rotate3dAnimation.java
https://stackoverflow.com/a/57388468
We might want to consider refactoring our Ti2DMatrix
Java class to use Google's Matrix
class as well. This would require a major refactoring of our animation code.
No comments