melvynkim
melvynkim

Reputation: 1655

Difference between Appcompat.Widget and Widget.AppCompat in appcompat-v7 resources file?

In appcompat-v7:22.2.0, two resource hierarchies declared in values.xml are confusing to me.

For example, below styles are found in same file: values.xml in appcompat-v7:22.2.0

<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-supportlib-release/frameworks/support/v7/appcompat/res/values/styles.xml -->

<style name="TextAppearance.AppCompat.Widget.ActionBar.Title" 
parent="Base.TextAppearance.AppCompat.Widget.ActionBar.Title"/>

<style name="TextAppearance.Widget.AppCompat.Toolbar.Title" 
parent="Base.TextAppearance.Widget.AppCompat.Toolbar.Title"/>

Upvotes: 0

Views: 524

Answers (1)

Bryan Herbst
Bryan Herbst

Reputation: 67239

There is effectively no difference.

From line 323 of styles_base.xml:

<style name="Base.TextAppearance.Widget.AppCompat.Toolbar.Title"
       parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
</style>

The Toolbar.Title base style is just an alias to the ActionBar.Title style. I am assuming that Google organized it like this because they are attempting to replace the word "Action Bar" with the word "Toolbar" in our vocabulary, but wanted to make these styles easy to find.

What's the difference between the resource hierarchy of the two: Appcompat.Widget and Widget.AppCompat?

Someone just decided to name them differently. Since both styles have an explicit parent, neither one will inherit any attributes by default anyway. My guess is that it is simply a mistake.

Upvotes: 1

Related Questions