Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20266

Android: ListView with attributed strings are not rendering sometimes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 8.0.0, Release 7.5.1
    • Component/s: Android
    • Labels:
    • Environment:

      Android 4.4.4
      Titanium SDK 5.1.2

    • Story Points:
      5
    • Sprint:
      2016 Sprint 07 SDK, 2019 Sprint 1

      Description

      Issue Description

      When the user scroll very fast some attributed strings are missing (See attached screenshots), this is not happening on normal labels and if you scroll back slowly the attributed strings are showed.

      Steps to Reproduce
      1. Create a new default alloy project
      2. replace the views/index.xml with the next code:

        <Alloy>
        	<Window class="container">
        		<ListView id="listView">
        			<Templates>
        				<ItemTemplate name="simpleLabel">
        					<Label bindId="label1" id="label1"/>
        				</ItemTemplate>
        			</Templates>
        		</ListView>
        	</Window>
        </Alloy>
        

      3. Replace the controllers/index.js code with the next code:

         
        var listSection = Ti.UI.createListSection();
        var dataItems = [];
         
        for (var i = 0; i < 100; i++) {
         
        	var data = {
        		template: "simpleLabel",
        		label1: {},
        	};
         
        	if (i % 2 === 1) {
         
        		data.label1.attributedString = Ti.UI.createAttributedString({
        			text: "Italic row row row" + i,
        			attributes: [
        				{
        					type: Ti.UI.ATTRIBUTE_FONT,
        					value: {
        						fontWeight: "normal",
        						fontStyle: "italic",
        					},
        					range: [0, 6],
        				}
        			]
        		});
         
        	} else {
        		//data.label1.text = "Normal";
        		data.label1.text="Normal" + i; 
        	}
         
        	dataItems.push(data);
        };
         
        listSection.setItems(dataItems);
         
        $.listView.setSections([listSection]);
         
        $.index.open();
        

      4. Replace the code inside styles/index.tss with the next code:

        ".container": {
        	backgroundColor: "#fff",
        	layout: "vertical",
        }
         
        "#listView": {
        	height: Ti.UI.FILL,
        	width: Ti.UI.FILL,
        }
        "#label1": {
        	font: {
        		fontSize: 26,
        	},
        	color: "#000",
        }
         
        "Label": {
        	color: "#000",
        	font: {
        		fontSize: 30,
        	},
        }
        

      5. Run
      6. Scroll fast and stop

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              rramirez Ricardo Ramirez
              Reviewer:
              Joshua Quick
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20880
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code