DO NOT MERGE Disable predictive animations in RecyclerView demo

Change-Id: I3b8ea3896866e389ccae2db32b1828194b8acf25
This commit is contained in:
Yigit Boyar
2014-06-11 16:39:31 -07:00
parent 2d719d6c71
commit 365d701866

View File

@@ -194,18 +194,18 @@ public class AnimatedRecyclerView extends Activity {
View v = recycler.getViewForPosition(mFirstPosition + i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) v.getLayoutParams();
if (!mPredictiveAnimationsEnabled || !params.isItemRemoved()) {
if (!state.isPreLayout() || !params.isItemRemoved()) {
addView(v);
}
measureChild(v, 0, 0);
bottom = top + v.getMeasuredHeight();
v.layout(left, top, right, bottom);
if (mPredictiveAnimationsEnabled && params.isItemRemoved()) {
if (state.isPreLayout() && params.isItemRemoved()) {
parentBottom += v.getHeight();
}
}
if (mAnimationsEnabled && mPredictiveAnimationsEnabled) {
if (mAnimationsEnabled && state.isPreLayout()) {
// Now that we've run a full layout, figure out which views were not used
// (cached in previousViews). For each of these views, position it where
// it would go, according to its position relative to the visible