diff options
author | Marcus Hagerott <mhagerott@google.com> | 2016-09-28 11:17:22 -0700 |
---|---|---|
committer | Marcus Hagerott <mhagerott@google.com> | 2016-09-28 11:17:22 -0700 |
commit | 9702063aa4e5f6bba57d7fd035251476bf57bf5b (patch) | |
tree | e0a28d6b7ece6139cf4c81e3cfffa01e28e6b417 /src/com/android/contacts/widget | |
parent | 88f28955764868cfc7d562d88553cb832b8f40f6 (diff) | |
download | Contacts-9702063aa4e5f6bba57d7fd035251476bf57bf5b.tar.gz |
Remove FloatingActionButtonBehavior
This depends on an internal support library class that is being changed.
Test
manual: deleted a group and verified that FAB does not overlap snackbar
Change-Id: Id4b0fb858624c598353b6ed6dacc8cc8a84309cd
Diffstat (limited to 'src/com/android/contacts/widget')
-rw-r--r-- | src/com/android/contacts/widget/FloatingActionButtonBehavior.java | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/com/android/contacts/widget/FloatingActionButtonBehavior.java b/src/com/android/contacts/widget/FloatingActionButtonBehavior.java deleted file mode 100644 index 44ca81e84..000000000 --- a/src/com/android/contacts/widget/FloatingActionButtonBehavior.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.contacts.widget; - -import android.content.Context; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.Snackbar.SnackbarLayout; -import android.util.AttributeSet; -import android.view.View; -import android.widget.FrameLayout; - -/** - * Implements custom behavior for the movement of the FAB in response to the Snackbar. - * Because we are not using the design framework FloatingActionButton widget, we need to manually - * implement the Material Design behavior of having the FAB translate upward and downward with - * the appearance and disappearance of a Snackbar. - */ -public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<FrameLayout> { - - public FloatingActionButtonBehavior() { - } - - public FloatingActionButtonBehavior(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public boolean layoutDependsOn(CoordinatorLayout parent, FrameLayout child, View dependency) { - return dependency instanceof SnackbarLayout; - } - - @Override - public boolean onDependentViewChanged(CoordinatorLayout parent, FrameLayout child, - View dependency) { - float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); - child.setTranslationY(translationY); - return true; - } -} |