├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── font │ │ │ └── lobster.otf │ │ ├── drawable-hdpi │ │ │ └── ic_options.png │ │ ├── drawable-mdpi │ │ │ └── ic_options.png │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── drawable-xhdpi │ │ │ └── ic_options.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_options.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── drawable │ │ │ └── bg_layout.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── activity_main.xml │ │ │ └── layout_options.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── hlabexamples │ │ └── animatedpulltorefresh │ │ ├── ListAdapter.kt │ │ └── MainActivity.kt ├── proguard-rules.pro └── build.gradle ├── _config.yml ├── AnimatedPullToRefreshLib ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ ├── dimen.xml │ │ │ ├── strings.xml │ │ │ └── attrs.xml │ │ └── java │ │ └── com │ │ └── hlab │ │ └── animatedpulltorefresh │ │ ├── enums │ │ ├── HeaderState.java │ │ ├── HeaderAnimSpeed.java │ │ ├── HeaderLoopAnim.java │ │ └── HeaderTextAnim.java │ │ ├── AnimationListener.java │ │ ├── herlper │ │ ├── Constants.java │ │ ├── ViewHelper.java │ │ └── AnimationHelper.java │ │ ├── CharacterAnimatorHeaderView.java │ │ └── AnimatedPullToRefreshLayout.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-leap-day -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':AnimatedPullToRefreshLib' 2 | -------------------------------------------------------------------------------- /app/src/main/res/font/lobster.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/font/lobster.otf -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/drawable-hdpi/ic_options.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/drawable-mdpi/ic_options.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/drawable-xhdpi/ic_options.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/drawable-xxhdpi/ic_options.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HarinTrivedi/AnimatedPullToRefresh-master/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .DS_Store 3 | .externalNativeBuild 4 | /.gradle 5 | /.idea 6 | /local.properties 7 | /build 8 | /captures 9 | /app/build 10 | /AnimatedPullToRefreshLib/build 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 01 19:24:17 IST 2020 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.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #f9f9f9 8 | #5c5c5c 9 | 10 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10sp 4 | 10dp 5 | 10dp 6 | 5dp 7 | 5dp 8 | 9 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Swipe to refresh 3 | Release to refresh 4 | Refreshing ... 5 | Refreshing complete 6 | last update: 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/enums/HeaderState.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.enums; 2 | 3 | public enum HeaderState { 4 | HEADER_STATE_DEFAULT(-1), 5 | HEADER_STATE_NORMAL(0), 6 | HEADER_STATE_READY(1), 7 | HEADER_STATE_REFRESHING(2), 8 | HEADER_STATE_COMPLETE(3); 9 | 10 | int state; 11 | 12 | HeaderState(int i) { 13 | state = i; 14 | } 15 | 16 | public int getState() { 17 | return state; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/AnimationListener.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh; 2 | 3 | import android.view.animation.Animation; 4 | 5 | /** 6 | * Created in Android_animated_pull_to_refresh_control-master on 22/03/17. 7 | */ 8 | 9 | class AnimationListener implements Animation.AnimationListener { 10 | @Override 11 | public void onAnimationStart(Animation animation) { 12 | } 13 | 14 | @Override 15 | public void onAnimationEnd(Animation animation) { 16 | } 17 | 18 | @Override 19 | public void onAnimationRepeat(Animation animation) { 20 | } 21 | } -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/enums/HeaderAnimSpeed.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.enums; 2 | 3 | /** 4 | * Created in Android_animated_pull_to_refresh_control-master on 22/03/17. 5 | */ 6 | 7 | public enum HeaderAnimSpeed { 8 | FAST(0), SLOW(1); 9 | 10 | private int speed; 11 | 12 | HeaderAnimSpeed(int type) { 13 | speed = type; 14 | } 15 | 16 | public int getSpeed() { 17 | return speed; 18 | } 19 | 20 | public static HeaderAnimSpeed fromId(int id) { 21 | for (HeaderAnimSpeed f : values()) { 22 | if (f.speed == id) return f; 23 | } 24 | throw new IllegalArgumentException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/enums/HeaderLoopAnim.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.enums; 2 | 3 | /** 4 | * Created in Android_animated_pull_to_refresh_control-master on 22/03/17. 5 | */ 6 | 7 | public enum HeaderLoopAnim { 8 | ZOOM(0), FADE(1); 9 | 10 | private int animType; 11 | 12 | HeaderLoopAnim(int type) { 13 | animType = type; 14 | } 15 | 16 | public int getAnimType() { 17 | return animType; 18 | } 19 | 20 | public static HeaderLoopAnim fromId(int id) { 21 | for (HeaderLoopAnim f : values()) { 22 | if (f.animType == id) return f; 23 | } 24 | throw new IllegalArgumentException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/enums/HeaderTextAnim.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.enums; 2 | 3 | /** 4 | * Created in Android_animated_pull_to_refresh_control-master on 22/03/17. 5 | */ 6 | 7 | public enum HeaderTextAnim { 8 | ROTATE_CW(0), ROTATE_ACW(1), FADE(2), ZOOM(3); 9 | 10 | private int animType; 11 | 12 | HeaderTextAnim(int type) { 13 | animType = type; 14 | } 15 | 16 | public int getAnimType() { 17 | return animType; 18 | } 19 | 20 | public static HeaderTextAnim fromId(int id) { 21 | for (HeaderTextAnim f : values()) { 22 | if (f.animType == id) return f; 23 | } 24 | throw new IllegalArgumentException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AnimatedPullToRefresh 3 | LOADING 4 | 5 | 6 | Fast 7 | Slow 8 | 9 | 10 | 11 | Rotate Clockwise 12 | Rotate Anti-clockwise 13 | Fade 14 | Zoom 15 | 16 | 17 | 18 | Zoom 19 | Fade 20 | 21 | 22 | 23 | 1 24 | 2 25 | 26 | 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 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /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 /Volumes/DATA/Android-Setup/android-sdk-mac_86/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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/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 /Volumes/DATA/Android-Setup/android-sdk-mac_86/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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/herlper/Constants.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.herlper; 2 | 3 | public class Constants { 4 | 5 | // time out for no movements during swipe action 6 | public static final int RETURN_DURATION = 200; 7 | 8 | // time out for showing refresh complete 9 | public static final int REFRESH_COMPLETE_DURATION = 200; 10 | 11 | // Duration of the animation from the top of the content view to parent top 12 | public static final int RETURN_TO_TOP_DURATION = 200; 13 | 14 | // Duration of the animation from the top of the content view to the height of header 15 | public static final int RETURN_TO_HEADER_DURATION = 200; 16 | 17 | // maximum swipe distance( percent of parent container) 18 | public static final float MAX_SWIPE_DISTANCE_FACTOR = .3f; 19 | 20 | // swipe distance to trigger refreshing 21 | public static final int SWIPE_REFRESH_TRIGGER_DISTANCE = 100; 22 | 23 | // swipe resistance factor 24 | public static final float RESISTANCE_FACTOR = .4f; 25 | } 26 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'com.github.dcendents.android-maven' 4 | 5 | group='com.github.hlab' 6 | android { 7 | compileSdkVersion 29 8 | 9 | defaultConfig { 10 | minSdkVersion 21 11 | targetSdkVersion 29 12 | versionCode 2 13 | versionName "1.0.2" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | android { 23 | lintOptions { 24 | abortOnError false 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation 'androidx.appcompat:appcompat:1.2.0' 32 | implementation "androidx.core:core-ktx:+" 33 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 34 | } 35 | 36 | 37 | ext { 38 | PUBLISH_GROUP_ID = 'com.hlab.animatedPullToRefresh' 39 | PUBLISH_ARTIFACT_ID = 'animated-pull-to-refresh-layout' 40 | PUBLISH_VERSION = '1.0.2' 41 | } 42 | repositories { 43 | mavenCentral() 44 | } 45 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 29 6 | 7 | defaultConfig { 8 | applicationId "com.hlabexamples.AnimatedPullToRefresh" 9 | minSdkVersion 21 10 | targetSdkVersion 29 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 | dataBinding{ 21 | enabled = true 22 | } 23 | android { 24 | lintOptions { 25 | abortOnError false 26 | } 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | } 33 | 34 | dependencies { 35 | implementation fileTree(include: ['*.jar'], dir: 'libs') 36 | implementation 'com.google.android.material:material:1.2.0' 37 | implementation 'com.github.HarinTrivedi:FABRevealMenu-master:2.0.0' 38 | implementation project(':AnimatedPullToRefreshLib') 39 | implementation "androidx.core:core-ktx:+" 40 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 41 | } 42 | repositories { 43 | mavenCentral() 44 | } 45 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/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 | -------------------------------------------------------------------------------- /app/src/main/java/com/hlabexamples/animatedpulltorefresh/ListAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.hlabexamples.animatedpulltorefresh 2 | 3 | import android.content.Context 4 | import android.graphics.Color 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import android.widget.TextView 9 | import androidx.recyclerview.widget.RecyclerView 10 | import java.util.* 11 | 12 | /** 13 | * Created in Android_animated_pull_to_refresh_control-master on 23/03/17. 14 | */ 15 | class ItemListAdapter(private val context: Context) : RecyclerView.Adapter() { 16 | private var items: MutableList = ArrayList() 17 | private var inflater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater 18 | 19 | init { 20 | for (i in 0..19) { 21 | items.add("List Item " + (i + 1)) 22 | } 23 | } 24 | 25 | override fun getItemCount(): Int { 26 | return items.size 27 | } 28 | 29 | class ItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { 30 | var tv: TextView? = itemView.findViewById(android.R.id.text1) as TextView 31 | } 32 | 33 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder { 34 | return ItemViewHolder(inflater.inflate(android.R.layout.simple_list_item_1, parent, false)) 35 | } 36 | 37 | override fun onBindViewHolder(holder: ItemViewHolder, position: Int) { 38 | holder.tv?.setTextColor(Color.BLACK) 39 | holder.tv?.text = items.get(position) 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 22 | 23 | 27 | 28 | 29 | 30 | 39 | 40 | 44 | 45 | 51 | 52 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /AnimatedPullToRefreshLib/src/main/java/com/hlab/animatedpulltorefresh/herlper/ViewHelper.java: -------------------------------------------------------------------------------- 1 | package com.hlab.animatedpulltorefresh.herlper; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.view.Gravity; 6 | import android.widget.LinearLayout; 7 | import android.widget.TextView; 8 | 9 | import com.hlab.animatedpulltorefresh.R; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Helper class to manage views inside Header 16 | */ 17 | 18 | public class ViewHelper { 19 | 20 | private Context context; 21 | private LinearLayout.LayoutParams tvParams, containerParams; 22 | 23 | // View Attributes 24 | private int headerTextSize; 25 | private int headerTextColor; 26 | private int headerPaddingTop; 27 | private int headerPaddingBottom; 28 | private Typeface mTitleTypeface; 29 | 30 | public ViewHelper(Context context) { 31 | this.context = context; 32 | 33 | containerParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); 34 | tvParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 35 | tvParams.setMargins(context.getResources().getDimensionPixelSize(R.dimen.headerPaddingLeft), 36 | context.getResources().getDimensionPixelSize(R.dimen.headerPaddingTop), 37 | context.getResources().getDimensionPixelSize(R.dimen.headerPaddingRight), 38 | 0); 39 | } 40 | 41 | /** 42 | * Generates parent container layout 43 | */ 44 | public LinearLayout generateContainerLayout() { 45 | LinearLayout container = new LinearLayout(context); 46 | container.setLayoutParams(containerParams); 47 | container.setGravity(Gravity.CENTER); 48 | container.setOrientation(LinearLayout.HORIZONTAL); 49 | return container; 50 | } 51 | 52 | /** 53 | * Generates character view 54 | */ 55 | private TextView generateCharacterTextView(char c) { 56 | TextView textView = new TextView(context); 57 | textView.setText(String.valueOf(c)); 58 | textView.setTextColor(headerTextColor); 59 | textView.setLayoutParams(tvParams); 60 | textView.setTextSize(headerTextSize); 61 | if (mTitleTypeface != null) 62 | textView.setTypeface(mTitleTypeface); 63 | return textView; 64 | } 65 | 66 | /** 67 | * Start adding views in parent 68 | */ 69 | public List generateCharacterViewList(String text) { 70 | if (text == null) 71 | text = ""; 72 | List characterViewList = new ArrayList<>(); 73 | 74 | for (char c : text.toCharArray()) { 75 | characterViewList.add(generateCharacterTextView(c)); 76 | } 77 | return characterViewList; 78 | } 79 | 80 | public int getHeaderTextSize() { 81 | return headerTextSize; 82 | } 83 | 84 | public void setHeaderTextSize(int headerTextSize) { 85 | this.headerTextSize = headerTextSize; 86 | } 87 | 88 | public int getHeaderTextColor() { 89 | return headerTextColor; 90 | } 91 | 92 | public void setHeaderTextColor(int headerTextColor) { 93 | this.headerTextColor = headerTextColor; 94 | } 95 | 96 | public int getHeaderPaddingTop() { 97 | return headerPaddingTop; 98 | } 99 | 100 | public void setHeaderPaddingTop(int headerPaddingTop) { 101 | tvParams.topMargin = headerPaddingTop; 102 | this.headerPaddingTop = headerPaddingTop; 103 | } 104 | 105 | public int getHeaderPaddingBottom() { 106 | return headerPaddingBottom; 107 | } 108 | 109 | public void setHeaderPaddingBottom(int headerPaddingBottom) { 110 | // tvParams.bottomMargin = headerPaddingBottom; 111 | this.headerPaddingBottom = headerPaddingBottom; 112 | } 113 | 114 | public void setHeaderTextTypeface(Typeface mTitleTypeface) { 115 | this.mTitleTypeface = mTitleTypeface; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AnimatedPullToRefresh 2 | *** 3 | An simple general purpose UI library to add pull to refresh functionality with cool header text animation, which provides different customizations which allows to change header text, animation, color animation etc. Choose combination of your choice and rock your app screen. 4 | *** 5 | 6 | ## Feature 7 | * Easy integration 8 | * Easy customisation 9 | * Allows to customise text color, background color, animations etc of your choice. 10 | *** 11 | 12 | ## Demo 13 | * Simple demo 1 14 | 15 | ![Simple demo 1](http://i.imgur.com/9VZF1p8.gif) 16 | 17 | * Simple demo 2 18 | 19 | ![Simple demo 2](http://i.imgur.com/339TOr9.gif) 20 | 21 | * Custom fonts 22 | 23 | ![Custom fonts](http://i.imgur.com/6hKRJSu.gif) 24 | 25 | * Customize animation 26 | 27 | ![Customize animation](http://i.imgur.com/TRaE2Dn.gif) 28 | 29 | * Customize animation iteration 30 | 31 | ![Customize animation iteration](http://i.imgur.com/h3pI43s.gif) 32 | 33 | 34 | *** 35 | ## How to integrate 36 | 37 | Add it in your root build.gradle at the end of repositories: 38 | 39 | ```` 40 | allprojects { 41 | repositories { 42 | ... 43 | maven { url 'https://jitpack.io' } 44 | } 45 | } 46 | ```` 47 | Step 2. Add the dependency 48 | 49 | ```` 50 | dependencies { 51 | implementation 'com.github.HarinTrivedi:AnimatedPullToRefresh-master:1.0.4' 52 | } 53 | ```` 54 | 55 | *** 56 | ## How to use 57 | _**1. Inside layout xml**_ 58 | 59 | Add namespace in layout like: 60 | 61 | xmlns:app="http://schemas.android.com/apk/res-auto" 62 | 63 | Use AnimatedPullToRefresh in xml layout like: 64 | 65 | // new font support 79 | 80 | 81 | 82 | 83 | 84 | **Attributes** 85 | 86 | * headerText : Text to display in header 87 | * animationSpeed : Slow / Fast 88 | * headerBackgroundColor : Background color of the header view 89 | * headerLoopAnimation : zoom / fade 90 | * headerTextAnimation : rotateCW(clockwise) / rotateACW(anti-clockwise) / fade / zoom 91 | * headerTextColor : Color of the text inside the header 92 | * headerTextFontPath : Custom font path from assets 93 | 94 | * headerTextColorAnimationEnabled : To enable / disable color changing animation of text 95 | * headerTextAnimIteration : No of iteration to perform on single character animation (default 1) 96 | * headerLoopAnimIteration : No of iteration to perform on whole text animation (default11) 97 | * headerTextFontFamily: Custom font family from font resource // New feature 98 | 99 | _**2. Inside Activity/Fragment**_ 100 | 101 | ```` 102 | ... implements AnimatedPullToRefreshLayout.OnRefreshListener { 103 | ... 104 | AnimatedPullToRefreshLayout mPullToRefreshLayout = (AnimatedPullToRefreshLayout) findViewById(R.id.pullToRefreshLayout); 105 | // Provide array of colors to add color animation of your choice 106 | mPullToRefreshLayout.setColorAnimationArray(new int[]{Color.CYAN, Color.RED, Color.YELLOW, Color.MAGENTA}); 107 | // Set refresh listener 108 | mPullToRefreshLayout.setOnRefreshListener(this); 109 | ... 110 | } 111 | 112 | ```` 113 | 114 | ## More is coming, Enjoy and post issues/suggestion if you love to use this 👍 115 | 116 | *** 117 | 118 | ## LICENSE 119 | ```` 120 | Copyright 2020 Harry's Lab 121 | 122 | Licensed under the Apache License, Version 2.0 (the "License"); 123 | you may not use this file except in compliance with the License. 124 | You may obtain a copy of the License at 125 | 126 | http://www.apache.org/licenses/LICENSE-2.0 127 | 128 | Unless required by applicable law or agreed to in writing, software 129 | distributed under the License is distributed on an "AS IS" BASIS, 130 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131 | See the License for the specific language governing permissions and 132 | limitations under the License. 133 | ```` 134 | -------------------------------------------------------------------------------- /app/src/main/java/com/hlabexamples/animatedpulltorefresh/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.hlabexamples.animatedpulltorefresh 2 | 3 | import android.graphics.Color 4 | import android.os.Bundle 5 | import android.os.Handler 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.inputmethod.InputMethodManager 9 | import androidx.appcompat.app.AppCompatActivity 10 | import androidx.core.content.ContextCompat 11 | import androidx.databinding.DataBindingUtil 12 | import androidx.recyclerview.widget.LinearLayoutManager 13 | import androidx.recyclerview.widget.RecyclerView 14 | import com.google.android.material.floatingactionbutton.FloatingActionButton 15 | import com.hlab.animatedpulltorefresh.AnimatedPullToRefreshLayout 16 | import com.hlab.animatedpulltorefresh.AnimatedPullToRefreshLayout.OnRefreshListener 17 | import com.hlab.animatedpulltorefresh.enums.HeaderAnimSpeed 18 | import com.hlab.animatedpulltorefresh.enums.HeaderLoopAnim 19 | import com.hlab.animatedpulltorefresh.enums.HeaderTextAnim 20 | import com.hlab.fabrevealmenu.view.FABRevealMenu 21 | import com.hlabexamples.animatedpulltorefresh.databinding.LayoutOptionsBinding 22 | 23 | class MainActivity : AppCompatActivity(), OnRefreshListener { 24 | private lateinit var fabMenu: FABRevealMenu 25 | private lateinit var mPullToRefreshLayout: AnimatedPullToRefreshLayout 26 | private lateinit var menuBinding: LayoutOptionsBinding 27 | 28 | override fun onCreate(savedInstanceState: Bundle?) { 29 | super.onCreate(savedInstanceState) 30 | setContentView(R.layout.activity_main) 31 | val recyclerView = findViewById(R.id.recyclerView) 32 | recyclerView.layoutManager = LinearLayoutManager(this) 33 | recyclerView.adapter = ItemListAdapter(this) 34 | mPullToRefreshLayout = findViewById(R.id.pullToRefreshLayout) 35 | mPullToRefreshLayout.setColorAnimationArray(intArrayOf(Color.CYAN, Color.RED, Color.YELLOW, Color.MAGENTA)) 36 | mPullToRefreshLayout.setOnRefreshListener(this) 37 | 38 | /* 39 | For FABRevealMenu checkout here: 40 | https://github.com/HarinTrivedi/FABRevealMenu-master 41 | */ 42 | val fab = findViewById(R.id.fab) 43 | fabMenu = findViewById(R.id.fabMenu) 44 | fabMenu.bindAnchorView(fab) 45 | fabMenu.customView = addCustomView() 46 | } 47 | 48 | private fun addCustomView(): View { 49 | menuBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.layout_options, findViewById(R.id.parent), false) 50 | menuBinding.btnApply.setOnClickListener { 51 | configurePullToRefreshView() 52 | hideKeyboard() 53 | fabMenu.closeMenu() 54 | } 55 | return menuBinding.root 56 | } 57 | 58 | override fun onRefresh() { 59 | //todo: do something here when it starts to refresh 60 | Handler().postDelayed({ mPullToRefreshLayout.refreshComplete() }, 6000) 61 | } 62 | 63 | private fun configurePullToRefreshView() { 64 | mPullToRefreshLayout.setHeaderTextAnimIteration(menuBinding.spTextAnimIt.selectedItemPosition + 1) 65 | mPullToRefreshLayout.setHeaderLoopAnimIteration(menuBinding.spLoopAnimIt.selectedItemPosition + 1) 66 | when (menuBinding.spSpeed.selectedItemPosition) { 67 | 0 -> mPullToRefreshLayout.setAnimationSpeed(HeaderAnimSpeed.FAST) 68 | 1 -> mPullToRefreshLayout.setAnimationSpeed(HeaderAnimSpeed.SLOW) 69 | } 70 | when (menuBinding.spTextAnim.selectedItemPosition) { 71 | 0 -> mPullToRefreshLayout.setHeaderTextAnim(HeaderTextAnim.ROTATE_CW) 72 | 1 -> mPullToRefreshLayout.setHeaderTextAnim(HeaderTextAnim.ROTATE_ACW) 73 | 2 -> mPullToRefreshLayout.setHeaderTextAnim(HeaderTextAnim.FADE) 74 | 3 -> mPullToRefreshLayout.setHeaderTextAnim(HeaderTextAnim.ZOOM) 75 | } 76 | when (menuBinding.spLoopAnim.selectedItemPosition) { 77 | 0 -> mPullToRefreshLayout.setHeaderLoopAnim(HeaderLoopAnim.ZOOM) 78 | 1 -> mPullToRefreshLayout.setHeaderLoopAnim(HeaderLoopAnim.FADE) 79 | } 80 | mPullToRefreshLayout.setColorAnimEnable(menuBinding.swEnable.isChecked) 81 | if (menuBinding.rbLight.isChecked) { 82 | mPullToRefreshLayout.setHeaderBackgroundColor(ContextCompat.getColor(this, R.color.colorWhite)) 83 | mPullToRefreshLayout.setHeaderTextColor(ContextCompat.getColor(this, R.color.colorLabelDark)) 84 | } else if (menuBinding.rbDark.isChecked) { 85 | mPullToRefreshLayout.setHeaderBackgroundColor(ContextCompat.getColor(this, R.color.colorPrimaryDark)) 86 | mPullToRefreshLayout.setHeaderTextColor(ContextCompat.getColor(this, R.color.colorLabelLight)) 87 | } 88 | mPullToRefreshLayout.setHeaderText(menuBinding.edtLabel.text.toString()) 89 | } 90 | 91 | override fun onBackPressed() { 92 | if (fabMenu.isShowing) { 93 | fabMenu.closeMenu() 94 | } else { 95 | super.onBackPressed() 96 | } 97 | } 98 | 99 | private fun hideKeyboard() { 100 | val view = this.currentFocus 101 | if (view != null) { 102 | val imm = (getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager) 103 | imm.hideSoftInputFromWindow(view.windowToken, 0) 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_options.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 18 | 19 | 22 | 23 | 29 | 30 | 31 | 32 | 37 | 38 | 42 | 43 | 50 | 51 | 57 | 58 | 59 | 64 | 65 | 71 | 72 | 77 | 78 | 84 | 85 | 90 | 91 | 97 | 98 | 103 | 104 | 110 | 111 | 116 | 117 | 123 | 124 | 132 | 133 |