Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use CircularCounter to realize the effect of double-layer prototype progress bar

2025-01-28 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report