Skip to content

Commit

Permalink
feat: set text element drawables (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 authored May 5, 2023
1 parent 0b2d2ea commit 88201e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/src/main/java/com/basistheory/android/view/TextElement.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 88201e0

Please sign in to comment.