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-10271: Implement getZIndex on UI View #123
TIMOB-10271: Implement getZIndex on UI View #123
Conversation
Reviewer: JP Change Log: - added setZIndex and getZIndex properties to NativeControlObject - added zIndex to TiUIBase - modified tibbtest/app.js to test zindex Test Cases: - build tibb - build tibbtest - run tibbtest - a blue label at the top should display zindex of 'Button 1' and 'Button 2' - default value should be 'undefined' - push 'Push Me' button - button 1 should overlap button 2 - label at top should display: 'ZIndex of button 1=200, ZIndex of button 2=undefined' - push 'Push Me' button again - button 2 should overlap button 1 - label at top should display: 'ZIndex of button 1=200, ZIndex of button 2=500' https://jira.appcelerator.org/browse/TIMOB-10271
@@ -109,6 +109,8 @@ class NativeControlObject : public NativeProxyObject | |||
virtual int setVisible(TiObject* obj); | |||
virtual int setWidth(TiObject* obj); | |||
virtual int setWindow(TiObject* obj); | |||
virtual int setZIndex(TiObject* obj); | |||
virtual int getZIndex(TiObject* obj); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move getZIndex higher to keep alphabetical order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
when I initialized view with zIndex e.g. var testbutton1=Ti.UI.createButton applicatin is crashing, in NativeControlObject::setZIndex from |
Reviewed |
fixed zIndex problem during initialization |
issues addressed |
if we modify js script's mybutton.addEventLister to be: mybutton.addEventListener On the second click, second button should go back, and third button should appear on front. |
{ | ||
int myIndex = parent->indexOf(container_); | ||
Q_ASSERT(parent->count() > 0); | ||
for (int i = parent->count() - 1; i > myIndex; i--) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should iterate through all the containers:
In case if zIndex is smaller than the previous value, we should put it back (smaller index).
reviewed |
fixed loop to insert at the correct location |
changed to use common function for calculating zorder |
patch updated |
Approved |
TIMOB-10271: Implement getZIndex on UI View
Reviewer: Harut
Change Log:
Test Cases:
'ZIndex of button 1=200, ZIndex of button 2=undefined'
'ZIndex of button 1=200, ZIndex of button 2=500'
https://jira.appcelerator.org/browse/TIMOB-10271