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

selected item color is not getting changed automatically #59

Open
ishwarverma39 opened this issue Sep 29, 2016 · 5 comments
Open

selected item color is not getting changed automatically #59

ishwarverma39 opened this issue Sep 29, 2016 · 5 comments

Comments

@ishwarverma39
Copy link

No description provided.

@computerpoet
Copy link

Any information on how to do that ?

@blazsolar
Copy link
Owner

can you give me some more information what issue is exactly?

@prazjain
Copy link

@blazsolar when I set textColor in xml attribute, all the items are shown in same color. How to identify which item is actually selected, they all look the same.
The selected item (in the middle) should have different color (as you have shown in your screenshot in readme file).

@prazjain
Copy link

@blazsolar ok, got this. need to setup a selector for text color, that solves it.
But it does not give as good a effect as it could with a background circle around the selected value. (like lot of calendar views show that effect for a selected date).

Is it possible to have a different color background for selected item, that will make the item pop out.

We need to have a new method for background color just like : getTextColor, and the background color can also be defined as a selector. Then in draw method we can paint a circle with appropriate color for the item.

It will be great if we can have that.
Thanks

@Prethiviraj
Copy link

if(i==selectedItem){
                textPaint.setColor(getResources().getColor(android.R.color.holo_blue_dark));
                textPaint.setTextSize(40);
                textPaint.setFakeBoldText(true);
            }else {
                textPaint.setColor(getTextColor(i));
                textPaint.setTextSize(textSize);
                textPaint.setFakeBoldText(false);
            }

make changes in HorizontalPicker class file ,I hope this is helpfull.....

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

No branches or pull requests

5 participants