├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── publish.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── spoqa
│ │ └── stickyscrollview
│ │ └── StickyColumnHorizontalScrollView.kt
│ └── res
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── sample
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── spoqa
│ │ └── sample
│ │ ├── adapters
│ │ └── SampleRecyclerViewAdapter.kt
│ │ ├── models
│ │ └── SampleData.kt
│ │ └── views
│ │ └── MainActivity.kt
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ ├── activity_main.xml
│ └── item_sample.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── 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
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── screenshots
├── sample1.gif
├── sample2.gif
└── sample3.gif
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.aar
4 | *.ap_
5 | *.aab
6 |
7 | # Files for the ART/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 | build/
20 |
21 | # Local configuration file (sdk path, etc)
22 | local.properties
23 |
24 | # IntelliJ
25 | *.iml
26 | .idea/
27 |
28 | # lint
29 | lint/intermediates/
30 | lint/generated/
31 | lint/outputs/
32 | lint/tmp/
33 |
34 | # OSX
35 | .DS_Store
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Spoqa
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # StickyScrollView
2 |
3 | [![Platform][PlatformBadge]][ProjectGithubUrl]
4 | [![Download][DownloadBadge]][DownloadUrl]
5 |
6 | StickyScrollView is a scroll view in which columns or rows(TBD) are fixed.
7 |
8 | We are planning to add more kinds of scroll views.
9 |
10 | ## StickyColumnHorizontalScrollView
11 |
12 | StickyColumnHorizontalScrollView is a horizontal scroll view that sticks the first column in the recyclerView.
13 |
14 | The sticky column is fixed to the left and you can make the width of the sticky column appear to be adjusted when scrolling. Of course, you can fix the width of the column. It also supports when the header is outside the recyclerView.
15 |
16 | ### Screenshots
17 |
18 |
19 |
20 | ### How to use
21 |
22 | For more details, please see the [bintray](https://bintray.com/beta/#/spoqa/maven/StickyScrollView?tab=overview).
23 |
24 | Add the following gradle dependency.
25 |
26 | ```groovy
27 | dependencies {
28 | implementation 'com.spoqa.stickyscrollview:StickyScrollView:1.0.1'
29 | }
30 | ```
31 |
32 | ### Usage
33 |
34 | For more details, please see the [sample code](StickyScrollView/sample).
35 |
36 | #### Warning
37 |
38 | The sticky column must be a below format to work as intended. 😢
39 |
40 | ```xml
41 |
42 |
43 |
44 |
45 | ```
46 |
47 | #### Usage 1
48 |
49 | The width of the sticky column is not adjusted as you scroll.
50 |
51 | ```xml
52 |
57 |
58 |
63 |
64 |
65 | ```
66 |
67 | ```kotlin
68 | override fun onCreate(savedInstanceState: Bundle?) {
69 | ...
70 | main_scrollView.run {
71 | recyclerView = main_recyclerView
72 | }
73 | }
74 | ```
75 |
76 | #### Usage 2
77 |
78 | The width of the sticky column is adjusted as you scroll.
79 |
80 | ```kotlin
81 | override fun onCreate(savedInstanceState: Bundle?) {
82 | ...
83 | main_scrollView.run {
84 | recyclerView = main_recyclerView
85 | minWidthOfStickyColumn = (100 * context.resources.displayMetrics.density).toInt()
86 | }
87 | }
88 | ```
89 |
90 | #### Usage 3
91 |
92 | The header is outside the Recycleview.
93 |
94 | ```xml
95 |
100 |
101 |
105 |
106 |
110 |
111 |
116 |
117 |
121 |
122 |
123 |
124 |
128 |
129 |
130 |
131 |
132 |
133 |
138 |
139 |
140 | ```
141 |
142 | ```kotlin
143 | override fun onCreate(savedInstanceState: Bundle?) {
144 | ...
145 | main_scrollView.run {
146 | stickyHeaderColumn = main_stickyHeaderColumnLayout
147 | recyclerView = main_recyclerView
148 | minWidthOfStickyColumn = (100 * context.resources.displayMetrics.density).toInt()
149 | }
150 | }
151 | ```
152 |
153 | ## License
154 |
155 | For more details, please see the [LICENSE](StickyScrollView/LICENSE).
156 |
157 | ```
158 | Copyright 2020 Spoqa
159 | Permission is hereby granted, free of charge, to any person obtaining a copy
160 | of this software and associated documentation files (the "Software"), to deal
161 | in the Software without restriction, including without limitation the rights
162 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
163 | copies of the Software, and to permit persons to whom the Software is
164 | furnished to do so, subject to the following conditions:
165 | The above copyright notice and this permission notice shall be included in all
166 | copies or substantial portions of the Software.
167 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
168 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
169 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
170 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
171 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
172 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
173 | SOFTWARE.
174 | ```
175 |
176 | [PlatformBadge]: https://img.shields.io/badge/Platform-Android-blue.svg
177 | [ProjectGithubUrl]: https://github.com/spoqa/StickyScrollView
178 | [DownloadBadge]: https://api.bintray.com/packages/spoqa/maven/StickyScrollView/images/download.svg?version=1.0.1
179 | [DownloadUrl]: https://bintray.com/spoqa/maven/StickyScrollView/1.0.1/link
180 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.jfrog.bintray'
2 | apply plugin: 'maven-publish'
3 |
4 | buildscript {
5 | ext.kotlin_version = "1.3.72"
6 | repositories {
7 | google()
8 | jcenter()
9 | }
10 | dependencies {
11 | classpath "com.android.tools.build:gradle:4.0.1"
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | // Do not update before
14 | // https://github.com/bintray/gradle-bintray-plugin/issues/267 is resolved.
15 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.3'
16 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | jcenter()
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Sep 02 13:24:13 KST 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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply from: 'publish.gradle'
5 |
6 | android {
7 | compileSdkVersion 29
8 |
9 | defaultConfig {
10 | minSdkVersion 21
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName this.version
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: "libs", include: ["*.jar"])
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
29 | implementation 'androidx.core:core-ktx:1.3.1'
30 | implementation 'androidx.appcompat:appcompat:1.2.0'
31 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
32 | }
33 |
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/library/publish.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.jfrog.bintray'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 |
4 | group 'com.spoqa.stickyscrollview'
5 | version '1.0.1'
6 |
7 | ext {
8 | bintrayRepo = 'maven'
9 | bintrayName = 'StickyScrollView'
10 | organization = 'spoqa'
11 |
12 | // Library Details
13 | publishedGroupId = this.group
14 | libraryName = 'StickyScrollView'
15 | artifact = 'StickyScrollView'
16 | libraryDescription = 'StickyScrollView is a scroll view in which columns are fixed.'
17 | libraryVersion = this.version
18 |
19 | // Repository Link (For e.g. GitHub repo)
20 | siteUrl = 'https://github.com/spoqa/StickyScrollView'
21 | gitUrl = 'https://github.com/spoqa/StickyScrollView.git'
22 | issueTrackerUrl = 'https://github.com/spoqa/StickyScrollView/issues'
23 | githubRepository= 'spoqa/StickyScrollView'
24 |
25 | // Developer details
26 | developerId = 'kimdoori'
27 | developerName = 'Doori Kim'
28 | developerEmail = 'dev@spoqa.com'
29 |
30 | // License information
31 | licenseName = 'The MIT License (MIT)'
32 | licenseUrl = 'https://opensource.org/licenses/MIT'
33 | allLicenses = ["MIT"]
34 | }
35 |
36 | group = publishedGroupId
37 |
38 | install {
39 | repositories.mavenInstaller {
40 | // This generates POM.xml with proper parameters
41 | pom {
42 | project {
43 | packaging 'aar'
44 |
45 | groupId publishedGroupId
46 | artifactId = artifact
47 | name libraryName
48 | description = libraryDescription
49 | url siteUrl
50 |
51 | licenses {
52 | license {
53 | name licenseName
54 | url licenseUrl
55 | }
56 | }
57 | developers {
58 | developer {
59 | id developerId
60 | name developerName
61 | email developerEmail
62 | }
63 | }
64 | scm {
65 | connection gitUrl
66 | developerConnection gitUrl
67 | url siteUrl
68 | }
69 | }
70 | }
71 | }
72 | }
73 |
74 | // Avoid Kotlin docs error
75 | tasks.withType(Javadoc) {
76 | enabled = false
77 | }
78 |
79 | // Remove javadoc related tasks
80 | task javadoc(type: Javadoc) {
81 | // If using .kt files
82 | excludes = ['**/*.kt']
83 | source = android.sourceSets.main.java.srcDirs
84 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
85 | }
86 |
87 | task sourcesJar(type: Jar) {
88 | from android.sourceSets.main.java.srcDirs
89 | classifier = 'sources'
90 | }
91 |
92 | task javadocJar(type: Jar, dependsOn: javadoc) {
93 | classifier = 'javadoc'
94 | from javadoc.destinationDir
95 | }
96 | artifacts {
97 | archives javadocJar
98 | archives sourcesJar
99 | }
100 |
101 | // https://github.com/bintray/gradle-bintray-plugin
102 | bintray {
103 | user = System.getenv("BINTRAY_USER")
104 | key = System.getenv("BINTRAY_API_KEY")
105 |
106 | configurations = ['archives']
107 | pkg {
108 | repo = bintrayRepo
109 | name = bintrayName
110 | websiteUrl = siteUrl
111 | vcsUrl = gitUrl
112 | issueTrackerUrl = issueTrackerUrl
113 | githubRepo = githubRepository
114 | licenses = allLicenses
115 | userOrg = organization
116 | publish = true
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/library/src/main/java/com/spoqa/stickyscrollview/StickyColumnHorizontalScrollView.kt:
--------------------------------------------------------------------------------
1 | package com.spoqa.stickyscrollview
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.view.ViewTreeObserver
8 | import android.widget.HorizontalScrollView
9 | import android.widget.TextView
10 | import androidx.core.view.children
11 | import androidx.recyclerview.widget.RecyclerView
12 |
13 | open class StickyColumnHorizontalScrollView : HorizontalScrollView, ViewTreeObserver.OnGlobalLayoutListener {
14 |
15 | constructor(context: Context) : this(context, null, 0)
16 | constructor(context: Context, attr: AttributeSet?) : this(context, attr, 0)
17 | constructor(context: Context, attr: AttributeSet?, defStyleAttr: Int) : super(
18 | context,
19 | attr,
20 | defStyleAttr
21 | )
22 |
23 | /**
24 | * If you adjust the padding of the parent view(Layout),
25 | * it looks like a bounce effect when scrolling fast.
26 | * So adjust the padding directly in the child view(TextView).
27 | * To do this, set the variables for the parent view(layout) and the child view(TextView) separately.
28 | */
29 | // List of sticky column - parent view
30 | private var stickyParentViews = ArrayList()
31 | // List of sticky column - child view
32 | private var stickyChildViews = ArrayList()
33 |
34 | // Original width value of sticky column
35 | private var originalWidthOfStickyColumn = 0
36 | set(value) {
37 | if (originalWidthOfStickyColumn == 0) {
38 | field = value
39 | }
40 | }
41 |
42 | // Original paddingLeft value of sticky column
43 | private var originalPaddingLeftOfStickyColumn = 0
44 | set(value) {
45 | if (originalPaddingLeftOfStickyColumn == 0) {
46 | field = value
47 | }
48 | }
49 |
50 | /**
51 | * If the width of the sticky column is adjusted according to scrolling,
52 | * set the minWidthOfStickyColumn.
53 | */
54 | // Minimum width value of sticky column (pixel)
55 | var minWidthOfStickyColumn: Int? = null
56 |
57 | // The x position that starts to fixed during scrolling
58 | private var stickyColumnFixedX = 0
59 | get() {
60 | minWidthOfStickyColumn?.let {
61 | field = originalWidthOfStickyColumn - it
62 | }
63 | return if (field < 0) 0 else field
64 | }
65 |
66 | /**
67 | * Set the stickyHeaderColumn variable so that it can be covered even
68 | * when the header is a layout that is not included in the recycleView.
69 | *
70 | * If the header is in the RecyclerView, you do not need to assign it.
71 | */
72 | // header view to make sticky
73 | var stickyHeaderColumn: View? = null
74 | set(value) {
75 | field = value
76 | field?.translationZ = 1f
77 | }
78 |
79 | // RecyclerView with a column to make sticky
80 | var recyclerView: RecyclerView? = null
81 |
82 | /**
83 | * If stickyViewFixedX is zero (If you do not adjust sticky column's width when scrolling),
84 | * adjust the translationX of the parent views to value of the scrolled x value minus stickyViewFixedX.
85 | *
86 | * If the scroll X value is less than stickyViewFixedX,
87 | * adjust the left padding of the child views to the scrolled x value,
88 | * adjust the translationX of parent views to zero.
89 | *
90 | * If the scroll X value is same as stickyViewFixedX or higher,
91 | * adjust the left padding of the child views to stickyViewFixedX,
92 | * adjust the translationX of the parent views to value of the scrolled x value minus stickyViewFixedX.
93 | *
94 | * If you do this, without actually adjusting the width of the sticky column,
95 | * the sticky column will be fixed to the left, and as you scroll,
96 | * the sticky column's width will appear to be adjusted.
97 | * FYI: If you adjust the width of sticky column when scrolling, the scroll speed will vary.
98 | */
99 | override fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) {
100 | super.onScrollChanged(l, t, oldl, oldt)
101 | when {
102 | stickyColumnFixedX == 0 -> {
103 | stickyParentViews.map { view -> view.translationX = (l - stickyColumnFixedX).toFloat() }
104 | }
105 | l < stickyColumnFixedX -> {
106 | stickyChildViews.map { textView ->
107 | textView.setPadding(l + originalPaddingLeftOfStickyColumn, textView.paddingTop, textView.paddingRight, textView.paddingBottom)
108 | }
109 | stickyParentViews.map { view -> view.translationX = 0f }
110 | }
111 | else -> {
112 | stickyChildViews.map { textView ->
113 | textView.setPadding(stickyColumnFixedX + originalPaddingLeftOfStickyColumn, textView.paddingTop, textView.paddingRight, textView.paddingBottom)
114 | }
115 | stickyParentViews.map { view -> view.translationX = (l - stickyColumnFixedX).toFloat() }
116 | }
117 | }
118 | }
119 |
120 | override fun onAttachedToWindow() {
121 | super.onAttachedToWindow()
122 | viewTreeObserver.addOnGlobalLayoutListener(this)
123 | }
124 |
125 | override fun onDetachedFromWindow() {
126 | super.onDetachedFromWindow()
127 | viewTreeObserver.removeOnGlobalLayoutListener(this)
128 | }
129 |
130 | /**
131 | * Assign variables in onGlobalLayout to get the views you need right,
132 | * and prevent them from duplicate assignment.
133 | */
134 | override fun onGlobalLayout() {
135 | stickyHeaderColumn?.let { headerView ->
136 | if (headerView.width != 0 && originalWidthOfStickyColumn == 0) {
137 | originalWidthOfStickyColumn = headerView.width
138 | stickyParentViews.add(headerView)
139 | (headerView as ViewGroup).children.forEach { childView ->
140 | if (childView is TextView) {
141 | originalPaddingLeftOfStickyColumn = headerView.paddingLeft
142 | stickyChildViews.add(childView)
143 | }
144 | }
145 | }
146 | }
147 | val tableRowsSize = stickyParentViews.size - if (stickyHeaderColumn != null) 1 else 0
148 | if (tableRowsSize >= recyclerView?.childCount ?: 0) return
149 | recyclerView?.let { listView ->
150 | for (i in 0 until listView.childCount) {
151 | val columnView = (listView.getChildAt(i) as ViewGroup).getChildAt(0)
152 | originalWidthOfStickyColumn = columnView.width
153 | columnView.translationZ = 1f
154 | stickyParentViews.add(columnView)
155 | (columnView as ViewGroup).children.forEach { childView ->
156 | if (childView is TextView) {
157 | originalPaddingLeftOfStickyColumn = childView.paddingLeft
158 | stickyChildViews.add(childView)
159 | }
160 | }
161 | }
162 | }
163 | }
164 |
165 | override fun getLeftFadingEdgeStrength(): Float {
166 | return 0.0f
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/library/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
7 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | StickyScrollView
3 |
4 |
--------------------------------------------------------------------------------
/library/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 29
7 |
8 | defaultConfig {
9 | applicationId "com.spoqa.sample"
10 | minSdkVersion 21
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: "libs", include: ["*.jar"])
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
29 | implementation 'androidx.core:core-ktx:1.3.1'
30 | implementation 'androidx.appcompat:appcompat:1.2.0'
31 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
32 | implementation project(':library')
33 | }
34 |
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/spoqa/sample/adapters/SampleRecyclerViewAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.spoqa.sample.adapters
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.TextView
7 | import androidx.recyclerview.widget.RecyclerView
8 | import com.spoqa.sample.R
9 | import com.spoqa.sample.models.SampleData
10 | import kotlinx.android.synthetic.main.item_sample.view.*
11 | import java.text.DecimalFormat
12 |
13 | class SampleRecyclerViewAdapter(private val dataList: ArrayList) :
14 | RecyclerView.Adapter() {
15 |
16 | inner class SampleViewHolder(view: View) : RecyclerView.ViewHolder(view) {
17 | private var nameTextView: TextView = view.sample1_nameTextView
18 | private var standardTextView: TextView = view.sample1_standardTextView
19 | private var countTextView: TextView = view.sample1_countTextView
20 | private var unitTextView: TextView = view.sample1_unitTextView
21 | private var amountTextView: TextView = view.sample1_amountTextView
22 | private var totalAmountTextView: TextView = view.sample1_totalAmountTextView
23 |
24 | fun bind(item: SampleData) {
25 | nameTextView.text = item.name
26 | standardTextView.text = item.standard
27 | countTextView.text = item.count.toString()
28 | unitTextView.text = item.unit
29 | val df = DecimalFormat("#,###")
30 | amountTextView.text = df.format(item.amount)
31 | totalAmountTextView.text = df.format(item.totalAmount)
32 | }
33 | }
34 |
35 | override fun onCreateViewHolder(
36 | parent: ViewGroup, viewType: Int
37 | ): SampleViewHolder {
38 | val view = LayoutInflater.from(parent.context)
39 | .inflate(R.layout.item_sample, parent, false)
40 | return SampleViewHolder(
41 | view
42 | )
43 | }
44 |
45 | override fun onBindViewHolder(holder: SampleViewHolder, position: Int) {
46 | holder.bind(dataList[position])
47 | }
48 |
49 | override fun getItemCount() = dataList.size
50 | }
51 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/spoqa/sample/models/SampleData.kt:
--------------------------------------------------------------------------------
1 | package com.spoqa.sample.models
2 |
3 | import java.math.BigDecimal
4 |
5 | data class SampleData (
6 | val name: String,
7 | var standard: String,
8 | var count: Int,
9 | var unit: String,
10 | var amount: BigDecimal,
11 | var totalAmount: BigDecimal
12 | )
13 |
--------------------------------------------------------------------------------
/sample/src/main/java/com/spoqa/sample/views/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.spoqa.sample.views
2 |
3 | import androidx.appcompat.app.AppCompatActivity
4 | import android.os.Bundle
5 | import com.spoqa.sample.R
6 | import com.spoqa.sample.adapters.SampleRecyclerViewAdapter
7 | import com.spoqa.sample.models.SampleData
8 | import kotlinx.android.synthetic.main.activity_main.*
9 | import java.math.BigDecimal
10 |
11 | class MainActivity : AppCompatActivity() {
12 |
13 | override fun onCreate(savedInstanceState: Bundle?) {
14 | super.onCreate(savedInstanceState)
15 | setContentView(R.layout.activity_main)
16 | val sampleDataList = arrayListOf(
17 | SampleData("Lemon", "17kg", 2, "BOX", BigDecimal(80000), BigDecimal(160000)),
18 | SampleData("Grapefruit", "5kg", 1, "BOX", BigDecimal(30000), BigDecimal(30000)),
19 | SampleData("Seoul Milk", "1000ml", 5, "EA", BigDecimal(3000), BigDecimal(15000)),
20 | SampleData("Ice", "3kg", 10, "EA", BigDecimal(3500), BigDecimal(35000)),
21 | SampleData("Brown sugar", "1kg", 1, "EA", BigDecimal(2500), BigDecimal(2500))
22 | )
23 |
24 | main_recyclerView1.adapter =
25 | SampleRecyclerViewAdapter(sampleDataList)
26 | main_scrollView1.run {
27 | recyclerView = main_recyclerView1
28 | }
29 |
30 | main_recyclerView2.adapter =
31 | SampleRecyclerViewAdapter(sampleDataList)
32 | main_scrollView2.run {
33 | recyclerView = main_recyclerView2
34 | minWidthOfStickyColumn = (100 * context.resources.displayMetrics.density).toInt()
35 | }
36 |
37 | main_recyclerView3.adapter =
38 | SampleRecyclerViewAdapter(sampleDataList)
39 | main_scrollView3.run {
40 | stickyHeaderColumn = main_stickyHeaderColumnLayout
41 | recyclerView = main_recyclerView3
42 | minWidthOfStickyColumn = (100 * context.resources.displayMetrics.density).toInt()
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
31 |
--------------------------------------------------------------------------------
/sample/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
22 |
23 |
28 |
29 |
40 |
41 |
49 |
50 |
51 |
52 |
59 |
60 |
65 |
66 |
77 |
78 |
86 |
87 |
88 |
89 |
96 |
97 |
102 |
103 |
115 |
116 |
120 |
121 |
125 |
126 |
131 |
132 |
138 |
139 |
140 |
141 |
147 |
148 |
154 |
155 |
161 |
162 |
168 |
169 |
175 |
176 |
177 |
178 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/sample/src/main/res/layout/item_sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
30 |
31 |
38 |
39 |
46 |
47 |
54 |
55 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #4c80f1
4 | #2c5ae9
5 | #ffffff
6 | #f1f5f5
7 | #eaeeef
8 | #e1e4e6
9 | #ced3d6
10 |
11 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | StickyScrollViewSample
3 | Sample 1
4 | The width of the sticky column is not adjusted as you scroll.
5 | Sample 2
6 | The width of the sticky column is adjusted as you scroll.
7 | Sample 3
8 | It also works when the header is outside the recyclerView.
9 | Name
10 | Standard
11 | Count
12 | Unit
13 | Amount
14 | TotalAmount
15 |
16 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/screenshots/sample1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/screenshots/sample1.gif
--------------------------------------------------------------------------------
/screenshots/sample2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/screenshots/sample2.gif
--------------------------------------------------------------------------------
/screenshots/sample3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spoqa/StickyScrollView/1ac2f242f7c2b195c937bde408f23fa73d74b3dc/screenshots/sample3.gif
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':library'
2 | include ':sample'
3 | rootProject.name = "StickyScrollView"
4 |
--------------------------------------------------------------------------------