ProgressWheel: progress bar of the Android open-source ring,

Source: Internet
Author: User

ProgressWheel: progress bar of the Android open-source ring,

This is a custom Android component that replaces the standard progress bar component. Implement various progress bar styles, including rings and scans.

XML:
Add the following to your attr. xml (res/value ):

12345678910111213141516 <Declare-styleable name = "ProgressWheel"> <attr name = "text" format = "string"/> <attr name = "textColor" format = "color"/> <attr name = "textSize" format = "dimension"/> <attr name = "barColor" format = "color"/> <attr name = "rimColor" format = "color"/> <attr name = "rimWidth" format = "dimension"/> <attr name = "spinSpeed" format = "integer"/> <attr name = "circleColor" format = "color" /> <attr name = "radius" format = "dimension"/> <attr name = "barWidth" format = "dimension"/> <attr name = "barLength" format =" dimension "/> <attr name =" delayMillis "format =" dimension "/> <attr name =" contourColor "format =" color "/> <attr name =" contourSize "format = "float"/> </declare-styleable>

Add in your root view

1 Xmlns: ProgressWheel = "http://schemas.android.com/apk/res/com.visualdenim.schooltraq"
1 Add components where your xml is appropriate
12345678910111213 <Com. todddavies. components. progressbar. progressWheel android: id = "@ + id/pw_spinner" android: layout_width = "200dp" android: layout_height = "200dp" android: layout_centerInParent = "true" ProgressWheel: text = "Authenticating... "ProgressWheel: textColor =" #222 "ProgressWheel: textSize =" 14sp "ProgressWheel: rimColor =" #330097D6 "ProgressWheel: barLength =" 60dp "ProgressWheel: barColor = "#0097D6" ProgressWheel: barWidth = "5dp" ProgressWheel: rimWidth = "2dp"/>

Java:

You need to get the progress bar from layout or initialize

12 ProgressWheel pw = newProgressWheel (myContext, myAttributes); ProgressWheel pw = (ProgressWheel) findViewById (R. id. pw_spinner );

Use. spin () to start the progress bar rolling, and stop the progress bar rolling

Adding progress is tricky. You can call it. incrementProgress (), but this is more than 360 degrees, because a circle has 360 degrees, you will automatically reset it when you exceed 360 degrees, and a automatic allocation


Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.