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
[TIMOB-18053] Android: fix picker row text color #8651
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frankieandone
force-pushed
the
timob-18053
branch
from
December 1, 2016 21:33
e262f65
to
fa8958f
Compare
frankieandone
force-pushed
the
timob-18053
branch
from
December 1, 2016 21:33
fa8958f
to
371a393
Compare
garymathews
reviewed
Dec 2, 2016
final int color = TiConvert.toColor(rowProxy.getProperties(), TiC.PROPERTY_COLOR); | ||
tv.setTextColor(color); | ||
} else { | ||
tv.setTextColor(Color.WHITE); |
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.
Instead of defining the text color as white, it would be better to obtain the default color and set it back to that.
private static int defaultTextColor = 0;
...
public static class TiSpinnerAdapter<T> extends ArrayAdapter<T>
{
...
private void styleTextView(int position, TextView tv) {
...
if (rowProxy.hasProperty(TiC.PROPERTY_COLOR)) {
// obtain default text color
if (!defaultTextColor) {
defaultTextColor = tv.getCurrentTextColor();
}
final int color = TiConvert.toColor(rowProxy.getProperties(), TiC.PROPERTY_COLOR);
tv.setTextColor(color);
} else {
tv.setTextColor(defaultTextColor);
}
...
...
frankieandone
force-pushed
the
timob-18053
branch
from
December 3, 2016 01:12
02690f9
to
3a0f3d8
Compare
Updated. |
frankieandone
force-pushed
the
timob-18053
branch
from
December 3, 2016 07:00
1efe15c
to
44b9ab2
Compare
frankieandone
force-pushed
the
timob-18053
branch
from
December 3, 2016 07:02
cdc8b73
to
b4a7956
Compare
Looks good, but since |
CR: PASS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Last PR for issue didn't solve all bugs. Text color behaved weird if color not set for all rows.
TEST CASE
Comment and uncomment colors in each picker row.
EXPECTED
A picker row's text color should only be set if specified otherwise should be default color.
JIRA: https://jira.appcelerator.org/browse/TIMOB-18053