Support dynamically circle colors changes on LineChartRenderer#5231
Open
santosmgbh wants to merge 2 commits intoPhilJay:masterfrom
Open
Support dynamically circle colors changes on LineChartRenderer#5231santosmgbh wants to merge 2 commits intoPhilJay:masterfrom
santosmgbh wants to merge 2 commits intoPhilJay:masterfrom
Conversation
added 2 commits
January 3, 2022 16:27
Moved DataSetImageCache.init from a method to a constructor. The main idea is verify the content of the color in array instead of only the length. I met one use case that I needed to use different colors from dots. So I used the method setCircleColors, but when I call drawCircle it doesnt works because the length of the circle array is not change, only the content is changed.
This file contains hidden or 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
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.
PR Checklist:
PR Description
Improve cache from circle image on LineChartRenderer
Changed mImageCache from HashMap to WeakHashMap to avoid OOM
Moved
DataSetImageCache.initto be inside offillmethod. The main idea is check if the color have been changed and update circle if it is true.Motivation:
I created this PR because I met one use case that I needed to use different colors from dots and changed it dinamically from a "hover" on graph. So I used the method setCircleColors, but when I call drawCircle it doesn’t works because the length of the circle array(
drawCircles:777) have not been changed. So, in my use case the size keep the same only the color changed.Selected:


Unselected: