Android custom view to achieve sesame score curve effect
1. Introduction
Actually, this effect was written a few days ago, but it hasn't been updated. It was thought that the official account of the sesame map was good enough to send the blog again. Then, today, I saw that the WeChat public number of Hongyang had a radar map of sesame seeds, so even if it was, it would be a complementary. At ordinary times, there are few articles written, so it may be a little messy. If there is anything to improve, please give suggestions. Thank you very much.
design sketch:
2. Steps:
Initialize the properties of the view. Initialize the brush to draw two dashed lines representing the highest score and the lowest score. Draw text to draw the properties representing the month. Draw sesame broken lines to draw dots representing sesame points. Draw suspended text of the selected score and background processing click events
3. Code:
Initialize view properties
Initialize brush:
Draw dashed lines representing the highest and lowest scores
Draw text
Draw attributes representing months
Draw sesame polyline
Draw dots that represent sesame points
Draws the floating text of the selected fraction and the background
Handle click events
Gets the width and height of the control
4. Summary
There are still some imperfections to deal with. For example, there are too few attributes that can be adjusted through XML. I usually write too little. I hope I can summarize and improve my writing skills in the future. The required attributes need to be improved later
GitHub address: https://github.com/FelixLee0527/ZhiMaScoreCurve
The above is the Android custom view introduced by Xiaobian to achieve the effect of sesame score curve. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!