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

How to get color by progress value? #38

Open
mintheinwin opened this issue Oct 24, 2023 · 2 comments
Open

How to get color by progress value? #38

mintheinwin opened this issue Oct 24, 2023 · 2 comments

Comments

@mintheinwin
Copy link

mintheinwin commented Oct 24, 2023

Hi ,
I use your library for calculation of color by average of between min value and max value.
I don't know how to get color by progress value.

colorSeekBar.setMaxProgress(8); // app crush when setMaxProgress programitcally

int color = colorSeekBar.getColorByProgressvalue(5) ?????

@mintheinwin mintheinwin changed the title How get color by progress value? How to get color by progress value? Oct 24, 2023
@rtugeek
Copy link
Owner

rtugeek commented Oct 27, 2023

please checkout new version 2.1.0

@mintheinwin
Copy link
Author

mintheinwin commented Oct 27, 2023

Hi rtugeek,
Thanks for your response and for your help. Gradle implementation 'com.github.rtugeek:colorseekbar:2.1.0' link is not working. If I just use with your library module file is fine.

in fragment class
colorSeekBar.setMaxProgress(12); // app crash when setMaxProgress value programmatically

//Error log
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1118)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1085)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1035)
at android.graphics.Bitmap.createBitmap(Bitmap.java:996)
at com.rtugeek.android.colorseekbar.ColorSeekBar.updateCachedColors(ColorSeekBar.java:172)

// After I comment to avoid called updateCachedColors() method in ColorSeekBar class App doesn't come to crash again.
@OverRide
public void setMaxProgress(int maxProgress) {
super.setMaxProgress(maxProgress);
// updateCachedColors();
}

//I can Get Color by progress value with new method
int color=colorSeekBar.getColor(progressValue);

// One more thing I also want to specify minimum progress value
//example
colorSeekBar.minimunProgress(-2) // I didn't found for this method... How can specify for minimum progress value
395015857_843856480755369_4302121003675798577_n

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

2 participants