[TIMOB-24321] Android: Add pivotX and pivotY to view
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-09-24T14:06:27.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | Android |
| Labels | android, community, notable |
| Reporter | Hazem Khaled |
| Assignee | Gary Mathews |
| Created | 2017-01-17T21:28:57.000+0000 |
| Updated | 2018-09-25T15:18:46.000+0000 |
Description
After TIMOB-23423, we need to add pivotX and pivotY
https://developer.android.com/reference/android/view/View.html#setPivotX(float)
https://developer.android.com/reference/android/view/View.html#setPivotY(float)
pr: https://github.com/appcelerator/titanium_mobile/pull/8759
new PR: https://github.com/appcelerator/titanium_mobile/pull/10336 using anchorPoint for party.
Test-Case:
var win = Ti.UI.createWindow({ backgroundColor: "white" }); var view = Ti.UI.createView({ width: 150, height: 300, backgroundColor: "red", borderRadius: 10, touchEnabled: false, anchorPoint: { x: 0, y: 0 } }) var rot = 0; setInterval(function() { view.rotation = (rot += 1); }, 100); var btn = Ti.UI.createButton({ title: "set center" }) btn.addEventListener("click", function() { view.anchorPoint = { x: 0.5, y: 0.5 } }) win.add(btn); win.add(view); win.open();*Closing ticket.* Verified fix in SDK version
7.5.0.v20180920040518. Able to see pivotX and pivotY set to views and being applied. *FR Passed (Test Steps)*Created a new titanium application
Copied the above code above in the comments and added it into the
app.jsRan the program
Able to see the view set around the given x and y parameters
*Test Environment*