Skip to content

Commit 60f091d

Browse files
author
TuringTechnologies
committed
Version 10.1.3
- Fixes #61 - Fixes #51
1 parent a0b7b45 commit 60f091d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.github.dcendents.android-maven'
33
apply plugin: 'com.jfrog.bintray'
44

5-
def version = '10.1.1'
5+
def version = '10.1.3'
66

77
install {
88
repositories.mavenInstaller {

lib/src/main/java/com/turingtechnologies/materialscrollbar/ScrollingUtilities.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ public void getCurScrollState() {
149149
if (materialScrollBar.recyclerView.getLayoutManager() instanceof GridLayoutManager) {
150150
scrollPosState.rowIndex = scrollPosState.rowIndex / ((GridLayoutManager) materialScrollBar.recyclerView.getLayoutManager()).getSpanCount();
151151
}
152-
scrollPosState.rowTopOffset = materialScrollBar.recyclerView.getLayoutManager().getDecoratedTop(child);
153-
scrollPosState.rowHeight = child.getHeight();
152+
if(child == null){
153+
scrollPosState.rowTopOffset = 0;
154+
scrollPosState.rowHeight = 0;
155+
} else {
156+
scrollPosState.rowTopOffset = materialScrollBar.recyclerView.getLayoutManager().getDecoratedTop(child);
157+
scrollPosState.rowHeight = child.getHeight();
158+
}
154159
}
155160

156161
}

0 commit comments

Comments
 (0)