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

Android: Custom theme applied to ActionBar/Toolbar title is lost when changing orientation as of 7.5.0.RC

    Details

      Description

      Summary:
      When applying a custom theme to an Android app or activity, the theme applied to an ActionBar or Toolbar title is lost when changing app orientation. It ends up resetting back to the default theme.

      This bug was introduced into 7.5.0.RC.

      Steps to reproduce:

      1. Download "kitchensink-v2" project from: here
      2. Set up project to build with 7.5.0.RC.
      3. Build and run to an Android device.
      4. Clear the alert dialog displayed on app startup.
      5. Notice that the top ActionBar title has white text.
      6. Rotate the device from portrait to landscape.
      7. Notice that the top ActionBar title now has black text. (This is the bug.)

      Result:
      Before rotating device. Notice the title text is white.

      After rotating, notice the title is now black. This is the bug.
      (The white gap on left side is an Android P notch, which can't be captured. This is not an issue.)

      Cause:
      The new TiToolbarStyleHandler.java class added to 7.5.0.RC is hard-coded to use the "style.Widget_AppCompat_Toolbar" theme. We need to find a way to acquire the theme resource ID applied to the activity and use that instead. This will solve it for the ActionBar as well since it's internally implemented as a Toolbar on Google's end.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code