Permalink
Browse files

initial commit

  • Loading branch information...
dodocat committed Dec 23, 2014
0 parents commit a1a426ea7261703add61f6fdc710c8436c4a8851
Showing with 1,294 additions and 0 deletions.
  1. +39 −0 .gitignore
  2. +27 −0 README.md
  3. +1 −0 app/.gitignore
  4. +26 −0 app/build.gradle
  5. +17 −0 app/proguard-rules.pro
  6. +13 −0 app/src/androidTest/java/org/quanqi/circularporgress/ApplicationTest.java
  7. +21 −0 app/src/main/AndroidManifest.xml
  8. +40 −0 app/src/main/java/org/quanqi/circularporgress/MainActivity.java
  9. BIN app/src/main/res/drawable-hdpi/ic_launcher.png
  10. BIN app/src/main/res/drawable-mdpi/ic_launcher.png
  11. BIN app/src/main/res/drawable-xhdpi/ic_launcher.png
  12. BIN app/src/main/res/drawable-xxhdpi/ic_launcher.png
  13. +49 −0 app/src/main/res/layout/activity_main.xml
  14. +6 −0 app/src/main/res/menu/menu_main.xml
  15. +6 −0 app/src/main/res/values-w820dp/dimens.xml
  16. +8 −0 app/src/main/res/values/demo.xml
  17. +5 −0 app/src/main/res/values/dimens.xml
  18. +8 −0 app/src/main/res/values/strings.xml
  19. +8 −0 app/src/main/res/values/styles.xml
  20. +19 −0 build.gradle
  21. +117 −0 deploy.gradle
  22. +18 −0 gradle.properties
  23. BIN gradle/wrapper/gradle-wrapper.jar
  24. +6 −0 gradle/wrapper/gradle-wrapper.properties
  25. +164 −0 gradlew
  26. +90 −0 gradlew.bat
  27. +1 −0 library/.gitignore
  28. +25 −0 library/build.gradle
  29. +18 −0 library/gradle.properties
  30. +17 −0 library/proguard-rules.pro
  31. +13 −0 library/src/androidTest/java/org/quanqi/circularprogress/ApplicationTest.java
  32. +3 −0 library/src/main/AndroidManifest.xml
  33. +217 −0 library/src/main/java/org/quanqi/circularprogress/CircularProgressDrawable.java
  34. +278 −0 library/src/main/java/org/quanqi/circularprogress/CircularProgressView.java
  35. +30 −0 library/src/main/res/values/circular_progress.xml
  36. +3 −0 library/src/main/res/values/strings.xml
  37. +1 −0 settings.gradle
  38. BIN shots/demo.gif
@@ -0,0 +1,39 @@
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.project
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
.directory
# gradle wrapper working directory
.gradle
build/
# maven
target/
@@ -0,0 +1,27 @@
# A circular progressbar with sweeping angle
![demo](shots/demo.gif)
## usage
In build.gradle config dependency.
``` groovy
compile 'org.quanqi:CircularProgress:1.0.0'
```
In laout xml
``` xml
<org.quanqi.circularprogress.CircularProgressView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:angleAnimationDurationMillis="@integer/circular_default_angleAnimationDurationMillis"
app:borderWidth="@dimen/circular_default_border_width"
app:colorSequence="@array/circular_default_color_sequence"
app:sweepAnimationDurationMillis="@integer/circular_default_sweepAnimationDuration" />
```
## LICENSE
bsd-2
@@ -0,0 +1 @@
/build
@@ -0,0 +1,26 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "org.quanqi.circularporgress"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':library')
}
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/cindy/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -0,0 +1,13 @@
package org.quanqi.circularporgress;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.quanqi.circularporgress" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,40 @@
package org.quanqi.circularporgress;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,49 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:columnCount="2">
<org.quanqi.circularprogress.CircularProgressView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:angleAnimationDurationMillis="@integer/circular_default_angleAnimationDurationMillis"
app:borderWidth="@dimen/circular_default_border_width"
app:colorSequence="@array/circular_default_color_sequence"
app:sweepAnimationDurationMillis="@integer/circular_default_sweepAnimationDuration" />
<org.quanqi.circularprogress.CircularProgressView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:borderWidth="10dp" />
<org.quanqi.circularprogress.CircularProgressView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:angleAnimationDurationMillis="1000"
app:sweepAnimationDurationMillis="400" />
<org.quanqi.circularprogress.CircularProgressView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
app:colorSequence="@array/demo_color_sequence"
app:minSweepAngle="5" />
</GridLayout>
</ScrollView>
@@ -0,0 +1,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="demo_color_sequence">
<item>#ff0000</item>
<item>#00ff00</item>
<item>#0000ff</item>
</array>
</resources>
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">CircularPorgress</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
</resources>
@@ -0,0 +1,8 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
@@ -0,0 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Oops, something went wrong.

0 comments on commit a1a426e

Please sign in to comment.