From 88201e0a5910b2e6b639da2f8e8e3fcba3d1f9b0 Mon Sep 17 00:00:00 2001 From: Josue Leon Sarkis Date: Fri, 5 May 2023 13:59:54 -0600 Subject: [PATCH] feat: set text element drawables (#60) --- .../java/com/basistheory/android/view/TextElement.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/src/main/java/com/basistheory/android/view/TextElement.kt b/lib/src/main/java/com/basistheory/android/view/TextElement.kt index 447df6c3..102364fb 100644 --- a/lib/src/main/java/com/basistheory/android/view/TextElement.kt +++ b/lib/src/main/java/com/basistheory/android/view/TextElement.kt @@ -3,6 +3,7 @@ package com.basistheory.android.view import android.content.Context import android.graphics.Color import android.graphics.Typeface +import android.graphics.drawable.Drawable import android.os.Bundle import android.os.Parcelable import android.text.Editable @@ -124,6 +125,15 @@ open class TextElement @JvmOverloads constructor( _editText.requestLayout() } + fun setDrawables(startDrawable: Int, topDrawable: Int, endDrawable: Int, bottomDrawable: Int) { + _editText.setCompoundDrawablesWithIntrinsicBounds( + startDrawable, + topDrawable, + endDrawable, + bottomDrawable + ) + } + val isComplete: Boolean get() = _isMaskSatisfied && _isValid