mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -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_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone" />
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user