Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c5a81a

Browse files
author
dinuscxj
committed
init project
0 parents  commit 1c5a81a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2140
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.gradle
2+
/local.properties
3+
/.idea
4+
.DS_Store
5+
/build
6+
/captures

LoadingDrawable.iml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="LoadingDrawable" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="inheritedJdk" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>

Preview/CircleLoadingDrawable.gif

1.1 MB
Loading

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
## LoadingDrawable
3+
some android loading drawable, can be combined with any View as the loading View,
4+
and is especially suitable for the loading animation of the [RecyclerRefreshLayout](https://github.com/dinuscxj/RecyclerRefreshLayout).
5+
6+
![](https://raw.githubusercontent.com/dinuscxj/LoadingDrawable/master/Preview/CircleLoadingDrawable.gif?width=300)
7+
## Features
8+
* GearLoadingDrawable
9+
* WhorlLoadingDrawable
10+
* LevelLoadingDrawable
11+
* MaterialLoadingDrawable
12+
13+
## TODO
14+
When I feel less bugs enough, I will add a gradle dependency. So I hope you will make more Suggestions.
15+
16+
## Usage
17+
#### Gradle
18+
```
19+
compile project(':library')
20+
```
21+
22+
Used with ImageView
23+
```java
24+
ImageView.setImageDrawable(new LoadingDrawable(new GearLoadingRenderer(Context)));
25+
ImageView.setImageDrawable(new LoadingDrawable(new WhorlLoadingRenderer(Context)));
26+
ImageView.setImageDrawable(new LoadingDrawable(new LevelLoadingRenderer(Context)));
27+
ImageView.setImageDrawable(new new LoadingDrawable(new MaterialLoadingRenderer(Context)));
28+
```
29+
30+
Used with View
31+
```java
32+
View.setBackground(new LoadingDrawable(new GearLoadingRenderer(Context)));
33+
View.setBackground(new LoadingDrawable(new WhorlLoadingRenderer(Context)));
34+
View.setBackground(new LoadingDrawable(new LevelLoadingRenderer(Context)));
35+
View.setBackground(new new LoadingDrawable(new MaterialLoadingRenderer(Context)));
36+
```
37+
38+
## License
39+
Copyright 2015-2019 dinus
40+
41+
Licensed under the Apache License, Version 2.0 (the "License");
42+
you may not use this file except in compliance with the License.
43+
You may obtain a copy of the License at
44+
45+
http://www.apache.org/licenses/LICENSE-2.0
46+
47+
Unless required by applicable law or agreed to in writing, software
48+
distributed under the License is distributed on an "AS IS" BASIS,
49+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50+
See the License for the specific language governing permissions and
51+
limitations under the License.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/app.iml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="LoadingDrawable" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":app" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
13+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
14+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
15+
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
16+
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
17+
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
18+
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
19+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
20+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
21+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
22+
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
23+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
24+
</configuration>
25+
</facet>
26+
</component>
27+
<component name="NewModuleRootManager" inherit-compiler-output="false">
28+
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
29+
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
30+
<exclude-output />
31+
<content url="file://$MODULE_DIR$">
32+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
33+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
42+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
43+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
44+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
45+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
62+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
63+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
65+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
66+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
67+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
68+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
69+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
70+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
78+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
79+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
80+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
81+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
82+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
83+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
84+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
85+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
86+
</content>
87+
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
88+
<orderEntry type="sourceFolder" forTests="false" />
89+
<orderEntry type="library" exported="" name="appcompat-v7-24.0.0-alpha1" level="project" />
90+
<orderEntry type="library" exported="" name="animated-vector-drawable-24.0.0-alpha1" level="project" />
91+
<orderEntry type="library" exported="" name="support-vector-drawable-24.0.0-alpha1" level="project" />
92+
<orderEntry type="library" exported="" name="support-v4-24.0.0-alpha1" level="project" />
93+
<orderEntry type="library" exported="" name="support-annotations-24.0.0-alpha1" level="project" />
94+
<orderEntry type="module" module-name="library" exported="" />
95+
</component>
96+
</module>

app/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.3"
6+
7+
defaultConfig {
8+
applicationId "app.dinus.com.example"
9+
minSdkVersion 11
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+
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
25+
compile project(':library')
26+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
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 /Users/dinus/workspace/android-sdk-macosx/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+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package app.dinus.com.example;
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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="app.dinus.com.example" >
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:theme="@style/AppTheme" >
10+
<activity
11+
android:name=".MainActivity"
12+
android:label="@string/app_name" >
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package app.dinus.com.example;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.view.View;
6+
import android.widget.ImageView;
7+
8+
import app.dinus.com.loadingdrawable.GearLoadingRenderer;
9+
import app.dinus.com.loadingdrawable.LevelLoadingRenderer;
10+
import app.dinus.com.loadingdrawable.LoadingDrawable;
11+
import app.dinus.com.loadingdrawable.LoadingRenderer;
12+
import app.dinus.com.loadingdrawable.MaterialLoadingRenderer;
13+
import app.dinus.com.loadingdrawable.WhorlLoadingRenderer;
14+
15+
16+
public class MainActivity extends AppCompatActivity {
17+
private LoadingDrawable mGearDrawable;
18+
private LoadingDrawable mWhorlDrawable;
19+
private LoadingDrawable mLevelDrawable;
20+
private LoadingDrawable mMaterialDrawable;
21+
22+
private ImageView mIvGear;
23+
private ImageView mIvWhorl;
24+
private ImageView mIvLevel;
25+
private ImageView mIvMaterial;
26+
27+
@Override
28+
protected void onCreate(Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
setContentView(R.layout.activity_main);
31+
32+
mIvGear = (ImageView) findViewById(R.id.gear_view);
33+
mIvWhorl = (ImageView) findViewById(R.id.whorl_view);
34+
mIvLevel = (ImageView) findViewById(R.id.level_view);
35+
mIvMaterial = (ImageView) findViewById(R.id.material_view);
36+
37+
mGearDrawable = new LoadingDrawable(new GearLoadingRenderer(this));
38+
mWhorlDrawable = new LoadingDrawable(new WhorlLoadingRenderer(this));
39+
mLevelDrawable = new LoadingDrawable(new LevelLoadingRenderer(this));
40+
mMaterialDrawable = new LoadingDrawable(new MaterialLoadingRenderer(this));
41+
42+
mIvGear.setImageDrawable(mGearDrawable);
43+
mIvWhorl.setImageDrawable(mWhorlDrawable);
44+
mIvLevel.setImageDrawable(mLevelDrawable);
45+
mIvMaterial.setImageDrawable(mMaterialDrawable);
46+
}
47+
48+
@Override
49+
protected void onStart() {
50+
super.onStart();
51+
mGearDrawable.start();
52+
mWhorlDrawable.start();
53+
mLevelDrawable.start();
54+
mMaterialDrawable.start();
55+
}
56+
57+
@Override
58+
protected void onStop() {
59+
mGearDrawable.stop();
60+
mWhorlDrawable.stop();
61+
mLevelDrawable.stop();
62+
mMaterialDrawable.stop();
63+
super.onStop();
64+
}
65+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<LinearLayout
2+
android:orientation="vertical"
3+
android:layout_height="match_parent"
4+
android:layout_width="match_parent"
5+
xmlns:android="http://schemas.android.com/apk/res/android">
6+
7+
<LinearLayout
8+
android:layout_weight="1"
9+
android:orientation="horizontal"
10+
android:layout_width="match_parent"
11+
android:layout_height="0dp">
12+
13+
<ImageView
14+
android:id="@+id/whorl_view"
15+
android:layout_weight="1"
16+
android:layout_width="0dp"
17+
android:background="#ffe6ebed"
18+
android:layout_height="match_parent" />
19+
20+
<ImageView
21+
android:id="@+id/material_view"
22+
android:layout_weight="1"
23+
android:layout_width="0dp"
24+
android:background="#ff2a8cc8"
25+
android:layout_height="match_parent" />
26+
</LinearLayout>
27+
28+
<LinearLayout
29+
android:layout_weight="1"
30+
android:orientation="horizontal"
31+
android:layout_width="match_parent"
32+
android:layout_height="0dp">
33+
34+
<ImageView
35+
android:id="@+id/gear_view"
36+
android:layout_weight="1"
37+
android:layout_width="0dp"
38+
android:background="#fffa644e"
39+
android:layout_height="match_parent" />
40+
41+
<ImageView
42+
android:id="@+id/level_view"
43+
android:layout_weight="1"
44+
android:layout_width="0dp"
45+
android:background="#fff1c02e"
46+
android:layout_height="match_parent" />
47+
</LinearLayout>
48+
</LinearLayout>

app/src/main/res/menu/menu_main.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
4+
<item android:id="@+id/action_settings" android:title="@string/action_settings"
5+
android:orderInCategory="100" app:showAsAction="never" />
6+
</menu>
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading
7.54 KB
Loading
Lines changed: 6 additions & 0 deletions
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/dimens.xml

Lines changed: 5 additions & 0 deletions
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>

0 commit comments

Comments
 (0)