Skip to content

Commit

Permalink
[BottomAppBar] Request layout for FAB when BAB changes so that FAB wi…
Browse files Browse the repository at this point in the history
…ll always be aware of BAB changes

PiperOrigin-RevId: 492023349
(cherry picked from commit 4bdfb8b)
  • Loading branch information
imhappi authored and dsn5ft committed Dec 9, 2022
1 parent 83e045e commit 10fe695
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1188,6 +1188,12 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) {
cancelAnimations();

setCutoutStateAndTranslateFab();
// If the BAB layout has changed, we should alert the fab so that it can
// adjust its margins accordingly.
View dependentView = findDependentView();
if (dependentView != null && ViewCompat.isLaidOut(dependentView)) {
dependentView.post(() -> dependentView.requestLayout());
}
}

// Always ensure the MenuView is in the correct position after a layout.
Expand Down

0 comments on commit 10fe695

Please sign in to comment.