From 365d701866d21d82df56342148eea341f4feab71 Mon Sep 17 00:00:00 2001 From: Yigit Boyar Date: Wed, 11 Jun 2014 16:39:31 -0700 Subject: [PATCH] DO NOT MERGE Disable predictive animations in RecyclerView demo Change-Id: I3b8ea3896866e389ccae2db32b1828194b8acf25 --- .../android/supportv7/widget/AnimatedRecyclerView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java index 6d8f7203c..38a869575 100644 --- a/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java +++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java @@ -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