├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ └── trump.png │ │ │ ├── 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 │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_phone_grey_500_18dp.png │ │ │ │ └── ic_mail_outline_grey_500_18dp.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_phone_grey_500_18dp.png │ │ │ │ └── ic_mail_outline_grey_500_18dp.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_phone_grey_500_18dp.png │ │ │ │ └── ic_mail_outline_grey_500_18dp.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_phone_grey_500_18dp.png │ │ │ │ └── ic_mail_outline_grey_500_18dp.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_phone_grey_500_18dp.png │ │ │ │ └── ic_mail_outline_grey_500_18dp.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── elyeproj │ │ │ └── sampleloaderview │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── elyeproj │ │ │ └── sampleloaderview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── elyeproj │ │ └── sampleloaderview │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── loaderviewlibrary ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── elyeproj │ │ │ └── loaderviewlibrary │ │ │ ├── LoaderView.java │ │ │ ├── LoaderConstant.java │ │ │ ├── LoaderImageView.java │ │ │ ├── LoaderTextView.java │ │ │ └── LoaderController.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── elyeproj │ │ │ └── loaderviewlibrary │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── elyeproj │ │ └── loaderviewlibrary │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── scripts ├── publish-root.gradle └── publish-module.gradle ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /loaderviewlibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':loaderviewlibrary' 2 | -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/trump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable/trump.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | /.idea 7 | .DS_Store 8 | /build 9 | /captures 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_phone_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-hdpi/ic_phone_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_phone_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-mdpi/ic_phone_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_phone_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xhdpi/ic_phone_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_phone_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xxhdpi/ic_phone_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_phone_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xxxhdpi/ic_phone_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_mail_outline_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-hdpi/ic_mail_outline_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_mail_outline_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-mdpi/ic_mail_outline_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_mail_outline_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xhdpi/ic_mail_outline_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Sample Loader View 3 | Reset Loaders 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mail_outline_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xxhdpi/ic_mail_outline_grey_500_18dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_mail_outline_grey_500_18dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elye/loaderviewlibrary/HEAD/app/src/main/res/drawable-xxxhdpi/ic_mail_outline_grey_500_18dp.png -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #D7D7D7 4 | #B4B4B4 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 24 20:51:45 AEST 2019 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-6.5-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 12sp 6 | 15sp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/com/elyeproj/sampleloaderview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.sampleloaderview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /loaderviewlibrary/src/test/java/com/elyeproj/loaderviewlibrary/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.loaderviewlibrary; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/elyeproj/sampleloaderview/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.sampleloaderview; 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 | } -------------------------------------------------------------------------------- /loaderviewlibrary/src/androidTest/java/com/elyeproj/loaderviewlibrary/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.loaderviewlibrary; 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/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/elye/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 | -------------------------------------------------------------------------------- /loaderviewlibrary/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/elye/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/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion '29.0.2' 6 | 7 | defaultConfig { 8 | applicationId "com.elyeproj.sampleloaderview" 9 | minSdkVersion 15 10 | targetSdkVersion 30 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 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | testImplementation 'junit:junit:4.13.2' 25 | implementation project(':loaderviewlibrary') 26 | implementation 'androidx.appcompat:appcompat:1.2.0' 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/java/com/elyeproj/loaderviewlibrary/LoaderView.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.loaderviewlibrary; 2 | 3 | import android.graphics.Paint; 4 | 5 | /* 6 | * Copyright 2016 Elye Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | interface LoaderView { 22 | void setRectColor(Paint rectPaint); 23 | 24 | void invalidate(); 25 | 26 | boolean valueSet(); 27 | } 28 | -------------------------------------------------------------------------------- /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 19 | 20 | android.useAndroidX=true 21 | -------------------------------------------------------------------------------- /loaderviewlibrary/src/main/java/com/elyeproj/loaderviewlibrary/LoaderConstant.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.loaderviewlibrary; 2 | 3 | import android.graphics.Color; 4 | 5 | /* 6 | * Copyright 2016 Elye Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | class LoaderConstant { 22 | public final static int COLOR_DEFAULT_GRADIENT = Color.rgb(245, 245, 245); 23 | public final static float MIN_WEIGHT = 0.0f; 24 | public final static float MAX_WEIGHT = 1.0f; 25 | public final static int CORNER_DEFAULT = 0; 26 | public final static boolean USE_GRADIENT_DEFAULT = false; 27 | } 28 | -------------------------------------------------------------------------------- /scripts/publish-root.gradle: -------------------------------------------------------------------------------- 1 | // Create variables with empty default values 2 | ext["signing.keyId"] = '' 3 | ext["signing.password"] = '' 4 | ext["signing.secretKeyRingFile"] = '' 5 | ext["ossrhUsername"] = '' 6 | ext["ossrhPassword"] = '' 7 | ext["sonatypeStagingProfileId"] = '' 8 | 9 | File secretPropsFile = project.rootProject.file('local.properties') 10 | if (secretPropsFile.exists()) { 11 | // Read local.properties file first if it exists 12 | Properties p = new Properties() 13 | new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) } 14 | p.each { name, value -> ext[name] = value } 15 | } else { 16 | // Use system environment variables 17 | ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') 18 | ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') 19 | ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') 20 | ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') 21 | ext["signing.password"] = System.getenv('SIGNING_PASSWORD') 22 | ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE') 23 | } 24 | 25 | // Set up Sonatype repository 26 | nexusPublishing { 27 | repositories { 28 | sonatype { 29 | stagingProfileId = sonatypeStagingProfileId 30 | username = ossrhUsername 31 | password = ossrhPassword 32 | nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) 33 | snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /loaderviewlibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | ext { 4 | PUBLISH_GROUP_ID = 'io.github.elye' 5 | PUBLISH_VERSION = '3.0.0' 6 | PUBLISH_ARTIFACT_ID = 'loaderviewlibrary' 7 | PUBLISH_DESCRIPTION = 'LoaderView Android SDK' 8 | PUBLISH_URL = 'https://github.com/elye/loaderviewlibrary' 9 | PUBLISH_LICENSE_NAME = 'Apache License' 10 | PUBLISH_LICENSE_URL = 'https://github.com/elye/loaderviewlibrary/blob/master/LICENSE' 11 | PUBLISH_DEVELOPER_ID = 'elye' 12 | PUBLISH_DEVELOPER_NAME = 'Elye Project' 13 | PUBLISH_DEVELOPER_EMAIL = 'elye.project@gmail.com' 14 | PUBLISH_SCM_CONNECTION = 'scm:git:github.com/elye/loaderviewlibrary.git' 15 | PUBLISH_SCM_DEVELOPER_CONNECTION = 'scm:git:ssh://github.com/elye/loaderviewlibrary.git' 16 | PUBLISH_SCM_URL = 'https://github.com/elye/loaderviewlibrary/tree/master' 17 | } 18 | 19 | apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" 20 | 21 | android { 22 | compileSdkVersion 30 23 | buildToolsVersion '29.0.2' 24 | 25 | defaultConfig { 26 | minSdkVersion 15 27 | targetSdkVersion 30 28 | versionCode 14 29 | versionName "2.0.0" 30 | } 31 | buildTypes { 32 | release { 33 | minifyEnabled false 34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 35 | } 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation fileTree(dir: 'libs', include: ['*.jar']) 41 | testImplementation 'junit:junit:4.13.2' 42 | implementation 'androidx.appcompat:appcompat:1.2.0' 43 | } 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/publish-module.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven-publish' 2 | apply plugin: 'signing' 3 | 4 | task androidSourcesJar(type: Jar) { 5 | archiveClassifier.set('sources') 6 | if (project.plugins.findPlugin("com.android.library")) { 7 | from android.sourceSets.main.java.srcDirs 8 | } else { 9 | from sourceSets.main.java.srcDirs 10 | } 11 | } 12 | 13 | artifacts { 14 | archives androidSourcesJar 15 | } 16 | 17 | group = PUBLISH_GROUP_ID 18 | version = PUBLISH_VERSION 19 | 20 | afterEvaluate { 21 | publishing { 22 | publications { 23 | release(MavenPublication) { 24 | // The coordinates of the library, being set from variables that 25 | // we'll set up later 26 | groupId PUBLISH_GROUP_ID 27 | artifactId PUBLISH_ARTIFACT_ID 28 | version PUBLISH_VERSION 29 | 30 | // Two artifacts, the `aar` (or `jar`) and the sources 31 | if (project.plugins.findPlugin("com.android.library")) { 32 | from components.release 33 | } else { 34 | artifact("$buildDir/libs/${project.getName()}-${version}.jar") 35 | } 36 | 37 | artifact androidSourcesJar 38 | 39 | // Mostly self-explanatory metadata 40 | pom { 41 | name = PUBLISH_ARTIFACT_ID 42 | description = PUBLISH_DESCRIPTION 43 | url = PUBLISH_URL 44 | licenses { 45 | license { 46 | name = PUBLISH_LICENSE_NAME 47 | url = PUBLISH_LICENSE_URL 48 | } 49 | } 50 | developers { 51 | developer { 52 | id = PUBLISH_DEVELOPER_ID 53 | name = PUBLISH_DEVELOPER_NAME 54 | email = PUBLISH_DEVELOPER_EMAIL 55 | } 56 | } 57 | 58 | // Version control info - if you're using GitHub, follow the 59 | // format as seen here 60 | scm { 61 | connection = PUBLISH_SCM_CONNECTION 62 | developerConnection = PUBLISH_SCM_DEVELOPER_CONNECTION 63 | url = PUBLISH_SCM_URL 64 | } 65 | } 66 | } 67 | } 68 | } 69 | } 70 | 71 | ext["signing.keyId"] = rootProject.ext["signing.keyId"] 72 | ext["signing.password"] = rootProject.ext["signing.password"] 73 | ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"] 74 | 75 | signing { 76 | sign publishing.publications 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/elyeproj/sampleloaderview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.elyeproj.sampleloaderview; 2 | 3 | import android.os.AsyncTask; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.ImageView; 7 | import android.widget.TextView; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | import com.elyeproj.loaderviewlibrary.LoaderImageView; 10 | import com.elyeproj.loaderviewlibrary.LoaderTextView; 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | private int WAIT_DURATION = 5000; 15 | private DummyWait dummyWait; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_main); 21 | loadData(); 22 | } 23 | 24 | private void loadData() { 25 | if (dummyWait != null) { 26 | dummyWait.cancel(true); 27 | } 28 | dummyWait = new DummyWait(); 29 | dummyWait.execute(); 30 | } 31 | 32 | private void postLoadData() { 33 | ((TextView)findViewById(R.id.txt_name)).setText("Mr. Donald Trump"); 34 | ((TextView)findViewById(R.id.txt_title)).setText("President of United State (2017 - now)"); 35 | ((TextView)findViewById(R.id.txt_phone)).setText("+001 2345 6789"); 36 | ((TextView)findViewById(R.id.txt_email)).setText("donald.trump@donaldtrump.com"); 37 | ((ImageView)findViewById(R.id.image_icon)).setImageResource(R.drawable.trump); 38 | } 39 | 40 | public void resetLoader(View view) { 41 | ((LoaderTextView)findViewById(R.id.txt_name)).resetLoader(); 42 | ((LoaderTextView)findViewById(R.id.txt_title)).resetLoader(); 43 | ((LoaderTextView)findViewById(R.id.txt_phone)).resetLoader(); 44 | ((LoaderTextView)findViewById(R.id.txt_email)).resetLoader(); 45 | ((LoaderImageView)findViewById(R.id.image_icon)).resetLoader(); 46 | loadData(); 47 | } 48 | 49 | class DummyWait extends AsyncTask { 50 | @Override 51 | protected void onPreExecute() { 52 | super.onPreExecute(); 53 | } 54 | 55 | @Override 56 | protected Void doInBackground(Void... params) { 57 | try { 58 | Thread.sleep(WAIT_DURATION); 59 | } catch (InterruptedException e) { 60 | e.printStackTrace(); 61 | } 62 | return null; 63 | } 64 | 65 | @Override 66 | protected void onPostExecute(Void result) { 67 | super.onPostExecute(result); 68 | postLoadData(); 69 | } 70 | } 71 | 72 | @Override 73 | protected void onDestroy() { 74 | super.onDestroy(); 75 | if (dummyWait != null) { 76 | dummyWait.cancel(true); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 17 | 18 | 26 | 27 | 35 | 36 | 45 | 46 | 55 | 56 | 68 | 69 | 82 | 83 | 84 | 85 | 86 | 87 |