Skip to content
This repository was archived by the owner on Dec 1, 2017. It is now read-only.

Fixed glitching scroll offset when using image loaders #233

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
if(this == rootProject) {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
}

3 changes: 1 addition & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
buildToolsVersion "25.0.2"
resourcePrefix 'twowayview_'

defaultConfig {
Expand All @@ -19,4 +19,3 @@ android {
}
}

apply from: "${rootDir}/gradle/scripts/gradle-mvn-push.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ private View makeAndAddView(int position, Direction direction, Recycler recycler
return child;
}

private void handleUpdate() {
protected void handleUpdate() {
// Refresh state by requesting layout without changing the
// first visible position. This will ensure the layout will
// sync with the adapter changes.
Expand Down
3 changes: 1 addition & 2 deletions layouts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
buildToolsVersion "25.0.2"
resourcePrefix 'twowayview_'

defaultConfig {
Expand All @@ -20,4 +20,3 @@ dependencies {
compile 'com.android.support:recyclerview-v7:21.0.0'
}

apply from: "${rootDir}/gradle/scripts/gradle-mvn-push.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.LayoutParams;
import android.support.v7.widget.RecyclerView.Recycler;
import android.support.v7.widget.RecyclerView.State;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;

import org.lucasr.twowayview.TwoWayLayoutManager;
import org.lucasr.twowayview.widget.Lanes.LaneInfo;

Expand Down Expand Up @@ -361,6 +359,7 @@ public void onLayoutChildren(Recycler recycler, State state) {

// Only move layout if we're not restoring a layout state.
if (anchorItemPosition > 0 && (refreshingLanes || !restoringLanes)) {
handleUpdate();
moveLayoutToPosition(anchorItemPosition, getPendingScrollOffset(), recycler, state);
}

Expand Down