Lucas Pugliese
Lucas Pugliese

Reputation: 599

How get the size or the image from DrawableLeft in EditText

I am doing a floating hint to editText, but to make it perfect I need to know how is the size from image used in drawable left and I would like to know if is possible to get the attribute set from the original editText.

Upvotes: 0

Views: 1160

Answers (1)

SorryForMyEnglish
SorryForMyEnglish

Reputation: 1181

as it is written

public void setCompoundDrawables(@Nullable Drawable left, @Nullable Drawable top,
            @Nullable Drawable right, @Nullable Drawable bottom)

if left, try this

int width = editText.getCompoundDrawables()[0].getMinimumWidth();
int height = editText.getCompoundDrawables()[0].getMinimumHeight();

Upvotes: 1

Related Questions