mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Fix FloatingActionButton with nested anchors
am: c010d657a2 Change-Id: I1207b1e5c6cff1716f68aeb83925e3024782172a GitOrigin-RevId=3c2f33358e275fadb3a8012f71b620233876b4ca PiperOrigin-RevId: 140564491
This commit is contained in:
parent
a7b5da56b2
commit
19a237dc74
@ -41,6 +41,7 @@ import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@ -604,10 +605,13 @@ public class FloatingActionButton extends VisibilityAwareImageButton {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isBottomSheet(View view) {
|
||||
CoordinatorLayout.LayoutParams lp =
|
||||
(CoordinatorLayout.LayoutParams) view.getLayoutParams();
|
||||
return lp != null && lp.getBehavior() instanceof BottomSheetBehavior;
|
||||
private static boolean isBottomSheet(@NonNull View view) {
|
||||
final ViewGroup.LayoutParams lp = view.getLayoutParams();
|
||||
if (lp instanceof CoordinatorLayout.LayoutParams) {
|
||||
return ((CoordinatorLayout.LayoutParams) lp)
|
||||
.getBehavior() instanceof BottomSheetBehavior;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user