-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80876b9
commit 253e8e6
Showing
50 changed files
with
1,820 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/assetWizardSettings.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
.idea/caches | ||
|
||
# Keystore files | ||
# Uncomment the following line if you do not want to check your keystore files in. | ||
#*.jks | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json | ||
|
||
# fastlane | ||
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
fastlane/readme.md |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
|
||
## SquaresLoadingView | ||
> A SquaresLoadingView based on android.View, nicely rotation、easy to use. | ||
[![API](https://img.shields.io/badge/API-19%2B-brightgreen.svg)](https://android-arsenal.com/api?level=19) | ||
[![License](https://img.shields.io/badge/license-Apache%202-green.svg)](https://www.apache.org/licenses/LICENSE-2.0) | ||
[![Download](https://img.shields.io/badge/Download-1.0.1-B93B8F.svg) ](https://github.com/fairytale110/WedgesView/archive/1.0.1.zip) | ||
|
||
### Preview | ||
|
||
|
||
|
||
### Features | ||
|
||
Supported functions: | ||
|
||
- [x] Optionally configure the colors of each square | ||
- [x] Manually stop and start the animation | ||
- [x] Configurable anim's speed | ||
|
||
- [x] Support the padding settings | ||
|
||
|
||
Support will be forthcoming: | ||
|
||
- [ ] Manual rotation | ||
|
||
- [ ] Refresh header view support | ||
|
||
- [ ] Etc | ||
|
||
### How to | ||
|
||
To get a Git project into your build: | ||
|
||
Step 1. Add the JitPack repository to your build file | ||
Add it in your root build.gradle at the end of repositories: | ||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
``` | ||
Step 2. Add the dependency | ||
``` | ||
dependencies { | ||
implementation 'com.github.fairytale110:SquaresLoadingView:1.0.0' | ||
} | ||
``` | ||
|
||
### Usage | ||
|
||
```java | ||
<tech.nicesky.libsquaresloadingview.SquaresLoadingView | ||
android:id="@+id/slv_loading" | ||
android:padding="10dp" | ||
app:slv_scale_speed="0.77" | ||
app:slv_squares_alpha="1" | ||
app:slv_background="@android:color/white" | ||
android:layout_width="80dp" | ||
android:layout_height="200dp" /> | ||
``` | ||
or | ||
```java | ||
|
||
private void loading(){ | ||
|
||
int[] colorsDefault = { | ||
Color.parseColor("#C5523F"), | ||
Color.parseColor("#F2B736"), | ||
Color.parseColor("#499255"), | ||
Color.parseColor("#F2B736"), | ||
Color.parseColor("#499255"), | ||
Color.parseColor("#1875E5"), | ||
Color.parseColor("#499255"), | ||
Color.parseColor("#1875E5"), | ||
Color.parseColor("#C5523F"), | ||
}; | ||
|
||
SquaresLoadingView squaresLoadingView = new SquaresLoadingView(this); | ||
squaresLoadingView.setAnimSpeed(0.5F); | ||
squaresLoadingView.setSquareAlpha(0.8F); | ||
squaresLoadingView.setColors(colorsDefault); | ||
squaresLoadingView.start(); | ||
//squaresLoadingView.stop(); | ||
} | ||
``` | ||
|
||
### Participate in the contribution | ||
fairytale110@foxmail.com | ||
|
||
|
||
### Author | ||
fairytale110@foxmail.com | ||
> 简书: http://jianshu.com/u/d95b27ffdd3c | ||
> 掘金: https://juejin.im/user/596d91ee6fb9a06bb874a800 | ||
> CSDN: https://blog.csdn.net/LJYBQ | ||
> MY WEB: https://nicesky.tech | ||
|
||
## LICENSE | ||
|
||
``` | ||
Copyright 2018 fairytale110 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apply plugin: rootProject.ext.plugins.android | ||
|
||
android { | ||
compileSdkVersion rootProject.ext.android.compileSdkVersion | ||
defaultConfig { | ||
applicationId rootProject.ext.android.applicationId | ||
minSdkVersion rootProject.ext.android.sampleMinSdkVersion | ||
targetSdkVersion rootProject.ext.android.targetSdkVersion | ||
versionCode 1 | ||
versionName "1.0.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
// compileOptions { | ||
// sourceCompatibility JavaVersion.VERSION_1_8 | ||
// targetCompatibility JavaVersion.VERSION_1_8 | ||
// } | ||
} | ||
|
||
dependencies { | ||
androidTestImplementation(rootProject.ext.dependencies.expressoCore) { | ||
exclude group: "com.android.support", module: "support-annotations" | ||
} | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
testImplementation rootProject.ext.dependencies.junit | ||
implementation rootProject.ext.dependencies.appCompat | ||
debugImplementation rootProject.ext.dependencies.leakcanary | ||
|
||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
|
||
implementation project(':libsquaresloadingview') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# 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 *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/tech/nicesky/squaresloadingview/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package tech.nicesky.squaresloadingview; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("tech.nicesky.squaresloadingview", appContext.getPackageName()); | ||
} | ||
} |
Oops, something went wrong.