Skip to content
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

[Android] Password color #6064

Closed
wants to merge 3 commits into from

Conversation

sooth-sayer
Copy link
Contributor

Closes #4435

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @mkonicek, @dmmiller and @kmagiera to be potential reviewers.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@mkonicek
Copy link
Contributor

Thanks for the PR @sooth-sayer. What's your test plan? Have you tried setting this from JS and running the code? Can you add a screenshot showing how this looks?

Does the feature work on iOS exactly the same way? Asking because consistency between iOS and Android APIs where possible is great.

@facebook-github-bot
Copy link
Contributor

@sooth-sayer updated the pull request.

@sooth-sayer
Copy link
Contributor Author

ios colored password
android colored password mp4
@mkonicek I add colred password textinput to examples.

@@ -165,6 +165,11 @@ public void updateExtraData(ReactEditText view, Object extraData) {
}
}

@ReactProp(name = ViewProps.COLOR, defaultInt = 0)
public void setColor(ReactEditText view, @Nullable Integer color) {

Choose a reason for hiding this comment

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

You should probably say that this has customType="color" as well.

I'm not sure if defaultInt will keep null from actually showing up. If null does show up or defaultInt you probably need to set it back to whatever it was before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmmiller Could you explain in more detail about defaultInt?

@caphun
Copy link

caphun commented Mar 2, 2016

any plans for this fix to be merged in soon? we tested on a forked version of 0.20 and it worked well.

@facebook-github-bot
Copy link
Contributor

@sooth-sayer updated the pull request.

@@ -165,6 +165,11 @@ public void updateExtraData(ReactEditText view, Object extraData) {
}
}

@ReactProp(name = ViewProps.COLOR, defaultInt = 0, customType="color")
Copy link

Choose a reason for hiding this comment

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

Can you remove the defaultInt and check one thing for me? If you set the color to something and then you rerender with no color set, does it revert back to the proper color?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmmiller If i set the color and then rerender without color, it fails with "Error while updating property 'color' of a view managed by: AndroidTextInput"

Copy link

Choose a reason for hiding this comment

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

If you leave the defaultInt bit in, does it then work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. it fails regardless of defaultInt presence

Copy link

Choose a reason for hiding this comment

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

We need to figure that out before we can take it. It's possible for people to want to change their color and then back. You could also look at why the color that works via spans doesn't for password colors.

@dmmiller
Copy link

dmmiller commented Mar 9, 2016

One thing to check which I put inline and then I will accept. Thanks

@facebook-github-bot
Copy link
Contributor

@sooth-sayer updated the pull request.

@dmmiller
Copy link

@sooth-sayer I'd like to take this, but I want to know the answer to whether changing colors and removing colors correctly updates. Can you please indicate that?

@sooth-sayer
Copy link
Contributor Author

@dmmiller No, it fails when I remove color. I'll try to fix it as soon as I will have enough time.

ghost pushed a commit that referenced this pull request Mar 21, 2016
Summary:Color property is ignored for TextInput with secureTextEntry={true} on Android.

This is coming  from #6540 and being split into 2 PRs by suggestion of dmmiller.
As he mentioned does almost the same  except it #6064 doesn't handle null case.

Working example:

![scn949wlce](https://cloud.githubusercontent.com/assets/1247834/13929873/b700d650-ef72-11e5-9d67-0a7e0385bc2a.gif)
Closes #6563

Differential Revision: D3077583

Pulled By: mkonicek

fb-gh-sync-id: f0761346b77060abf17f1d4573b375adebc5c607
shipit-source-id: f0761346b77060abf17f1d4573b375adebc5c607
jeffchienzabinet pushed a commit to jeffchienzabinet/react-native that referenced this pull request Mar 21, 2016
Summary:Color property is ignored for TextInput with secureTextEntry={true} on Android.

This is coming  from facebook#6540 and being split into 2 PRs by suggestion of dmmiller.
As he mentioned does almost the same  except it facebook#6064 doesn't handle null case.

Working example:

![scn949wlce](https://cloud.githubusercontent.com/assets/1247834/13929873/b700d650-ef72-11e5-9d67-0a7e0385bc2a.gif)
Closes facebook#6563

Differential Revision: D3077583

Pulled By: mkonicek

fb-gh-sync-id: f0761346b77060abf17f1d4573b375adebc5c607
shipit-source-id: f0761346b77060abf17f1d4573b375adebc5c607
@janicduplessis
Copy link
Contributor

You can probably remove the defaultInt, check for null and use the default text color from the resources with something like

getResources().getColor(android.R.color.primary_text_dark);

@janicduplessis
Copy link
Contributor

Just noticed there's another PR that does this that landed already #6563. I guess we can close this one.

@mkonicek
Copy link
Contributor

mkonicek commented Apr 1, 2016

Thanks @janicduplessis!

@mkonicek mkonicek closed this Apr 1, 2016
machard pushed a commit to machard/react-native that referenced this pull request Apr 7, 2016
Summary:Color property is ignored for TextInput with secureTextEntry={true} on Android.

This is coming  from facebook#6540 and being split into 2 PRs by suggestion of dmmiller.
As he mentioned does almost the same  except it facebook#6064 doesn't handle null case.

Working example:

![scn949wlce](https://cloud.githubusercontent.com/assets/1247834/13929873/b700d650-ef72-11e5-9d67-0a7e0385bc2a.gif)
Closes facebook#6563

Differential Revision: D3077583

Pulled By: mkonicek

fb-gh-sync-id: f0761346b77060abf17f1d4573b375adebc5c607
shipit-source-id: f0761346b77060abf17f1d4573b375adebc5c607
rozele referenced this pull request in microsoft/react-native-windows May 25, 2016
Summary:Color property is ignored for TextInput with secureTextEntry={true} on Android.

This is coming  from #6540 and being split into 2 PRs by suggestion of dmmiller.
As he mentioned does almost the same  except it #6064 doesn't handle null case.

Working example:

![scn949wlce](https://cloud.githubusercontent.com/assets/1247834/13929873/b700d650-ef72-11e5-9d67-0a7e0385bc2a.gif)
Closes facebook/react-native#6563

Differential Revision: D3077583

Pulled By: mkonicek

fb-gh-sync-id: f0761346b77060abf17f1d4573b375adebc5c607
shipit-source-id: f0761346b77060abf17f1d4573b375adebc5c607
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants