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

Add color setting for setPrefix #276

Merged
merged 5 commits into from
Jan 24, 2017
Merged

Add color setting for setPrefix #276

merged 5 commits into from
Jan 24, 2017

Conversation

madsonic
Copy link
Contributor

No description provided.

@mgod
Copy link
Contributor

mgod commented Jan 23, 2017

I'm happy to include this feature, but I don't think I want to include parsing color constants as part of the library. The second version of the method seems good to me and I'd probably include something like this in the docstring:

You can get a color integer either using {@link android.support.v4.content.ContextCompat#getColor(android.content.Context, int)} or with {@link android.graphics.Color#parseColor(String)}. Formats copied from android.graphics.Color:
             You can use: '#RRGGBB',  '#AARRGGBB'
             or one of the following names: 'red', 'blue', 'green', 'black', 'white',
             'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey',
             'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy',
             'olive', 'purple', 'silver', 'teal'.

Copy link
Contributor

@mgod mgod left a comment

Choose a reason for hiding this comment

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

One quick fix, then this should be good. Thanks for the help!

@@ -63,7 +63,7 @@ protected boolean keepObject(Person person, String mask) {


if (savedInstanceState == null) {
completionView.setPrefix("To: ");
completionView.setPrefix("To: ", "blue");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be:

completionView.setPrefix("To: ", Color.parseColor("blue"));

@@ -3,6 +3,7 @@
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't need this import any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks for making this awesome library! I will be happy to help out with other parts too. Any idea when you will be planning out the next version?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure - it depends on how quickly I get feedback on #272 and priorities on this at my job.

@mgod mgod merged commit a5c8d0e into splitwise:master Jan 24, 2017
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.

None yet

2 participants