Skip to content

Commit

Permalink
Merge pull request #9144 from garymathews/TIMOB-24822
Browse files Browse the repository at this point in the history
[TIMOB-24822] Fix TableView issue on Android N
  • Loading branch information
ssjsamir authored Jun 26, 2017
2 parents b95498e + 6bfc63a commit aa4a45e
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,20 @@ public View getView(int position, View convertView, ViewGroup parent) {
// Default creates view for each Item
boolean sameView = false;
if (item.proxy instanceof TableViewRowProxy) {
TableViewRowProxy row = (TableViewRowProxy)item.proxy;
TableViewRowProxy row = (TableViewRowProxy) item.proxy;
if (row.getTableViewRowProxyItem() != null) {
sameView = row.getTableViewRowProxyItem().equals(convertView);
}
// TIMOB-24560: prevent duplicate TableViewRowProxyItem on Android N
if (Build.VERSION.SDK_INT > 23) {
ArrayList<Item> models = viewModel.getViewModel();
for (Item model : models) {
TableViewRowProxy proxy = (TableViewRowProxy) model.proxy;
if (proxy.getTableViewRowProxyItem().equals(convertView)) {
sameView = true;
v = null;
break;
}
}
}

// TIMOB-24560: prevent duplicate TableViewRowProxyItem on Android N
if (Build.VERSION.SDK_INT > 23) {
ArrayList<Item> models = viewModel.getViewModel();
if (models != null && models.contains(v.getRowData())) {
return v;
}
}

if (!sameView) {
if (v.getClassName().equals(TableViewProxy.CLASSNAME_DEFAULT)) {
if (v.getRowData() != item) {
Expand Down

0 comments on commit aa4a45e

Please sign in to comment.