Skip to content

Commit

Permalink
Added overscrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed May 8, 2017
1 parent 5414cd2 commit 26711e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions hypercube/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1445
versionName "1.4.45"
versionCode 1446
versionName "1.4.46"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public void onResult(Promise<List<HeaderOrItem<T>>> promise) {
return;

allItems = a;
lastVisiblePosition = -1;
notifyDataSetChanged();
}
});
Expand Down Expand Up @@ -297,6 +298,8 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType
return createViewHolder(inflater, parent, viewType);
}

private int lastVisiblePosition = 0;

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
HeaderOrItem<T> item = allItems.get(position);
Expand All @@ -305,6 +308,23 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
return;
}
onBind((VH) holder, item.item);


if(position == allItems.size() - 1){
if(lastVisiblePosition != position){
lastVisiblePosition = position;
HyperCubeApplication.current.post(new Runnable() {
@Override
public void run() {
onOverScrolled();
}
});
}
}
}

protected void onOverScrolled() {

}

protected void onBind(VH holder, T item) {
Expand Down

0 comments on commit 26711e1

Please sign in to comment.