Reputation: 3498
It's said Button will be transferred to AppCompatButton under AppCompatActivity, but I just found that's not happening for me. The same issue as here Android Button background color not changing.
I checked this here https://developer.android.com/reference/androidx/appcompat/widget/AppCompatButton
This will automatically be used when you use Button in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.
What does mean "You should only need to manually use this class when writing custom views."?
Updated:
Upvotes: 1
Views: 307
Reputation: 364556
Button
will be transferred toAppCompatButton
underAppCompatActivity
It is not correct.
It depends by the theme used in your Activity.
The MaterialComponentsViewInflater
replaces some framework widgets with Material Components ones at inflation time, provided if a MaterialComponents.*
theme is in use.
Something similar happens also with AppCompat
theme with the AppCompatViewInflater
.
You can check that MaterialComponentsViewInflater
extends AppCompatViewInflater
.
Upvotes: 1