0

I'm looking forward to create an EditText with an Icon on the right that has some kind of functionality.

I've seen that the Google IO 2013 app has something like that on the search widget.

I want to know if its possible to do that with a simple EditText.

I've tried with a simple ImageView on the right of the EditText, but it looks really bad.

I would really appreciate if someone could point me in the right direction.

Thanks.

EDIT 1

This is an example of what I want. It looks really good. I have used the drawableRight and it doesn't look this good.

http://img836.imageshack.us/img836/1521/6faa.png

EDIT 2

I managed to build something that looks really similar to the SearchWidget with the voice recognition option.

I put two EditText next to each other (with a RelativeLayout), and set the margin left for the one on the right to -10dp. This way it looks like one EditText. I know this is not proper, but right now does what I want.

My problem now is the image, I'm using a 32x32 px image, because it fits fine, but it has really low quality, I'll look into that.

http://img560.imageshack.us/img560/9394/ilwp.png

Monardo12
  • 1
  • 2

1 Answers1

0

You can definitely use a custom EditText with drawableRight as follows:

android:drawableRight="@drawable/your_drawable"

Refer

1.Custom EditText- 1

2.Custom EditText- 2

Community
  • 1
  • 1
Ritesh Gune
  • 16,629
  • 6
  • 44
  • 72