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

Android: Drop-down picker text color does not change when switching dark/light theme

    Details

    • Story Points:
      3

      Description

      Summary:
      As of Titanium 10.0.0, a "plain" Ti.UI.Picker with "useSpinner" set to false (aka: a drop-down picker) won't update its row text colors when switching dark/light theme. You have to force-quit the app to make it use the system's current default text color.

      Steps to reproduce:

      1. Build and run the below on an Android 10 or newer device.
      2. Verify that you can see text in the picker.
      3. Go to System Settings -> Display
      4. Toggle the Dark/Light theme switch.
      5. Go back to the app.
      6. Notice that the picker's text color has not changed.

      const window = Ti.UI.createWindow();
      const rows = [];
      for (let index = 1; index <= 5; index++) {
      	rows.push(Ti.UI.createPickerRow({ title: `Item ${index}` }));
      }
      const picker = Ti.UI.createPicker({
      	columns: [Ti.UI.createPickerColumn({ rows: rows })],
      	width: "50%",
      });
      picker.addEventListener("change", (e) => {
      	Ti.API.info(`@@@ Selected rowIndex: ${e.rowIndex}, rowTitle: "${e.row.title}"`);
      });
      window.add(picker);
      window.open();
      

      Work-Around:
      Set the picker's row text color as shown below.

      Ti.UI.createPickerRow({ title: `Item ${index}`, color: "?attr/colorOnSurface" });
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Lokesh Choudhary
            • Watchers:
              2 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