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-8814 - Simple animation #35

Merged
merged 13 commits into from May 17, 2013

Conversation

pec1985
Copy link
Contributor

@pec1985 pec1985 commented May 6, 2013

Test:

var win = Ti.UI.createWindow({
    title : 'Window',
    backgroundColor : '#28292c',
    barColor : '#28292c'
});

var view = Ti.UI.createView({
    top: 10,
    left: 10,
    width: 100,
    height: 100,
    backgroundColor: 'red'
});

var btn1 = Ti.UI.createButton({
    title: 'left 10, top: 10, opacity: 0.3',
    bottom: 60
});

var btn2 = Ti.UI.createButton({
    title: 'left: 200, top: 100, duration: 2000, opacity: 1',
    bottom: 0,
});

win.add(btn1);
win.add(btn2);
win.add(view);

btn1.addEventListener('click', function(){
    var animation = Ti.UI.createAnimation({
        left: 10,
        top: 10,
        opacity: 0.3,
        duration: 1000
    });
    view.animate(animation);
});

btn2.addEventListener('click', function(){
    view.animate({
        left: 200,
        top: 100,
        duration: 2000,
        opacity: 1
    }, function(e){
        alert('end');
        Ti.API.info(this);
        Ti.API.info(JSON.stringify(this));
    });
});

win.open();

@@ -154,6 +154,7 @@ class NativeControlObject : public NativeProxyObject
static int getBoolean(TiObject* obj, bool* value);
static int getFloat(TiObject* obj, float* value);
static int getInteger(TiObject* obj, int* value);
static int getStdString(TiObject* obj, std::string* value);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not add another V8 string conversion method. Use V8Utils V8StringToQString().
You can get a std::string if you really need it from a QString using toStdString().

We should really void std::string since it isn't unicode safe, but for layout properties it might be okay for now.

@joshthecoder
Copy link
Contributor

Code review finished. Please address comments and also re-merge with master to fix merge conflicts. Thanks.

@ghost ghost assigned joshthecoder May 9, 2013
Conflicts:
	src/tibb/NativeObject.h
	src/tibb/TiUIObject.cpp
	src/tibb/TiUIObject.h
Conflicts:
	src/tibb/NativeControlObject.cpp
	src/tibb/NativeControlObject.h
	src/tibb/NativeObjectFactory.cpp
@pec1985
Copy link
Contributor Author

pec1985 commented May 14, 2013

Fixed PR, there were several conflicts from different pull requests

@joshthecoder
Copy link
Contributor

Tested and code reviewed. LGTM.

Conflicts:
	src/tibb/NativeObjectFactory.cpp
	src/tibb/TiUIObject.cpp
joshthecoder added a commit that referenced this pull request May 17, 2013
TIMOB-8814 - Simple animation
@joshthecoder joshthecoder merged commit d517bed into appcelerator-archive:master May 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants