Skip to content

Commit

Permalink
Merge pull request #7682 from ashcoding/TIMOB-20038_Master
Browse files Browse the repository at this point in the history
[TIMOB-20038] Android: TableView crash fix
  • Loading branch information
hieupham007 committed Feb 5, 2016
2 parents 7eaa97b + fa0c7e7 commit 17045ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -161,7 +161,9 @@ public long getItemId(int position) {

@Override
public int getViewTypeCount() {
return maxClassname;
// Fix for TIMOB-20038. Seems that there are 3 more
// hidden views that needs to be recreated onLayout
return maxClassname + 3;
}

@Override
Expand Down Expand Up @@ -279,7 +281,7 @@ public TiTableView(TableViewProxy proxy)
this.proxy = proxy;

if (proxy.getProperties().containsKey(TiC.PROPERTY_MAX_CLASSNAME)) {
maxClassname = TiConvert.toInt(proxy.getProperty(TiC.PROPERTY_MAX_CLASSNAME));
maxClassname = Math.max(TiConvert.toInt(proxy.getProperty(TiC.PROPERTY_MAX_CLASSNAME)),maxClassname);
}
rowTypes = new HashMap<String, Integer>();
rowTypeCounter = new AtomicInteger(-1);
Expand Down
3 changes: 2 additions & 1 deletion apidoc/Titanium/UI/TableView.yml
Expand Up @@ -1291,7 +1291,8 @@ properties:
- name: maxClassname
summary: Max number of row class names.
description: |
See <Titanium.UI.TableViewRow.className> for more details.
See <Titanium.UI.TableViewRow.className> for more details. This property will default to
32 when it is set to a number lesser than that.
availability: creation
type: Number
default: 32
Expand Down

0 comments on commit 17045ed

Please sign in to comment.