In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use CircularCounter to achieve double-layer prototype progress bar effect, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
CircularCounter double-layer prototype progress bar effect
CircularCounter double-layer prototype progress bar, which increases or decreases according to the change of data, supports reverse rotation.
This project is mainly realized by CircularCounter custom control, CircularCounter extends View
It is mainly drawn by the following code:
@ Override
Protected void onDraw (Canvas canvas) {
Super.onDraw (canvas)
Canvas.drawCircle (mBackgroundCenter, mBackgroundCenter
MBackgroundRadius, mBackgroundPaint)
Canvas.drawArc (mOneBounds, START_DEGREES, mOneDegrees, false, mOnePaint)
Canvas.drawArc (mTwoBounds, START_DEGREES, mTwoDegrees, false, mTwoPaint)
Canvas.drawArc (mThreeBounds, START_DEGREES, mThreeDegrees, false
MThreePaint)
Canvas.drawText (Integer.toString (mOneValue), mOneBounds.centerX ()
MTextPosY, mTextPaint)
Canvas.drawText (mMetricText, mOneBounds.centerX (), mMetricPosY
MMetricPaint)
}
Progress value change setting:
/ *
* Setters
*
, /
/ * *
* Set the next values to be drawn
* @ param v1
* @ param v2
* @ param v3
, /
Public void setValues (int v1, int v2, int v3) {
If (v1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.