Repository: biodunalfet/SlidingSquaresLoader Branch: master Commit: 610635a859d5 Files: 36 Total size: 40.0 KB Directory structure: gitextract_kz4zy341/ ├── .gitignore ├── LICENSE ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── com/ │ │ └── hamza/ │ │ └── slidingsquaresloader/ │ │ └── ExampleInstrumentedTest.java │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── java/ │ │ │ └── com/ │ │ │ └── hamza/ │ │ │ └── slidingsquaresloader/ │ │ │ └── MainActivity.java │ │ └── res/ │ │ ├── layout/ │ │ │ └── activity_main.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── ids.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── values-w820dp/ │ │ └── dimens.xml │ └── test/ │ └── java/ │ └── com/ │ └── hamza/ │ └── slidingsquaresloader/ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── slidingsquaresloaderview/ ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src/ ├── androidTest/ │ └── java/ │ └── com/ │ └── hamza/ │ └── slidingsquaresloaderview/ │ └── ExampleInstrumentedTest.java ├── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── com/ │ │ └── hamza/ │ │ └── slidingsquaresloaderview/ │ │ ├── SlidingSquareLoaderView.java │ │ └── Square.java │ └── res/ │ ├── drawable/ │ │ └── square.xml │ └── values/ │ ├── attrs.xml │ ├── colors.xml │ └── strings.xml └── test/ └── java/ └── com/ └── hamza/ └── slidingsquaresloaderview/ └── ExampleUnitTest.java ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.iml .gradle /local.properties /.idea/workspace.xml /.idea/libraries .DS_Store /build /captures .externalNativeBuild .idea ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) [2017] [Hamza Fetuga] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ [![](https://jitpack.io/v/biodunalfet/SlidingSquaresLoader.svg)](https://jitpack.io/#biodunalfet/SlidingSquaresLoader) # SlidingSquaresLoader Sliding Square Loader - A simple progress loader inspired by [Can you Code this UI? Volume 6!](https://stories.uplabs.com/can-you-code-this-ui-volume-6-7bd09fa6dd92#.nyh2zhpvb) ![sslv animation](https://media.giphy.com/media/l0ExrZuZO2ihDzAfm/giphy.gif) ## Gradle **Step 1.** Add the JitPack repository to your build file ``` groovy allprojects { repositories { maven { url 'https://jitpack.io' } } } ``` **Step 2.** Add the dependency ``` groovy dependencies { compile "com.github.biodunalfet:SlidingSquaresLoader:1.0" } ``` ## Usage * In XML Layout ``` xml ``` 1. `sslv_start` = `boolean` that determines if the loader should start sliding. Default value is `true`. 2. `sslv_duration` = the amount of milliseconds it takes for a square to complete sliding. Default value is `350` 3. `sslv_delay` = the number of milliseconds to wait before sliding. Default value is `25` 4. `sslv_square_length` = the dimension of each square. Default value is `25dp` 5. `sslv_gap` = the dimension of the gap between each square. Default value is `5dp` 6. `sslv_color` = the `color` of the square. Defaults to `#ff8f00` * In Java ``` java SlidingSquareLoaderView slidingview2 = (SlidingSquareLoaderView) findViewById(R.id.sliding_view2); slidingview.start(); // starts the sliding slidingview.stop(); // stops the sliding slidingview.setDuration(xxx); // sets duration of sliding slidingview.setDelay(xxx); // sets delay period before sliding slidingview.setColor(Color.parseColor("#2196F3")); // sets the color of the squares ``` ## License The contents of this repository are covered under the [MIT License](https://github.com/biodunalfet/SlidingSquareLoader/blob/master/LICENSE) ================================================ FILE: app/.gitignore ================================================ /build ================================================ FILE: app/build.gradle ================================================ apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId "com.hamza.slidingsquaresloader" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile "com.android.support:appcompat-v7:$supportLibVersion" testCompile 'junit:junit:4.12' compile project(':slidingsquaresloaderview') } ================================================ FILE: app/proguard-rules.pro ================================================ # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in C:\Users\Hamza Fetuga\Desktop\Android Calabash\adt-bundle-windows-x86-20131030\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 *; #} ================================================ FILE: app/src/androidTest/java/com/hamza/slidingsquaresloader/ExampleInstrumentedTest.java ================================================ package com.hamza.slidingsquaresloader; 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.*; /** * Instrumentation test, which will execute on an Android device. * * @see Testing documentation */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.hamza.slidingsquaresloader", appContext.getPackageName()); } } ================================================ FILE: app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: app/src/main/java/com/hamza/slidingsquaresloader/MainActivity.java ================================================ package com.hamza.slidingsquaresloader; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import com.hamza.slidingsquaresloaderview.SlidingSquareLoaderView; public class MainActivity extends AppCompatActivity { private SlidingSquareLoaderView slidingview; private SlidingSquareLoaderView slidingview2; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.slidingview = (SlidingSquareLoaderView) findViewById(R.id.sliding_view); this.slidingview2 = (SlidingSquareLoaderView) findViewById(R.id.sliding_view2); this.button = (Button) findViewById(R.id.button); slidingview.start(); slidingview2.start(); slidingview2.setDuration(200); slidingview2.setDelay(15); slidingview2.setColor(Color.parseColor("#2196F3")); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (slidingview2.isAnimating()){ slidingview2.stop(); } else { slidingview2.start(); } } }); } } ================================================ FILE: app/src/main/res/layout/activity_main.xml ================================================