Skip to content

Commit a4815b0

Browse files
cketchamdsn5ft
authored andcommitted
Update BottomAppBar and DrawerLayout to use AttachedBehavior
PiperOrigin-RevId: 193524022
1 parent fcbc5b5 commit a4815b0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/java/com/google/android/material/bottomappbar/BottomAppBar.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.google.android.material.shape.MaterialShapeDrawable;
4444
import com.google.android.material.shape.ShapePathModel;
4545
import android.support.design.widget.CoordinatorLayout;
46+
import android.support.design.widget.CoordinatorLayout.AttachedBehavior;
4647
import android.support.v4.graphics.drawable.DrawableCompat;
4748
import android.support.v4.view.AbsSavedState;
4849
import android.support.v4.view.ViewCompat;
@@ -80,8 +81,7 @@
8081
* @attr ref com.google.android.material.bottomappbar.R.styleable#BottomAppBar_fabCradleVerticalOffset
8182
*
8283
*/
83-
@CoordinatorLayout.DefaultBehavior(BottomAppBar.Behavior.class)
84-
public class BottomAppBar extends Toolbar {
84+
public class BottomAppBar extends Toolbar implements AttachedBehavior {
8585
private static final long ANIMATION_DURATION = 300;
8686

8787
public static final int FAB_ALIGNMENT_MODE_CENTER = 0;
@@ -627,6 +627,12 @@ public void setSubtitle(CharSequence subtitle) {
627627
// Don't do anything. BottomAppBar can't have a subtitle.
628628
}
629629

630+
@NonNull
631+
@Override
632+
public CoordinatorLayout.Behavior<BottomAppBar> getBehavior() {
633+
return new Behavior();
634+
}
635+
630636
/**
631637
* Behavior designed for use with {@link BottomAppBar} instances. Its main function is to link a
632638
* dependent {@link FloatingActionButton} so that it can be shown docked in the cradle.

0 commit comments

Comments
 (0)