Since Android 3.0, we have the possibility to set basic 3D transformations to Views using setRotationX and setRotationY, for instance.
In a specific case, I would need to achieve a complex transformation that is rotating around a distant pivot point then scaling on a different pivot point. This is not possible simply by using setScaleX/Y and setRotationX/Y since they share the same pivot point.
Does any simple way exist to provide the desired matrix to the view for display?
For now, I have found two possible workarounds:
Set up a rotation matrix then use it to map a {0,0} point; apply the resulting point to the View's translation then use the View's setScaleX/Y to set the scaling
Hack the View's onDraw and apply the transformation on the canvas. Add the logic to reverse map touch events, too.
Both are not really convenient since I am building an AdapterView which displays its items using a configurable effect; for example, it can be possible to switch the effect to have the items arrranged in a circle or like a "cover flow".