mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
Make the foldable container view INVISIBLE, not GONE
Now when toggling the foldable view, the screen no longer jumps half a line up or down to recenter itself when the view is displayed.
This commit is contained in:
parent
8ade424270
commit
9728609c4c
@ -33,6 +33,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -208,9 +208,14 @@ public class FoldableLinearLayout extends LinearLayout {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
// making sure that at the end the container is
|
/*
|
||||||
// completely removed from view
|
* Make sure that at the end the container is
|
||||||
mFoldableContainer.setVisibility(View.GONE);
|
* 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
|
@Override
|
||||||
@ -219,7 +224,7 @@ public class FoldableLinearLayout extends LinearLayout {
|
|||||||
});
|
});
|
||||||
mFoldableContainer.startAnimation(animation);
|
mFoldableContainer.startAnimation(animation);
|
||||||
} else {
|
} else {
|
||||||
mFoldableContainer.setVisibility(View.GONE);
|
mFoldableContainer.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
mFoldableTextView.setText(mFoldedLabel);
|
mFoldableTextView.setText(mFoldedLabel);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user