├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ └── styles.xml │ │ ├── drawable │ │ │ └── girl.jpg │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── lj_3d │ │ └── gearloadingproject │ │ └── MainActivity.java ├── build.gradle └── proguard-rules.pro ├── .idea ├── .name ├── dictionaries │ └── LJ.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml └── misc.xml ├── gearloadinglayout ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── attrs.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ ├── attrs.xml │ │ │ └── dimens.xml │ │ ├── drawable │ │ │ ├── cloud.png │ │ │ ├── girl.jpg │ │ │ └── shadow.xml │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ └── layout │ │ │ ├── test.xml │ │ │ ├── layout_one_gear.xml │ │ │ ├── layout_two_gears.xml │ │ │ └── layout_three_gears.xml │ │ ├── java │ │ └── lj_3d │ │ │ └── gearloadinglayout │ │ │ ├── enums │ │ │ ├── Style.java │ │ │ ├── Type.java │ │ │ └── ShowMode.java │ │ │ ├── interfaces │ │ │ └── OnBlurCompleteInterface.java │ │ │ ├── utils │ │ │ ├── DeviceScreenHelper.java │ │ │ ├── GearDialogBuilder.java │ │ │ └── FastBlur.java │ │ │ └── gearViews │ │ │ ├── CutOutLayout.java │ │ │ ├── OneGearLayout.java │ │ │ ├── TwoGearsLayout.java │ │ │ ├── ThreeGearsLayout.java │ │ │ ├── GearView.java │ │ │ └── GearLoadingLayout.java │ │ └── AndroidManifest.xml ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew ├── README.md └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | GearLoadingProject -------------------------------------------------------------------------------- /gearloadinglayout/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':gearloadinglayout' 2 | -------------------------------------------------------------------------------- /.idea/dictionaries/LJ.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GearLoadingProject 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/drawable/girl.jpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GearLoadingLayout 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/drawable/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/drawable/cloud.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/drawable/girl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/drawable/girl.jpg -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Devlight/GearLoadingProject/HEAD/gearloadinglayout/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #D6D5D6 3 | #D5DEE4 4 | 5 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/enums/Style.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.enums; 2 | 3 | /** 4 | * Created by LJ on 18.04.2016. 5 | */ 6 | public enum Style { 7 | SNACK_BAR, DIALOG 8 | } 9 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/enums/Type.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.enums; 2 | 3 | /** 4 | * Created by LJ on 23.03.2016. 5 | */ 6 | public enum Type { 7 | ONE_GEAR, TWO_GEARS, THREE_GEARS 8 | } 9 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/enums/ShowMode.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.enums; 2 | 3 | /** 4 | * Created by LJ on 23.03.2016. 5 | */ 6 | public enum ShowMode { 7 | TOP, BOTTOM, LEFT, RIGHT, CENTER 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GearLoadingLayout 3 | 4 | Hello world! 5 | Settings 6 | 7 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/drawable/shadow.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/interfaces/OnBlurCompleteInterface.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.interfaces; 2 | 3 | /** 4 | * Created by LJ on 22.03.2016. 5 | */ 6 | public interface OnBlurCompleteInterface { 7 | 8 | public void onBlurComplete(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 240dp 6 | 2dp 7 | 10dp 8 | 9 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #D6D5D6 7 | #D5DEE4 8 | 9 | #868686 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "lj_3d.gearloadingproject" 9 | minSdkVersion 14 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:23.1.1' 25 | compile project(':gearloadinglayout') 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 C:\Program Files\Android\Android Studio\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 | -------------------------------------------------------------------------------- /gearloadinglayout/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | // applicationId "lj_3d.gearloadinglayout" 9 | minSdkVersion 14 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 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.1.1' 26 | } 27 | -------------------------------------------------------------------------------- /gearloadinglayout/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 C:\Program Files\Android\Android Studio\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/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/utils/DeviceScreenHelper.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.utils; 2 | 3 | import android.app.Activity; 4 | import android.util.DisplayMetrics; 5 | 6 | /** 7 | * Created by LJ on 18.04.2016. 8 | */ 9 | public class DeviceScreenHelper { 10 | 11 | public static int mDeviceWidth; 12 | public static int mDeviceHeight; 13 | public static boolean isDialogMode; 14 | 15 | public static void init(final Activity activity) { 16 | if (activity == null) return; 17 | DisplayMetrics displaymetrics = new DisplayMetrics(); 18 | activity.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); 19 | mDeviceHeight = displaymetrics.heightPixels; 20 | mDeviceWidth = displaymetrics.widthPixels; 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 25 | 26 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/layout/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/utils/GearDialogBuilder.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.utils; 2 | 3 | import android.app.Activity; 4 | import android.view.ViewGroup; 5 | 6 | import lj_3d.gearloadinglayout.gearViews.GearLoadingLayout; 7 | import lj_3d.gearloadinglayout.gearViews.OneGearLayout; 8 | import lj_3d.gearloadinglayout.gearViews.ThreeGearsLayout; 9 | import lj_3d.gearloadinglayout.gearViews.TwoGearsLayout; 10 | 11 | /** 12 | * Created by LJ on 21.03.2016. 13 | */ 14 | public class GearDialogBuilder { 15 | 16 | private static GearDialogBuilder mGearLoadingBuilder; 17 | 18 | private Activity mActivity; 19 | private ViewGroup mRootViewGroup; 20 | private GearLoadingLayout mGearLoadingLayout; 21 | 22 | public static GearDialogBuilder getInstance(final Activity activity) { 23 | if (mGearLoadingBuilder == null) 24 | mGearLoadingBuilder = new GearDialogBuilder(); 25 | 26 | mGearLoadingBuilder.mActivity = activity; 27 | mGearLoadingBuilder.mRootViewGroup = ((ViewGroup) activity.findViewById(android.R.id.content)); 28 | 29 | DeviceScreenHelper.init(activity); 30 | return mGearLoadingBuilder; 31 | } 32 | 33 | /** 34 | * Method that define type of GearLoadingLayout 35 | * 36 | * @param type is a type of child class that extend GearLoadingLayout 37 | * @return GearLoadingLayout that casted to child layout, in accordance with type of class 38 | */ 39 | 40 | public T setType(Class type) { 41 | DeviceScreenHelper.isDialogMode = true; 42 | switch (type.getSimpleName()) { 43 | case OneGearLayout.IDENTIFIER: 44 | mGearLoadingLayout = new OneGearLayout(mActivity); 45 | break; 46 | case TwoGearsLayout.IDENTIFIER: 47 | mGearLoadingLayout = new TwoGearsLayout(mActivity); 48 | break; 49 | case ThreeGearsLayout.IDENTIFIER: 50 | mGearLoadingLayout = new ThreeGearsLayout(mActivity); 51 | break; 52 | default: 53 | mGearLoadingLayout = new ThreeGearsLayout(mActivity); 54 | break; 55 | } 56 | mGearLoadingLayout.setActivityContentView(mRootViewGroup); 57 | return type.cast(mGearLoadingLayout); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/layout/layout_one_gear.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | 20 | 21 | 22 | 26 | 27 | 33 | 34 | 43 | 44 | 45 | 46 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 1dp 3 | 5dp 4 | 10dp 5 | 6 | 120dp 7 | 100dp 8 | 90dp 9 | 10 | 40dp 11 | 12 | 9dp 13 | 60dp 14 | 45dp 15 | 7dp 16 | 35dp 17 | -15dp 18 | 6dp 19 | 55dp 20 | 45dp 21 | 6dp 22 | -24dp 23 | -60dp 24 | 14dp 25 | 60dp 26 | 50dp 27 | 8dp 28 | 29 | 10dp 30 | 70dp 31 | 55dp 32 | 9dp 33 | 63dp 34 | 31dp 35 | 6dp 36 | 55dp 37 | 44dp 38 | 7dp 39 | 10dp 40 | 70dp 41 | 55dp 42 | 10dp 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/res/layout/layout_two_gears.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | 20 | 21 | 22 | 26 | 27 | 33 | 34 | 43 | 44 | 55 | 56 | 57 | 58 | 59 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.7 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /gearloadinglayout/src/main/java/lj_3d/gearloadinglayout/gearViews/CutOutLayout.java: -------------------------------------------------------------------------------- 1 | package lj_3d.gearloadinglayout.gearViews; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Color; 7 | import android.graphics.Paint; 8 | import android.graphics.PorterDuff; 9 | import android.graphics.PorterDuffXfermode; 10 | import android.util.AttributeSet; 11 | import android.view.View; 12 | 13 | import lj_3d.gearloadinglayout.R; 14 | 15 | 16 | /** 17 | * Created by LJ on 28.09.2015. 18 | */ 19 | public class CutOutLayout extends View { 20 | 21 | private int color; 22 | private int cutRadius; 23 | private int height = 218; 24 | private int width = 620; 25 | private Paint paint; 26 | private Paint shadow; 27 | private final PorterDuffXfermode mPorterDuffXfermode = new PorterDuffXfermode(PorterDuff.Mode.CLEAR); 28 | 29 | public void setColor(int backgroundColor) { 30 | this.color = backgroundColor; 31 | } 32 | 33 | public void setWidth(int width) { 34 | this.width = width; 35 | requestLayout(); 36 | } 37 | 38 | public void setHeight(int height) { 39 | this.height = height; 40 | requestLayout(); 41 | } 42 | 43 | public void setCutRadius(int cutRadius) { 44 | if (cutRadius == 0) 45 | return; 46 | this.cutRadius = cutRadius; 47 | requestLayout(); 48 | } 49 | 50 | 51 | public CutOutLayout(Context context) { 52 | super(context); 53 | } 54 | 55 | public CutOutLayout(Context context, AttributeSet attrs) { 56 | super(context, attrs); 57 | parseAttributes(attrs); 58 | initTools(); 59 | } 60 | 61 | public CutOutLayout(Context context, AttributeSet attrs, int defStyleAttr) { 62 | super(context, attrs, defStyleAttr); 63 | parseAttributes(attrs); 64 | initTools(); 65 | } 66 | 67 | 68 | @Override 69 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 70 | width = w; 71 | height = h; 72 | super.onSizeChanged(w, h, oldw, oldh); 73 | } 74 | 75 | private void initTools() { 76 | paint = new Paint(); 77 | shadow = new Paint(); 78 | shadow.setShadowLayer(15, 0.0f, 0.0f, getResources().getColor(R.color.shadow_grey)); 79 | shadow.setAntiAlias(true); 80 | shadow.setDither(true); 81 | shadow.setColor(getResources().getColor(R.color.shadow_grey)); 82 | shadow.setStyle(Paint.Style.STROKE); 83 | shadow.setAlpha(70); 84 | shadow.setStrokeWidth(7); 85 | paint.setStyle(Paint.Style.FILL_AND_STROKE); 86 | paint.setXfermode(mPorterDuffXfermode); 87 | } 88 | 89 | private void parseAttributes(AttributeSet attrs) { 90 | TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.CutOutLayout); 91 | 92 | color = a.getColor(R.styleable.CutOutLayout_cutLayoutColor, Color.WHITE); 93 | setColor(color); 94 | 95 | cutRadius = (int) a.getDimension(R.styleable.CutOutLayout_cutRadius, 50); 96 | setCutRadius(cutRadius); 97 | 98 | a.recycle(); 99 | requestLayout(); 100 | } 101 | 102 | @Override 103 | protected void onDraw(Canvas canvas) { 104 | super.onDraw(canvas); 105 | canvas.drawColor(color); 106 | canvas.drawCircle(width / 2, height / 2, cutRadius, paint); 107 | canvas.drawCircle(width / 2, height / 2, cutRadius, shadow); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 20 | 21 | 27 | 28 | 33 | 34 | 39 | 40 | 41 | 42 | 51 | 52 | 62 | 63 |