When should one use Theme.AppCompat vs ThemeOverlay.AppCompat?

android, android-theme

Solution

Per this Theme vs Style blog post by the creator of AppCompat:

[ThemeOverlays] are special themes which overlay the normal Theme.Material themes, overwriting relevant attributes to make them either light/dark.

ThemeOverlay + ActionBar

The keen eyed of you will also have seen the ActionBar ThemeOverlay derivatives:

- `ThemeOverlay.Material.Light.ActionBar`

- `ThemeOverlay.Material.Dark.ActionBar`

These should only be used with the Action Bar via the new `actionBarTheme` attribute, or directly set on your Toolbar.

The only things these currently do differently to their parents is that they change the `colorControlNormal` to be `android:textColorPrimary`, thus making any text and icons opaque.

Problem

There are the following Theme.AppCompat classes: ``` Theme.AppCompat Theme.AppCompat.Light Theme.AppCompat.Light.DarkActionBar Theme.AppCompat.NoActionBar Theme.AppCompat.Light.NoActionBar Theme.AppCompat.DialogWhenLarge Theme.AppCompat.Light.DialogWhenLarge Theme.AppCompat.Dialog Theme.AppCompat.Light.Dialog Theme.AppCompat.CompactMenu ``` and the following ThemeOverlay.AppCompat classes: ``` ThemeOverlay.AppCompat ThemeOverlay.AppCompat.Light ThemeOverlay.AppCompat.Dark ThemeOverlay.AppCompat.ActionBar ThemeOverlay.AppCompat.Dark.ActionBar ``` Why would one use ThemeOverlay.AppCompat.light vs Theme.AppCompat.Light for example? I see that there are much less attributes defined for ThemeOverlay -- I am curious what the intended use case for ThemeOverlay is.

Original source