Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior {
- public ScrollAwareFABBehavior() {
- super();
- }
- public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- @Override
- public boolean getInsetDodgeRect(@NonNull CoordinatorLayout parent,
- @NonNull FloatingActionButton child,
- @NonNull Rect rect) {
- super.getInsetDodgeRect(parent, child, rect);
- if (!rect.intersect(child.getLeft(), child.getTop(),
- child.getRight(), child.getBottom())) {
- if (!BuildConfig.DEBUG) {
- Exception e = new IllegalArgumentException("Rect should intersect with child's bounds.");
- Crashlytics.logException(e);
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement