How to change android button text color globally in theme

<style name=”AppTheme.Base” parent=”Theme.AppCompat.Light.DarkActionBar”> <item name=”android:textColor”>#yourcolor</item> <item name=”android:buttonStyle”>@style/ButtonColor</item> <item name=”colorButtonNormal”>@color/buttonColor</item> </style> <style name=”ButtonColor” parent=”@android:style/Widget.Button”> <item name=”android:textColor”>@color/yourcolor</item> </style> android:textColor This should help you change the text color globally.

Material design Spinner using TextInputLayout.OutlinedBox styling

I am assuming you want to have an Exposed drop-down menu inside the TextInputLayout I had the same problem, what you can do is use AutoCompleteTextView inside your TextInputLayout as in the following in the XML. here’s an example of how I approached the issue. <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”horizontal” android:paddingRight=”30dp” android:paddingEnd=”30dp” tools:ignore=”RtlSymmetry” android:layout_margin=”5dp”> <ImageView android:layout_width=”30dp” … Read more

Change font of the floating label EditText and TextInputLayout

As of Design Library v23, you can use TextInputLayout#setTypeface(). This will set the typeface on both the expanded and floating hint. Here is the feature request where it was discussed on b.android.com. EDIT: The error view typeface was not being set, but is now fixed in v25.1.0.

How to create a circular outlined Material Button in Android?

You can use the app:shapeAppearanceOverlay attribute to define the corner size. You can use the 50% value. <com.google.android.material.button.MaterialButton android:layout_width=”50dp” android:layout_height=”50dp” style=”@style/Widget.MaterialComponents.Button.OutlinedButton.Icon” app:icon=”@drawable/ic_add_24px” app:iconSize=”24dp” app:iconGravity=”textStart” android:padding=”0dp” app:iconPadding=”0dp” android:insetLeft=”0dp” android:insetTop=”0dp” android:insetRight=”0dp” android:insetBottom=”0dp” app:shapeAppearanceOverlay=”@style/ShapeAppearanceOverlay.MyApp.Button.Circle” /> with: <style name=”ShapeAppearanceOverlay.MyApp.Button.Circle” parent=””> <item name=”cornerFamily”>rounded</item> <item name=”cornerSize”>50%</item> </style> or with the style=”@style/Widget.MaterialComponents.Button.Icon” It requires at least the version 1.1.0. With jetpack compose … Read more

Change Chip Widget style programmatically not working – Android

You can’t use the constructor val chip = Chip(context, null, R.style.CustomChipChoice) because the 3rd parameter isn’t the style but the attribute in the theme as R.attr.chipStyle. The Chip hasn’t a constructor with 4 parameters as other components because it extends AppCompatCheckbox which does not support a 4 parameter constructor. However you can use something different. … Read more

Style SnackBar in theme app

With the Material Components Library you can globally change the snackbar style in your app theme: <style name=”AppTheme” parent=”Theme.MaterialComponents.*”> <!– Style to use for Snackbars in this theme. –> <item name=”snackbarStyle”>@style/Widget.MaterialComponents.Snackbar</item> <!– Style to use for action button within a Snackbar in this theme. –> <item name=”snackbarButtonStyle”>@style/Widget.MaterialComponents.Button.TextButton.Snackbar</item> <!– Style to use for message text within … Read more

tech