Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
longerian committed Jan 17, 2018
2 parents f10cff2 + 1ced8a8 commit 1299e8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import com.alibaba.android.vlayout.LayoutManagerHelper;
import com.alibaba.android.vlayout.OrientationHelperEx;
import com.alibaba.android.vlayout.VirtualLayoutManager;
import com.alibaba.android.vlayout.VirtualLayoutManager.AnchorInfoWrapper;
import com.alibaba.android.vlayout.VirtualLayoutManager.LayoutParams;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.State;
import android.util.Log;
import android.view.View;

Expand All @@ -47,6 +49,8 @@ public class LinearLayoutHelper extends BaseLayoutHelper {

private int mDividerHeight = 0;

private boolean mLayoutWithAnchor = false;

public LinearLayoutHelper() {
this(0);
}
Expand Down Expand Up @@ -113,8 +117,9 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state

if (!isStartLine) {
if (!isOverLapMargin) {
gap = mDividerHeight;
gap = mLayoutWithAnchor ? 0 : mDividerHeight;
} else {
//TODO check layout with anchor
if (isLayoutEnd) {
int marginTop = params.topMargin;
View sibling = helper.findViewByPosition(currentPosition - 1);
Expand Down Expand Up @@ -209,6 +214,13 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state
}

handleStateOnResult(result, view);
mLayoutWithAnchor = false;
}

@Override
public void checkAnchorInfo(State state, AnchorInfoWrapper anchorInfo, LayoutManagerHelper helper) {
super.checkAnchorInfo(state, anchorInfo, helper);
mLayoutWithAnchor = true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.LayoutParams;
import android.util.Log;
Expand Down Expand Up @@ -1189,7 +1188,6 @@ void cacheReferenceLineAndClear(boolean reverseLayout, int offset, OrientationHe
}

void clear() {
Log.d("Longer", "clear span");
mViews.clear();
invalidateCache();
mDeletedSize = 0;
Expand Down

0 comments on commit 1299e8f

Please sign in to comment.