I´m Using AppCompat 22.1.1
What´s the difference between Base.Widget.AppCompat.Button
and Widget.AppCompat.Button
?
AppCompatButton widget enhanced with emoji capability by using EmojiTextViewHelper . A Button which supports compatible features on older versions of the platform, including: Allows dynamic tint of its background via the background tint methods in androidx.
Material Buttons are slightly different to traditional Android buttons in that they do not include additional insets (4dp on the left/right) and have more letter-spacing, different default colors and other attributes that improve legibility and affordance amongst other components.
To change the default Button style of the application we can use the android:buttonStyle attribute in the AppTheme style inside the styles. xml.
To add a button, that has an Android style all you need to do is to drag and drop a button from the Palette to your layout. For most versions that would mean a grey button with all corners at 2dp roundness. Check our blog, if you need to learn more about using Android Studio Layout Editor.
In the case of AppCompat.Button
, it inherits directly, and as far as I've been able to find, nothing overrides it, so they should be the same. From AppCompat styles.xml
:
<style name="Widget.AppCompat.Button" parent="Base.Widget.AppCompat.Button" />
But according to the AppCompat documentation, we should be using Widget.AppCompat
:
Top level themes
These are the themes to be used directly by developers. These inherit from the relevant second level theme below.
Names:
Theme.AppCompat
,Theme.AppCompat.Light
andTheme.AppCompat.Light.DarkActionBar
Example:
values/Theme.AppCompat
<-Theme.Base.AppCompat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With