├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── raw │ │ │ │ └── github_gif.gif │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── strings.xml │ │ │ │ └── dimens.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── listview_cell.xml │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── orangegangsters │ │ │ └── github │ │ │ └── swipyrefreshlayout │ │ │ ├── DummyListViewAdapter.java │ │ │ └── MainActivity.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── orangegangsters │ │ └── github │ │ └── swiperefreshlayout │ │ ├── AbstractTest.java │ │ └── SwipyRefreshLayoutTest.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── lib ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ │ └── values │ │ │ │ └── attrs.xml │ │ └── java │ │ │ └── com │ │ │ └── orangegangsters │ │ │ └── github │ │ │ └── swipyrefreshlayout │ │ │ └── library │ │ │ ├── SwipyRefreshLayoutDirection.java │ │ │ ├── CircleImageView.java │ │ │ ├── MaterialProgressDrawable.java │ │ │ └── SwipyRefreshLayout.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── orangegangsters │ │ └── github │ │ └── swiperefreshlayout │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── lib.iml ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── SwipyRefreshLayout.iml ├── LICENSE ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':lib' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/raw/github_gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/app/src/main/res/raw/github_gif.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omadahealth/SwipyRefreshLayout/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SwipeRefreshLayout 5 | Hello world! 6 | Settings 7 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 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.2.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 20dp 6 | 10dp 7 | 8 | -------------------------------------------------------------------------------- /lib/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /lib/src/androidTest/java/com/orangegangsters/github/swiperefreshlayout/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.orangegangsters.github.swiperefreshlayout; 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 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | .idea 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio 32 | .idea 33 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 34 | .gradle 35 | build/ 36 | -------------------------------------------------------------------------------- /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/oliviergoutay/Documents/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 | -------------------------------------------------------------------------------- /lib/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/oliviergoutay/Documents/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/res/layout/listview_cell.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | -------------------------------------------------------------------------------- /lib/src/main/java/com/orangegangsters/github/swipyrefreshlayout/library/SwipyRefreshLayoutDirection.java: -------------------------------------------------------------------------------- 1 | package com.orangegangsters.github.swipyrefreshlayout.library; 2 | 3 | /** 4 | * Created by oliviergoutay on 1/23/15. 5 | */ 6 | public enum SwipyRefreshLayoutDirection { 7 | 8 | TOP(0), 9 | BOTTOM(1), 10 | BOTH(2); 11 | 12 | private int mValue; 13 | 14 | SwipyRefreshLayoutDirection(int value) { 15 | this.mValue = value; 16 | } 17 | 18 | public static SwipyRefreshLayoutDirection getFromInt(int value) { 19 | for (SwipyRefreshLayoutDirection direction : SwipyRefreshLayoutDirection.values()) { 20 | if (direction.mValue == value) { 21 | return direction; 22 | } 23 | } 24 | return BOTH; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 9 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:23.3.0' 24 | } 25 | 26 | //gradle clean build uploadArchives 27 | //apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' 28 | apply from: 'https://raw.github.com/omadahealth/omada-nexus/master/gradle-mvn-push/gradle-mvn-push.gradle' -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | dataBinding { 8 | enabled = true 9 | } 10 | 11 | defaultConfig { 12 | applicationId "com.orangegangsters.github.swiperefreshlayout" 13 | minSdkVersion 9 14 | targetSdkVersion 23 15 | versionCode 1 16 | versionName "1.0" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | compile 'com.android.support:appcompat-v7:23.3.0' 29 | 30 | compile project(':lib') 31 | 32 | //Robotium (tests) 33 | androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.4' 34 | } 35 | -------------------------------------------------------------------------------- /SwipyRefreshLayout.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 OrangeGangsters 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /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 | #VERSION_NAME=1.0.0-SNAPSHOT 20 | VERSION_NAME=1.2.3 21 | VERSION_CODE=6 22 | GROUP=com.github.orangegangsters 23 | 24 | POM_DESCRIPTION=A SwipeRefreshLayout extension that allows to swipe in both direction 25 | POM_URL=https://github.com/OrangeGangsters/SwipyRefreshLayout 26 | POM_SCM_URL=https://github.com/OrangeGangsters/SwipyRefreshLayout.git 27 | POM_SCM_CONNECTION=https://github.com/OrangeGangsters/SwipyRefreshLayout.git 28 | POM_SCM_DEV_CONNECTION=https://github.com/OrangeGangsters/SwipyRefreshLayout.git 29 | POM_LICENCE_NAME=The MIT License (MIT) 30 | POM_LICENCE_URL=https://github.com/OrangeGangsters/SwipyRefreshLayoutblob/master/LICENSE 31 | POM_LICENCE_DIST=https://github.com/OrangeGangsters/SwipyRefreshLayoutblob/master/LICENSE 32 | POM_DEVELOPER_ID=olivierg13 & stoyand 33 | POM_DEVELOPER_NAME=Olivier Goutay & Stoyan Dimitrov 34 | 35 | 36 | POM_NAME=SwipyRefreshLayout Library 37 | POM_ARTIFACT_ID=swipy 38 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /app/src/androidTest/java/com/orangegangsters/github/swiperefreshlayout/AbstractTest.java: -------------------------------------------------------------------------------- 1 | package com.orangegangsters.github.swiperefreshlayout; 2 | 3 | import android.test.ActivityInstrumentationTestCase2; 4 | import android.view.WindowManager; 5 | 6 | import com.orangegangsters.github.swipyrefreshlayout.MainActivity; 7 | import com.robotium.solo.Solo; 8 | 9 | /** 10 | * Testing Fundamentals 11 | */ 12 | public class AbstractTest extends ActivityInstrumentationTestCase2 { 13 | 14 | protected Solo solo; 15 | 16 | public AbstractTest() { 17 | super(MainActivity.class); 18 | } 19 | 20 | @Override 21 | protected void setUp() throws Exception { 22 | super.setUp(); 23 | solo = new Solo(getInstrumentation(), getActivity()); 24 | wakeUpScreen(); 25 | } 26 | 27 | @Override 28 | protected void tearDown() throws Exception { 29 | solo.finishOpenedActivities(); 30 | super.tearDown(); 31 | } 32 | 33 | private void wakeUpScreen() { 34 | getActivity().runOnUiThread(new Runnable() { 35 | @Override 36 | public void run() { 37 | getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); 38 | getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 39 | getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 40 | getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); 41 | } 42 | }); 43 | solo.unlockScreen(); 44 | } 45 | 46 | /** 47 | * Click on the specified view id 48 | * 49 | * @param id 50 | */ 51 | protected void clickOnView(int id) { 52 | solo.clickOnView(solo.getView(id)); 53 | } 54 | 55 | /** 56 | * Drags the screen to the top or down, depending on the boolean. 57 | */ 58 | protected void drag(boolean top) { 59 | int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight(); 60 | 61 | int fromY, toY; 62 | 63 | // Scroll Down // Drag Up 64 | fromY = top ? (screenHeight / 4) : (screenHeight - (screenHeight / 4)); 65 | toY = top ? (screenHeight - (screenHeight / 4)) : (screenHeight / 4); 66 | 67 | solo.drag(100, 100, fromY, toY, 10); 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/orangegangsters/github/swiperefreshlayout/SwipyRefreshLayoutTest.java: -------------------------------------------------------------------------------- 1 | package com.orangegangsters.github.swiperefreshlayout; 2 | 3 | import android.view.View; 4 | import android.widget.ImageView; 5 | 6 | import com.orangegangsters.github.swipyrefreshlayout.MainActivity; 7 | import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; 8 | 9 | /** 10 | * Created by olivier.goutay on 4/18/16. 11 | */ 12 | public class SwipyRefreshLayoutTest extends AbstractTest { 13 | 14 | /** 15 | * Test that the {@link SwipyRefreshLayout#getCircleView()} is shown in the right directions. 16 | */ 17 | public void testSwipyRefreshLayoutDirections() { 18 | //Wait for launch 19 | solo.waitForActivity(MainActivity.class); 20 | solo.assertCurrentActivity("MainActivity", MainActivity.class); 21 | solo.sleep(500); 22 | 23 | //Test TOP 24 | SwipyRefreshLayout swipyRefreshLayout = (SwipyRefreshLayout) solo.getView(R.id.swipyrefreshlayout); 25 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 26 | clickOnView(R.id.button_top); 27 | drag(true); 28 | assertEquals(View.VISIBLE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 29 | solo.sleep(MainActivity.DISMISS_TIMEOUT + 1000); 30 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 31 | 32 | //Test BOTTOM 33 | clickOnView(R.id.button_bottom); 34 | drag(true); 35 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 36 | drag(false); 37 | solo.sleep(500); 38 | drag(false); 39 | assertEquals(View.VISIBLE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 40 | solo.sleep(MainActivity.DISMISS_TIMEOUT + 1000); 41 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 42 | 43 | //Test BOTH 44 | clickOnView(R.id.button_both); 45 | drag(false); 46 | assertEquals(View.VISIBLE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 47 | solo.sleep(MainActivity.DISMISS_TIMEOUT + 1000); 48 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 49 | drag(true); 50 | solo.sleep(500); 51 | drag(true); 52 | assertEquals(View.VISIBLE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 53 | solo.sleep(MainActivity.DISMISS_TIMEOUT + 1000); 54 | assertEquals(View.GONE, ((ImageView) swipyRefreshLayout.getCircleView()).getVisibility()); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 12 | 13 | 19 | 20 | 24 | 25 | 26 | 27 |