diff --git a/app/src/main/java/eu/faircode/email/BehaviorBottomMargin.java b/app/src/main/java/eu/faircode/email/BehaviorBottomMargin.java index 42648cc691..fc45128684 100644 --- a/app/src/main/java/eu/faircode/email/BehaviorBottomMargin.java +++ b/app/src/main/java/eu/faircode/email/BehaviorBottomMargin.java @@ -44,7 +44,7 @@ public class BehaviorBottomMargin extends CoordinatorLayout.Behavior { @Override public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) { - setMargin(child, dependency.getHeight()); + setMargin(child, dependency.isAttachedToWindow() ? dependency.getHeight() : 0); return true; } diff --git a/app/src/main/java/eu/faircode/email/BehaviorBottomPadding.java b/app/src/main/java/eu/faircode/email/BehaviorBottomPadding.java index dd68ea5a6a..53fdadea76 100644 --- a/app/src/main/java/eu/faircode/email/BehaviorBottomPadding.java +++ b/app/src/main/java/eu/faircode/email/BehaviorBottomPadding.java @@ -44,7 +44,7 @@ public class BehaviorBottomPadding extends CoordinatorLayout.Behavior { @Override public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) { - setPadding(child, dependency.getHeight()); + setPadding(child, dependency.isAttachedToWindow() ? dependency.getHeight() : 0); return true; }