Translate FAB up and down when Snackbar appears and disappears.
This is implements custom behavior according the Material Design spec
that the Snackbar cannot obscure the FAB. Converts the dialtacts
activity layout to a CoordinatorLayout and attaches the
FloatingActionButtonBehavior to the FAB.
Bug: 23687913
Change-Id: Ic4d0493db415bb97cf7e21de4f23a02df9f753b1
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 4ade04a..6d8ed61 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -30,6 +30,7 @@
import android.os.Trace;
import android.provider.CallLog.Calls;
import android.speech.RecognizerIntent;
+import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.telecom.PhoneAccount;
@@ -52,7 +53,6 @@
import android.view.animation.AnimationUtils;
import android.widget.AbsListView.OnScrollListener;
import android.widget.EditText;
-import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.PopupMenu;
import android.widget.TextView;
@@ -143,7 +143,7 @@
private static final int FAB_SCALE_IN_DELAY_MS = 300;
- private FrameLayout mParentLayout;
+ private CoordinatorLayout mParentLayout;
/**
* Fragment containing the dialpad that slides into view
@@ -468,7 +468,7 @@
mSlideIn.setAnimationListener(mSlideInListener);
mSlideOut.setAnimationListener(mSlideOutListener);
- mParentLayout = (FrameLayout) findViewById(R.id.dialtacts_mainlayout);
+ mParentLayout = (CoordinatorLayout) findViewById(R.id.dialtacts_mainlayout);
mParentLayout.setOnDragListener(new LayoutOnDragListener());
floatingActionButtonContainer.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {