Fix animation when expand conditional notices in Settings.

Bug: 28017593
Change-Id: I8275cb2050f79d26e58c02ffd91cb1a3e32a5ff2
This commit is contained in:
Fan Zhang
2016-04-05 13:21:52 -07:00
parent 9a8f009880
commit 905002a01d

View File

@@ -106,7 +106,7 @@ public class ConditionAdapterUtils {
private static void animateChange(final View view, final View content, private static void animateChange(final View view, final View content,
final View detailGroup, final boolean visible) { final View detailGroup, final boolean visible) {
final int beforeBottom = view.getBottom(); final int beforeBottom = content.getBottom();
setHeight(detailGroup, visible ? LayoutParams.WRAP_CONTENT : 0); setHeight(detailGroup, visible ? LayoutParams.WRAP_CONTENT : 0);
detailGroup.setVisibility(View.VISIBLE); detailGroup.setVisibility(View.VISIBLE);
view.addOnLayoutChangeListener(new OnLayoutChangeListener() { view.addOnLayoutChangeListener(new OnLayoutChangeListener() {
@@ -115,7 +115,7 @@ public class ConditionAdapterUtils {
@Override @Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) { int oldLeft, int oldTop, int oldRight, int oldBottom) {
final int afterBottom = v.getBottom(); final int afterBottom = content.getBottom();
v.removeOnLayoutChangeListener(this); v.removeOnLayoutChangeListener(this);
final ObjectAnimator animator = ObjectAnimator.ofInt(content, "bottom", final ObjectAnimator animator = ObjectAnimator.ofInt(content, "bottom",
beforeBottom, afterBottom); beforeBottom, afterBottom);