├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── leo │ │ └── simpleloader │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── leo │ │ └── simpleloader │ │ └── MainActivity.java │ └── res │ ├── layout │ └── activity_main.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── preview ├── simplearcdialog_1.gif └── simplearcdialog_2.gif ├── settings.gradle └── simplearcloader ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── simplearcloader.iml └── src ├── androidTest └── java │ └── com │ └── leo │ └── simplearcloader │ └── ApplicationTest.java └── main ├── AndroidManifest.xml ├── java └── com │ └── leo │ └── simplearcloader │ ├── ArcConfiguration.java │ ├── SimpleArcDialog.java │ └── SimpleArcLoader.java └── res ├── layout └── loader_layout.xml └── values ├── attrs.xml ├── dimens.xml └── strings.xml /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Android 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 1.7 67 | 68 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SimpleArcLoader-green.svg?style=true)](https://android-arsenal.com/details/1/3066) 2 | # SimpleArcLoader 3 | - bored of seeing the same old Android Loader ? SimpleArcLoader is one thing you should try. 4 | 5 | # Preview 6 | 7 | 8 | 9 | # Setup 10 | ## Gradle 11 | ```groovy 12 | dependencies { 13 | compile 'com.leo.simplearcloader:simplearcloader:1.0.+' 14 | } 15 | ``` 16 | 17 | ## Example 1 18 | To show dialog 19 | ```java 20 | SimpleArcDialog mDialog = new SimpleArcDialog(this); 21 | mDialog.setConfiguration(new ArcConfiguration(this)); 22 | mDialog.show(); 23 | ``` 24 | ## Example 2 25 | Making use of just the Loader 26 | ```xml 27 | 36 | 37 | ``` 38 | ## Example 3 39 | Customizing Dialog/SimpleArcLoader View using ArcConfiguration 40 | ```java 41 | ArcConfiguration configuration = new ArcConfiguration(context); 42 | configuration.setLoaderStyle(SimpleArcLoader.STYLE.COMPLETE_ARC); 43 | configuration.setText("Please wait.."); 44 | 45 | // Using this configuration with Dialog 46 | mDialog.setConfiguration(configuration); 47 | 48 | // Using this configuration with ArcLoader 49 | mSimpleArcLoader.refreshArcLoaderDrawable(configuration); 50 | ``` 51 | 52 | You can customize Arc/Dialog with ArcConfiguration methods - 53 | - setLoaderStyle(SimpleArcLoader.STYLE mLoaderStyle) 54 | - setArcMargin(int mArcMargin) 55 | - setArcWidthInPixel(int mStrokeWidth) 56 | - setColors(int[] colors) 57 | - setTypeFace(Typeface typeFace) 58 | - setText(String mText) 59 | - setTextColor(int mTextColor) 60 | - setTextSize(int size) 61 | - setAnimationSpeedWithIndex(int mAnimationIndex) 62 | Values to be passed SimpleArcLoader.SPEED_SLOW, SimpleArcLoader.SPEED_MEDIUM, SimpleArcLoader.SPEED_FAST 63 | 64 | Please refer the examples for some of the customization. 65 | 66 | # Developed By 67 | - prathamesh.s1989@gmail.com 68 | 69 | # License 70 | 71 | Copyright 2016 Prathamesh Sawant 72 | 73 | Licensed under the Apache License, Version 2.0 (the "License"); 74 | you may not use this file except in compliance with the License. 75 | You may obtain a copy of the License at 76 | 77 | http://www.apache.org/licenses/LICENSE-2.0 78 | 79 | Unless required by applicable law or agreed to in writing, software 80 | distributed under the License is distributed on an "AS IS" BASIS, 81 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 82 | See the License for the specific language governing permissions and 83 | limitations under the License. 84 | 85 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.leo.simpleloader" 9 | minSdkVersion 9 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0.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:22.1.1' 25 | compile project(':simplearcloader') 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/prathamesh/Library/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 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/leo/simpleloader/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.leo.simpleloader; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/leo/simpleloader/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.leo.simpleloader; 2 | 3 | import android.content.DialogInterface; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.widget.LinearLayout; 8 | 9 | import com.leo.simplearcloader.ArcConfiguration; 10 | import com.leo.simplearcloader.SimpleArcDialog; 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | 19 | final LinearLayout mRootView = (LinearLayout)findViewById(R.id.rootlayout); 20 | 21 | final SimpleArcDialog mDialog = new SimpleArcDialog(MainActivity.this); 22 | mDialog.setConfiguration(new ArcConfiguration(MainActivity.this)); 23 | mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { 24 | @Override 25 | public void onDismiss(DialogInterface dialogInterface) { 26 | mRootView.setVisibility(View.VISIBLE); 27 | } 28 | }); 29 | 30 | findViewById(R.id.loaderButtonRandom).setOnClickListener(new View.OnClickListener() { 31 | @Override 32 | public void onClick(View view) { 33 | mRootView.setVisibility(View.INVISIBLE); 34 | mDialog.show(); 35 | } 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 15 | 16 | 24 | 25 | 37 | 38 | 39 | 40 | 41 | 46 | 47 | 53 | 54 | 58 | 59 | 60 | 65 | 66 | 70 | 71 | 72 | 73 | 74 | 75 | 79 | 80 | 83 | 84 | 85 | 92 | 93 | 99 | 100 | 106 | 107 | 116 | 117 | 118 | 125 | 126 | 127 | 128 | 134 | 135 | 144 | 145 | 146 | 153 | 154 | 155 | 156 | 157 | 158 | 162 | 163 | 167 | 168 | 172 | 173 | 179 | 180 | 188 | 189 | 190 | 197 | 198 | 199 | 200 | 206 | 207 | 216 | 217 | 218 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 242 | 243 |