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-17572] iOS: Fix activity indicator animation in list items #9716

Merged
merged 2 commits into from Jan 16, 2018

Conversation

hansemannn
Copy link
Collaborator

@hansemannn hansemannn added this to the 7.1.0 milestone Jan 10, 2018
@hansemannn hansemannn self-assigned this Jan 10, 2018
@build build added the ios label Jan 10, 2018
@build
Copy link
Contributor

build commented Jan 10, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@mukherjee2 mukherjee2 self-requested a review January 12, 2018 00:13
@build build added the ios label Jan 15, 2018
Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

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

CR passed.

Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

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

FR Passed: Activity indicator no longer freezes when updating list.

Test steps:

var win = Ti.UI.createWindow({
  backgroundColor: 'white'
});

var listTemplate = {
  childTemplates: [{
    type: 'Ti.UI.Label',
    bindId: 'info',
    properties: {
      color: 'black',
      font: {
        fontFamily: 'Arial',
        fontSize: '20dp',
        fontWeight: 'bold'
      },
      left: '60dp',
      top: 0,
    }
  }]
};
var loadTemplate = {
  childTemplates: [{
    type: 'Ti.UI.ActivityIndicator',
    bindId: 'ai',
    properties: {
      left: 12,
      font: {
        fontSize: 16,
        fontFamily: 'Helvetica',
        fontWeight: 'bold',
      },
      color: "black",
      style: Ti.UI.ActivityIndicatorStyle.DARK,
      height: 55,
      visible: true
    }
  }]
}; 
var list = Ti.UI.createListView({
  templates: {
    'item': listTemplate,
    'load': loadTemplate
  },
});
var sections = []; 
var fruitSection = Ti.UI.createListSection({
  headerTitle: 'Fruits / Frutas'
});
var fruitDataSet = [{
    template: 'item',
    info: {
      text: 'Apple'
    }
  },
  {
    template: 'item',
    info: {
      text: 'Banana'
    }
  }
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection); 
list.setSections(sections); 
var iterations = 1; 
var createListDataItems = function() {
  var items = fruitDataSet;
  fruitDataSet.pop();
  for (var i = 1; i <= 2; i++) {
    items.push({
      template: 'item',
      info: {
        text: 'added ' + iterations + i
      }
    });
  }
  iterations++; 
  return items;
}; 
var createLoadingTransactionsListItem = function() {
  var items = fruitDataSet;
  items.push({
    template: 'load',
    ai: {
      message: ' Loading...'
    }
  }); 
  return items;
}; 
var loadMore = function() {
  // show loading message
  fruitSection.setItems(createLoadingTransactionsListItem()); 
  setTimeout(function() {
    // append more items
    fruitSection.setItems(createListDataItems()); 
    list.setMarker({
      sectionIndex: 0,
      itemIndex: fruitSection.items.length - 2
    }); 
  }, 2000);
};
list.addEventListener('marker', loadMore); 
setTimeout(loadMore, 0); 
win.add(list);
win.open();
  • Ran the program
  • Saw the Activity indicator spinning
  • Refreshed the list to add more items
  • Saw that the activity indicator was still spinning

Test Environment
Appcelerator Command-Line Interface, version 7.0.1
iphone 6+ (10.2)
Operating System Name: Mac OS High Sierra
Operating System Version: 10.13
Node.js Version: 8.9.1
Xcode: 9.2
Appcelerator Studio: 5.0.0.201712081732

@ssjsamir ssjsamir merged commit 1ebdfc5 into tidev:master Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants