Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28108] iOS - Ti.UI.RefreshControl crashes when passing a tintColor from TI.UI.fetchSemanticColor

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-09-09T11:49:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.2.0, Release 9.1.1
ComponentsiOS
Labelsn/a
ReporterYgor Lemos
AssigneeRene Pot
Created2020-09-02T04:37:00.000+0000
Updated2020-09-09T11:49:03.000+0000

Description

On Ti 9.0.3.GA, on iOS only, if we pass a valid Ti.UI.fetchSemanticColor("xxx") to the tintColor of a Ti.UI.RefreshControl, it crashes the app with a message that the view received an instance of TiColor instead of a string. On Android, passing a semantic color to the tintColor parameter of the RefreshControl works fine. Tested on both iOS 13 and iOS 14 on 9.0.3.GA

Comments

  1. Rene Pot 2020-09-02

    Confirmed as bug on my side. PR: https://github.com/appcelerator/titanium_mobile/pull/12002
  2. Satyam Sekhri 2020-09-02

    Test Case: *Resources/semantic.colors.json*
       {
       	"primaryBackground": {
       		"light": "#efece3",
       		"dark": "#001900"
       	}
       }
       
    *Resources/app.js*
       const primaryBackground = Ti.UI.fetchSemanticColor('primaryBackground');
       
       var win = Ti.UI.createWindow({
           fullscreen:true
       });
       var counter = 0;
       function genData()
       {
           var data = [];
           var i=1;
           for (i=1;i<=3;i++) {
               data.push({properties:{title:'ROW '+(counter+i)}});
           }
           counter += 3;
           return data;
       }
       var section = Ti.UI.createListSection();
       section.setItems(genData());
       var control = Ti.UI.createRefreshControl({
           tintColor:primaryBackground
       });
       var listView = Ti.UI.createListView({
           sections:[section],
           refreshControl:control
       });
       control.addEventListener('refreshstart',function(e){
           Ti.API.info('refreshstart');
           setTimeout(function(){
               Ti.API.debug('Timeout');
               section.appendItems(genData());
               control.endRefreshing();
           }, 2000);
       });
       win.add(listView);
       win.open();
       
  3. Satyam Sekhri 2020-09-02

    FR Passed Waiting for Jenkins build
  4. Hans Knöchel 2020-09-03

    Workaround for current 9.2.0: Pass the name of the semantic color directly, e.g. tintColor: 'primaryBackground'
  5. Samir Mohammed 2020-09-09

    *Closing ticket*. Fix verified in SDK version 9.2.0.v20200908050955, and 9.3.0.v20200908051946. *Test and other information can be found at:* https://github.com/appcelerator/titanium_mobile/pull/12002

JSON Source