Skip to content

[MaterialCardView] Stroke not correctly overlapping corners #881

Open
@G00fY2

Description

@G00fY2

Description: When using MaterialCardView with a StrokeColor and StrokeWidth set, the rendered stroke does not fully overlap rounded corners.
Bildschirmfoto 2020-01-07 um 18 29 48
Expected behavior: The stroke should correctly overlap all corners

Source code:
layout:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/AppCard"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="16dp">

    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/colorPrimary" />
</com.google.android.material.card.MaterialCardView>

styles:

    <style name="AppCard" parent="Widget.MaterialComponents.CardView">
        <item name="cardCornerRadius">32dp</item>
        <item name="cardBackgroundColor">#ffffff</item>
        <item name="strokeColor">#efefef</item>
        <item name="strokeWidth">1dp</item>
        <item name="cardElevation">0dp</item>
    </style>

Android API version: Reproducible with API 29 to 21.

Material Library version: Reproducible with 1.1.0-rc1 and 1.2.0-alpha03

Device: Emulator and real devices (Pixel 1 e.g.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions