diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index d007929f6..01b990d3a 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -3688,39 +3688,6 @@ column="10"/> - - - - - - - - - - - - . - */ - -package app.pachli.view - -import android.content.Context -import android.graphics.Color -import android.util.AttributeSet -import android.view.LayoutInflater -import androidx.core.content.res.use -import app.pachli.core.activity.openLink -import app.pachli.core.common.extensions.hide -import app.pachli.core.designsystem.R as DR -import app.pachli.databinding.CardLicenseBinding -import com.google.android.material.card.MaterialCardView -import com.google.android.material.color.MaterialColors - -class LicenseCard -@JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0, -) : MaterialCardView(context, attrs, defStyleAttr) { - - init { - val binding = CardLicenseBinding.inflate(LayoutInflater.from(context), this) - - setCardBackgroundColor(MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurface, Color.BLACK)) - - val (name, license, link) = context.theme.obtainStyledAttributes( - attrs, - DR.styleable.LicenseCard, - 0, - 0, - ).use { a -> - Triple( - a.getString(DR.styleable.LicenseCard_name), - a.getString(DR.styleable.LicenseCard_license), - a.getString(DR.styleable.LicenseCard_link), - ) - } - - binding.licenseCardName.text = name - binding.licenseCardLicense.text = license - if (link.isNullOrBlank()) { - binding.licenseCardLink.hide() - } else { - binding.licenseCardLink.text = link - setOnClickListener { context.openLink(link) } - } - } -} diff --git a/app/src/main/res/layout/card_license.xml b/app/src/main/res/layout/card_license.xml deleted file mode 100644 index 843de9955..000000000 --- a/app/src/main/res/layout/card_license.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - diff --git a/core/designsystem/src/main/res/values/attrs.xml b/core/designsystem/src/main/res/values/attrs.xml index 2a399127f..e87cc2ec6 100644 --- a/core/designsystem/src/main/res/values/attrs.xml +++ b/core/designsystem/src/main/res/values/attrs.xml @@ -6,13 +6,6 @@ - - - - - - -