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-12176: fix list view issues #3972
Conversation
The replaceSectionAt() method also has different behavior with iOS. |
case MSG_UPDATE_ITEM_AT: { | ||
AsyncResult result = (AsyncResult) msg.obj; | ||
KrollDict data = (KrollDict) result.getArg(); | ||
int index = data.getInt("index"); |
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.
Use TiC constant.
Text is still not wrapped. BTW, Ti.UI.Label dose not enable wordWrap by default now. But from the doc, wordWrap should be true by default. |
replaceItemsAt() still has different behavior with iOS. |
Here is the results of the first pass of the KS->List View test https://docs.google.com/spreadsheet/ccc?key=0Ai_iBzK2t1G0dElUQzJ0UW1mSHpsSEFpMkJmVW5DTVE&usp=sharing |
BTW, please merge with master since rhino has been already removed. |
if (source != null && !source.equals(this) && listProxy != null) { | ||
TiViewProxy listViewProxy = listProxy.get(); | ||
if (listViewProxy != null) { | ||
listViewProxy.fireEvent(TiC.EVENT_ITEM_CLICK, eventData); |
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.
The itemclick event should be fired from native android ListView through OnItemClickListener. We don't need to manually fire this event from every child item. If the OnItemClickListener does not work as expect, this means we miss something important in the native android part. This missing does not only affect the itemclick event but also affects all the background selected color / highlight color which should be handled by the native android ListView. We have to fix this from the root; otherwise, our listview won't work correctly.
When clicking on the row (not a child view), the app crashes. The crash log is |
The itemclick event does not work if clicking on the row itself (not on a label or an image). |
Code reviewed and functionally tested. Here is the result of KS->List View test https://docs.google.com/spreadsheet/ccc?key=0Ai_iBzK2t1G0dElUQzJ0UW1mSHpsSEFpMkJmVW5DTVE&usp=sharing |
timob-12176: fix list view issues
Fixes include:
-showVerticalIndicator should work properly when toggle on/off
-correct sectionIndex, itemIndex values
-events won't bubble past listItem (iOS parity)
-allow defaultItemTemplate to change
-implement updateItemAt. This behaves same as replaceItemsAt. This implementation is for parity with iOS.
-replaceItemsAt no longer append when trying to replace an item with index = items.size()
-'items' is now a property in section, with read/write capabilities.
-fix layout glitches for built-in template
-'wordWrap' property in label is now true by default.
Update:
-itemclick event should now fire appropriately when a child view is clicked
-added icon for disclosure image
-fixed deleteItemsAt bug in KS Listview test