Skip to content

CardView

ZieIony edited this page Jul 13, 2017 · 3 revisions

Button

A card is nothing more than a layout with certain elevation and corner radius. Carbon doesn't have a CardView widget. Instead it provides a style, which can be used with any layout using style attribute.

<carbon.widget.FrameLayout
    style="@style/carbon_CardView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

Style

<style name="carbon_CardView" parent="carbon_Layout">
    <item name="android:background">?attr/carbon_colorBackground</item>
    <item name="carbon_elevation">@dimen/carbon_elevationCard</item>
    <item name="carbon_cornerRadius">2dp</item>
    <item name="android:layout_margin">@dimen/carbon_marginHalf</item>
</style>
Clone this wiki locally