Skip to content

[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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabrielemariotti
Copy link
Contributor

@gabrielemariotti gabrielemariotti commented Aug 6, 2020

Currently the endIconMode overrides the endIconOnClickListener.
With this change it is possible to add an endIconOnClickListener also when the endIconMode is set.
The listener is called after the onClickListener defined in the EndIconDelegate.

It can close #919 and #1272

@user-fal
Copy link

Hi @gabrielemariotti,
Does #1272 was finally resolved?

@@ -380,6 +380,7 @@
@Nullable private Drawable endDummyDrawable;
private int endDummyDrawableWidth;
private Drawable originalEditTextEndDrawable;
protected OnClickListener endIconOnClickListener;
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other modes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TextInputLayout] Add second input edit text for "password confirmation"
4 participants