Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24442] Android: Fix Ti.UI.View.rect x and y properties #8855

Merged
merged 1 commit into from Mar 8, 2017

Conversation

garymathews
Copy link
Contributor

  • Use component position for x and y properties of Titanium.UI.View.rect
TEST CASE
var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
    view = Ti.UI.createView({
        left: 100,
        top: 100,
        width: 100,
        height: 100,
        backgroundColor: 'red'
    });

win.addEventListener('open', function() {
    Ti.API.info('Initial');
    Ti.API.info('  rect.x: ' + view.rect.x);
    Ti.API.info('  rect.y: ' + view.rect.y);

    view.animate({
        top: 200,
        left: 200,
        duration: 1000
    }, function() {
        Ti.API.info('After Animation');
        Ti.API.info('  rect.x: ' + view.rect.x);
        Ti.API.info('  rect.y: ' + view.rect.y);
    });
})
win.add(view);
win.open();

JIRA Ticket

@garymathews garymathews added this to the 6.1.0 milestone Mar 1, 2017
@garymathews garymathews requested a review from antw12 March 1, 2017 15:18
Copy link
Contributor

@antw12 antw12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After Code Review, actually a cool way of doing it!! :)
CR PASS

@ssjsamir
Copy link
Contributor

ssjsamir commented Mar 8, 2017

FR Passed with the sample code provided, was able to see Ti.UI.View.rect properties update after a transform animation had taken place.

Steps I took to test:

  • Copy the code provided in the description
  • Ran the program
  • Saw that an animation took place
  • Check the console log to view the Ti.UI.View.rect properties

Output of console log shown below:

[INFO] : Initial
[INFO] : rect.x: 100
[INFO] : rect.y: 180
[INFO] : After Animation
[INFO] : rect.x: 200
[INFO] : rect.y: 280

Environment

Appcelerator Command-Line Interface, version 6.1.0
Google Nexus 6P (Android 7.1.1)
Operating System Name: Mac OS X El Capitan
Operating System Version: 10.11.6
Node.js Version: 4.6.0
npm: 4.2.8
Xcode: 8.2
Appcelerator Studio: 4.8.1.201612050850

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants