Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9287203 authored by Nancy Chen's avatar Nancy Chen Committed by Android (Google) Code Review
Browse files

Merge "Implement FloatingActionButton.Behavior method correctly." into ub-contactsdialer-b-dev

parents 662aed1d 9f5ff29a
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -34,17 +34,14 @@ public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<Fra

    @Override
    public boolean layoutDependsOn(CoordinatorLayout parent, FrameLayout child, View dependency) {
        // This needs to return true to trigger the callback correctly.
        return true;
        return dependency instanceof SnackbarLayout;
    }

    @Override
    public boolean onDependentViewChanged(CoordinatorLayout parent, FrameLayout child,
            View dependency) {
        if (dependency instanceof SnackbarLayout) {
        float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
        child.setTranslationY(translationY);
        }
        return true;
    }
}