Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24321] Android: Add pivotX and pivotY to view

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-09-24T14:06:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsandroid, community, notable
ReporterHazem Khaled
AssigneeGary Mathews
Created2017-01-17T21:28:57.000+0000
Updated2018-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)

Comments

  1. Hazem Khaled 2017-01-17

    pr: https://github.com/appcelerator/titanium_mobile/pull/8759
  2. Michael Gangolf 2018-09-23

    new PR: https://github.com/appcelerator/titanium_mobile/pull/10336 using anchorPoint for party.
  3. Hans Knöchel 2018-09-24

    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();
       
  4. Samir Mohammed 2018-09-25

    *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.js

    Ran the program

    Able to see the view set around the given x and y parameters

    *Test Environment*
       APPC Studio: 5.1.0.201808080937
       iPhone 6 (12.0)
       APPC CLI: 7.0.7-master.1
       Operating System Name: Mac OS Mojave
       Operating System Version: 10.14
       Node.js Version: 8.9.1
       Xcode 10.0
       

JSON Source