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

Android: Changing currently selected row's color in picker does not update shown color

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 9.1.0
    • Component/s: Android
    • Labels:
    • Environment:

      Mac OS: 10.15.4
      SDK: 9.0.2.GA
      Appc CLI: 8.0.0
      JDK: 11.0.4
      Node: 10.17.0
      Studio: 6.0.0.202005141803
      Device: Pixel3(v10.0) emulator

    • Story Points:
      3
    • Sprint:
      2020 Sprint 11, 2020 Sprint 12, 2020 Sprint 13

      Description

      Setting the color of a picker row dynamically does not show up the changed color. To show up the changed color we need to select another option and reselect the first one.

      Steps to reproduce:

      1. Create a project using the app.js as below. Run on android device
      2. Select an option in the picker. The selected option should change text color but it does not show up the color change.
      3. Click on the picker again. The last selected option shows changed color in the drop down.
      4. Select another option and again the option selected in step 2. The changed color is shown now.
        Note: On iOS calling the picker.reloadColumn() method reloads the picker and shows the changed color of the selected option.

      var window = Ti.UI.createWindow({ backgroundColor: "gray" });
      var picker = Ti.UI.createPicker({ width: "50%" });
      picker.add([
      	Ti.UI.createPickerRow({ title: "Red", color: "red" }),
      	Ti.UI.createPickerRow({ title: "Green", color: "green" }),
      	Ti.UI.createPickerRow({ title: "Blue", color: "blue" }),
      ]);
      picker.addEventListener("change", function(e) {
      	Ti.API.info("### Selected row: " + e.rowIndex);
      	picker.getSelectedRow(0).color = "purple";
      });
      window.add(picker);
      window.open();
      

      Expected Result:
      On android the color change of the option should show on the first time it is selected.

      Work-Around:
      Set the row's title text after setting the color. This force picker's text field to update.

      picker.addEventListener("change", function(e) {
      	Ti.API.info("### Selected row: " + e.rowIndex);
      	var row = picker.getSelectedRow(0);
      	row.color = "purple";
      	row.title = row.title;   // <- This updates the picker's TextField.
      });
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              ssekhri Satyam Sekhri
              Reviewer:
              Gary Mathews
              Tester:
              Satyam Sekhri
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration