I'm trying to learn Android and its UI. Would it be possible to create an EditText
like my design below?
Which should include:
Can probably work out how to change the icon and thick stroke when an event has occured but do not know how to code the icon with the right border edge inside the editText
smoothly. Help!
you can use
android:drawableLeft="@drawable/your_drawable"
on your EditText in xml.
And from java you can change it like this
Drawable img = getContext().getResources().getDrawable( R.drawable.your_other_drawable );
txtVw.setCompoundDrawablesWithIntrinsicBounds( img, null, null, null );
You'll have to make your own background resources if you want the edit box to have the same rounded/square corners as it does in your example image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With