-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[TextInputLayout] set the endIconOnClickListener also with endIconMode #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[TextInputLayout] set the endIconOnClickListener also with endIconMode #1581
Conversation
Hi @gabrielemariotti, |
@@ -380,6 +380,7 @@ | |||
@Nullable private Drawable endDummyDrawable; | |||
private int endDummyDrawableWidth; | |||
private Drawable originalEditTextEndDrawable; | |||
protected OnClickListener endIconOnClickListener; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this and where is it being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in the EndIconDelegate#callOriginalEndIconOnClickListener
method.
@@ -3056,6 +3057,13 @@ public int getEndIconMode() { | |||
* will have | |||
*/ | |||
public void setEndIconOnClickListener(@Nullable OnClickListener endIconOnClickListener) { | |||
this.endIconOnClickListener = endIconOnClickListener; | |||
if (getEndIconMode() == END_ICON_NONE || getEndIconMode() == END_ICON_CUSTOM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other modes?
Currently the
endIconMode
overrides theendIconOnClickListener
.With this change it is possible to add an
endIconOnClickListener
also when theendIconMode
is set.The listener is called after the
onClickListener
defined in theEndIconDelegate
.It can close #919 and #1272