Skip to content

Commit 36c2efc

Browse files
committed
first commit
1 parent c1840c7 commit 36c2efc

File tree

38 files changed

+919
-1
lines changed

38 files changed

+919
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ out/
1616
# Gradle files
1717
.gradle/
1818
build/
19+
.idea
1920

2021
# Local configuration file (sdk path, etc)
2122
local.properties
@@ -38,3 +39,5 @@ captures/
3839

3940
# Keystore files
4041
*.jks
42+
43+

.gitignore.bak

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the ART/Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
out/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Local configuration file (sdk path, etc)
21+
local.properties
22+
23+
# Proguard folder generated by Eclipse
24+
proguard/
25+
26+
# Log Files
27+
*.log
28+
29+
# Android Studio Navigation editor temp files
30+
.navigation/
31+
32+
# Android Studio captures folder
33+
captures/
34+
35+
# Intellij
36+
*.iml
37+
.idea/workspace.xml
38+
39+
# Keystore files
40+
*.jks

README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# SmoothRoundProgressbar
2-
圆环进度条,首尾交接处圆润,自带动画,可自定义渐变,环厚度,转动速度
2+
# 效果图
3+
4+
![demo](demo.gif)
5+
6+
# 使用
7+
8+
需要指定确定的layout_width和layout_height,两者应该一致.圆环贴着view边缘往内画,不要设置padding,以免变形以及改变了显示效果。
9+
10+
默认结束颜色为浅灰色,开始颜色为白色。
11+
具体项目中,一般改endcolor为需要的颜色即可。
12+
13+
cpb_duration : 默认1200ms转完一圈。此速度适中,一般无需更改。
14+
cpb_strokeWidth : 为圆直径的0.08倍,参考安卓原生比例,一般无需更改。
15+
cpb_startColor:默认白色,一般无需更改。
16+
cpb_endColor :浅灰色,能应付大多数场景。如果对颜色有要求,改此属性即可。
17+
18+
<com.hss01248.roundprogressbar.RoundProgressBar
19+
android:id="@+id/pb"
20+
android:layout_centerInParent="true"
21+
app:cpb_duration = "1200"
22+
android:layout_width="200dp"
23+
android:layout_height="200dp" />
24+
25+
26+
# blog
27+
28+
[自定义圆形进度条](http://blog.csdn.net/hss01248/article/details/52089756)

app/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
*.log

app/build.gradle

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.3"
6+
7+
defaultConfig {
8+
applicationId "com.hss01248.progressbarcircle"
9+
minSdkVersion 15
10+
targetSdkVersion 23
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
testCompile 'junit:junit:4.12'
25+
compile 'com.android.support:appcompat-v7:23.0.1'
26+
compile project(path: ':roundprogressbar')
27+
}

app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in D:\development\Android\sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.hss01248.progressbarcircle;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.hss01248.progressbarcircle">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity android:name=".MainActivity">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
15+
<category android:name="android.intent.category.LAUNCHER" />
16+
</intent-filter>
17+
</activity>
18+
</application>
19+
20+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.hss01248.progressbarcircle;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
6+
public class MainActivity extends Activity {
7+
8+
@Override
9+
protected void onCreate(Bundle savedInstanceState) {
10+
super.onCreate(savedInstanceState);
11+
setContentView(R.layout.activity_main);
12+
// SmoothRoundProgressBar progressBar = (SmoothRoundProgressBar)findViewById(R.id.pb);
13+
}
14+
}
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:gravity="center_horizontal"
7+
android:orientation="vertical"
8+
xmlns:app="http://schemas.android.com/apk/res-auto"
9+
tools:context="com.hss01248.progressbarcircle.MainActivity">
10+
<com.hss01248.roundprogressbar.SmoothRoundProgressBar
11+
android:layout_marginTop="10dp"
12+
android:layout_width="40dp"
13+
android:layout_height="40dp" />
14+
<com.hss01248.roundprogressbar.SmoothRoundProgressBar
15+
android:layout_marginTop="10dp"
16+
app:cpb_endColor = "@android:color/holo_blue_dark"
17+
android:layout_width="40dp"
18+
android:layout_height="40dp" />
19+
<com.hss01248.roundprogressbar.SmoothRoundProgressBar
20+
android:layout_marginTop="10dp"
21+
app:cpb_startColor = "@android:color/holo_green_light"
22+
app:cpb_endColor = "@android:color/holo_blue_dark"
23+
android:layout_width="80dp"
24+
android:layout_height="80dp" />
25+
26+
<com.hss01248.roundprogressbar.SmoothRoundProgressBar
27+
android:layout_marginTop="10dp"
28+
app:cpb_startColor = "@android:color/holo_green_light"
29+
app:cpb_endColor = "@android:color/holo_blue_dark"
30+
app:cpb_duration = "3000"
31+
android:layout_width="80dp"
32+
android:layout_height="80dp" />
33+
34+
<com.hss01248.roundprogressbar.SmoothRoundProgressBar
35+
android:layout_marginTop="10dp"
36+
app:cpb_startColor = "@android:color/holo_green_light"
37+
app:cpb_endColor = "@android:color/holo_blue_dark"
38+
app:cpb_duration = "3000"
39+
app:cpb_strokeWidth = "15dp"
40+
android:layout_width="80dp"
41+
android:layout_height="80dp" />
42+
43+
</LinearLayout>
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading
7.54 KB
Loading
10.2 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>

app/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

app/src/main/res/values/dimens.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<!-- Default screen margins, per the Android Design guidelines. -->
3+
<dimen name="activity_horizontal_margin">16dp</dimen>
4+
<dimen name="activity_vertical_margin">16dp</dimen>
5+
</resources>

app/src/main/res/values/strings.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">ProgressbarCircle</string>
3+
</resources>

app/src/main/res/values/styles.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
<item name="colorPrimary">@color/colorPrimary</item>
7+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8+
<item name="colorAccent">@color/colorAccent</item>
9+
</style>
10+
11+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.hss01248.progressbarcircle;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* To work on unit tests, switch the Test Artifact in the Build Variants view.
9+
*/
10+
public class ExampleUnitTest {
11+
@Test
12+
public void addition_isCorrect() throws Exception {
13+
assertEquals(4, 2 + 2);
14+
}
15+
}

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:2.0.0'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
20+
21+
task clean(type: Delete) {
22+
delete rootProject.buildDir
23+
}

demo.gif

987 KB
Loading

gradle.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true

gradle/wrapper/gradle-wrapper.jar

52.4 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Mon Dec 28 10:00:20 PST 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

0 commit comments

Comments
 (0)