xamarin / AndroidSupportComponents

Xamarin bindings for Android Support libraries - For AndroidX see https://github.com/xamarin/AndroidX
MIT License
146 stars 56 forks source link

[MaterialButton] Stroke color is not set according to the material guidelines. #237

Open TAnckaerts opened 4 years ago

TAnckaerts commented 4 years ago

Steps to Reproduce

  1. Create a 'android.support.design.button.MaterialButton'
  2. set style to 'Widget.MaterialComponents.Button.OutlinedButton'
  3. run the application
<android.support.design.button.MaterialButton
        style="@style/borderedButton"
        android:id="@+id/secondaryButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="goto RecyclerView"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toTopOf="@id/nextPageButton"
        local:MvxBind="Click NavigateCommand"/>

Following snippet generates a grey stroke. [DEFAULT STYLE]

<resources>
    <!--Supported from Android API 21+-->
  <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
  </style>

  <style name="borderedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
  </style>
</resources>

Following snippet generates a colored stroke as according to the material io guidelines

<resources>
    <!--Supported from Android API 21+-->
  <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
  </style>

  <style name="borderedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
    <item name="strokeColor">@color/colorAccent</item>
  </style>
</resources>

Expected Behavior

I expect [DEFAULT STYLE] to generate a stroke color using the accent color. The text and the stroke should have the same color. image

Actual Behavior

image

Version Information

pixel 2 - Emulator Android 9.0 - API 28 Xamarin.Android.Support.Design 28.0.0.3