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

Android: Use the material DayNight theme by default

    Details

    • Story Points:
      7
    • Sprint:
      2021 Sprint 2, 2021 Sprint 3, 2021 Sprint 4, 2021 Sprint 5

      Description

      Summary:
      As of Titanium 9.3.0, apps use the Theme.MaterialComponents.Bridge by default.
      We should change it to Theme.MaterialComponents.DayNight.DarkActionBar.

      Reason:
      This would allow us to support Android 10's light/dark mode feature. A Titanium app would then be able to change between the 2 modes dynamically.
      https://developer.android.com/guide/topics/ui/look-and-feel/darktheme

      New Titanium Themes:
      The following themes support dynamic switching between Day/Night (ie: Light/Dark) themes.
      Note that OS versions older than Android 10 will use the Day (ie: Light) theme by default.

      • Theme.Titanium.DayNight // This is the default.
      • Theme.Titanium.DayNight.NoTitleBar
      • Theme.Titanium.DayNight.Fullscreen

      Titanium Dark-only themes.

      • Theme.Titanium.Dark
      • Theme.Titanium.Dark.NoTitleBar
      • Theme.Titanium.Dark.Fullscreen

      Titanium Light-only themes.

      • Theme.Titanium.Light
      • Theme.Titanium.Light.NoTitleBar
      • Theme.Titanium.Light.Fullscreen

      The above themes can be applied the AndroidManifest.xml <application/> element and/or to an Ti.UI.Window via its creation-only "theme" property. Titanium will assign the "Theme.Titanium.DayNight" to the application by default unless overriden in the "tiapp.xml" via the <applicaiton/> element.

      The above Dark and Light themes are for app developers who want to opt-out of Light/Dark theme switching. This is especially useful for apps which hard-code colors.

      New AppDerived Themes:
      The following themes will be derived from the theme assigned to the AndroidManifest.xml <application/> element. If you do not set a custom theme there, then they will derive from the default Theme.Titanium.DayNight. These themes are intended to be passed to a Ti.UI.Window/Ti.UI.TabGroup "theme" property when wanting to remove the titlebar, show the window fullscreen, etc. and maintain the current app theme.

      • Theme.AppDerived.NoTitleBar
      • Theme.AppDerived.Fullscreen
      • Theme.AppDerived.Translucent
      • Theme.AppDerived.Translucent.NoTitleBar
      • Theme.AppDerived.Translucent.Fullscreen

      Deprecated Themes:
      The following themes are also deprecated, but will still work. These themes have been replaced by the above mentioned Theme.AppDerived.* themes.

      • Theme.Titanium.NoTitleBar
      • Theme.Titanium.Fullscreen
      • Theme.Titanium.Translucent
      • Theme.Titanium.Translucent.NoTitleBar
      • Theme.Titanium.Translucent.Fullscreen

      Do not use the following themes. These may cause errors or exceptions with the new material widgets that Titanium 10.0.0 uses. Custom themes must derive from Theme.MaterialComponents.*, but not the Bridge derived material themes.

      • Theme.AppCompat.*
      • Theme.MaterialComponents.Bridge.*

      Breaking-Change:
      This means we would be dropping the old "holo dark" theme as shown below.
      https://developer.android.com/guide/topics/ui/look-and-feel/themes

      We would end up using Google's modern material design theme where the "light" theme uses a white background instead of the old dark gray background.

        Attachments

          Activity

            People

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