diff --git a/res/layout/foldable_linearlayout.xml b/res/layout/foldable_linearlayout.xml index 0f67ce49e..3d893a7ce 100644 --- a/res/layout/foldable_linearlayout.xml +++ b/res/layout/foldable_linearlayout.xml @@ -33,6 +33,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:visibility="gone" /> + android:visibility="invisible" /> \ No newline at end of file diff --git a/src/com/fsck/k9/view/FoldableLinearLayout.java b/src/com/fsck/k9/view/FoldableLinearLayout.java index 8b426cf7d..630a97201 100644 --- a/src/com/fsck/k9/view/FoldableLinearLayout.java +++ b/src/com/fsck/k9/view/FoldableLinearLayout.java @@ -208,9 +208,14 @@ public class FoldableLinearLayout extends LinearLayout { @Override public void onAnimationEnd(Animation animation) { - // making sure that at the end the container is - // completely removed from view - mFoldableContainer.setVisibility(View.GONE); + /* + * Make sure that at the end the container is + * completely invisible. GONE is not used in + * order to prevent parent views from jumping + * around as they re-center themselves + * vertically. + */ + mFoldableContainer.setVisibility(View.INVISIBLE); } @Override @@ -219,7 +224,7 @@ public class FoldableLinearLayout extends LinearLayout { }); mFoldableContainer.startAnimation(animation); } else { - mFoldableContainer.setVisibility(View.GONE); + mFoldableContainer.setVisibility(View.INVISIBLE); } mFoldableTextView.setText(mFoldedLabel); } else {