Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 3f0ff3d4 authored by Sebastiano Barezzi's avatar Sebastiano Barezzi
Browse files

Twelve: ListItem: Declare a new corner radius attribute

Change-Id: Ia85146e8d444ae22bd409befdaa565b11797731d
parent 08bb7f08
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -132,16 +132,11 @@ class ListItem @JvmOverloads constructor(

        inflate(context, R.layout.list_item, this)

        context.obtainStyledAttributes(
            attrs, androidx.cardview.R.styleable.CardView, defStyleAttr, 0
        ).use {
        context.obtainStyledAttributes(attrs, R.styleable.ListItem, 0, 0).use {
            cardCornerRadius = it.getDimension(
                androidx.cardview.R.styleable.CardView_cardCornerRadius,
                R.styleable.ListItem_cardCornerRadius,
                resources.getDimension(R.dimen.list_item_default_corner_radius)
            )
        }

        context.obtainStyledAttributes(attrs, R.styleable.ListItem, 0, 0).use {
            leadingIconImage = it.getDrawable(R.styleable.ListItem_leadingIconImage)
            leadingText = it.getString(R.styleable.ListItem_leadingText)
            it.getResourceId(R.styleable.ListItem_leadingViewLayout, 0).let { leadingViewLayout ->
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
-->
<resources>
    <declare-styleable name="ListItem">
        <attr name="cardCornerRadius" format="dimension" />
        <attr name="hasRoundedCorners" format="boolean" />
        <attr name="headlineText" format="string" />
        <attr name="isDimmed" format="boolean" />