android - Droidparts ClearableEditText -


i've implemented "clearableedittext" relies on code droidparts. purpose have edittext drawable on right corner (i.e. x button) in order clear text.

i using selector button resource drawableright. works perfect problem have button getting false pressed states it's parent (the edittext).

to reproduce:

  1. run project
  2. enter text in first edittext
  3. press anywhere inside edittext there's no text / drawable.

result: selector gets pressed state.

thanks help

the way achieve you're after set ontouchlistener on entire edittext , detect action_press within drawable's coordinates, replace selector accordingly. if don't want use technique have create custom view consist of layout separates two, i.e. linearlayout imageview , textview it's children.

cheers


Comments