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:
- First of all, you should know which theme you are basing on, "Theme.MaterialComponents.DayNight.DarkActionBar" or "Theme.AppCompat.Light.NoActionBar", check the theme or style file
- for AS4.1, wizard created project will use material design
- For filled buttons, this class uses your theme's ?attr/colorPrimary for the background tint color and ?attr/colorOnPrimary for the text color. For unfilled buttons, this class uses ?attr/colorPrimary for the text color and transparent for the background tint.
- Please read more here https://developer.android.com/reference/com/google/android/material/button/MaterialButton
- Remember, not only Button, but also all widgets, material design uses a total different way