diff options
author | Eric Erfanian <erfanian@google.com> | 2017-03-21 10:11:17 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-03-21 10:11:17 -0700 |
commit | fc37b02f5d3381a7882770941e461b13b679b6ef (patch) | |
tree | 23ce96100a89f1cf8847a4967efd35e56b6f8092 /java/com/android/dialer/app/DialtactsActivity.java | |
parent | 30ccc4f3aa6da94f0bb8a01a880a6353b883b263 (diff) |
Update AOSP Dialer source from internal google3 repository at
cl/150756069
Test: make, treehugger
This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/150392808 (3/16/2017) to cl/150756069 (3/21/2017).
This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.
Change-Id: I0888b5db52efb28eb8194600e0c7804592f975f3
Diffstat (limited to 'java/com/android/dialer/app/DialtactsActivity.java')
-rw-r--r-- | java/com/android/dialer/app/DialtactsActivity.java | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 96942a72c..09979ebf9 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -35,6 +35,7 @@ import android.support.annotation.MainThread; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import android.support.design.widget.CoordinatorLayout; +import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.view.ViewPager; @@ -51,7 +52,6 @@ import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnDragListener; -import android.view.ViewTreeObserver; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.AbsListView.OnScrollListener; @@ -392,12 +392,11 @@ public class DialtactsActivity extends TransactionSafeActivity mIsLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; mPreviouslySelectedTabIndex = ListsFragment.TAB_INDEX_SPEED_DIAL; - final View floatingActionButtonContainer = findViewById(R.id.floating_action_button_container); - ImageButton floatingActionButton = (ImageButton) findViewById(R.id.floating_action_button); + FloatingActionButton floatingActionButton = + (FloatingActionButton) findViewById(R.id.floating_action_button); floatingActionButton.setOnClickListener(this); mFloatingActionButtonController = - new FloatingActionButtonController( - this, floatingActionButtonContainer, floatingActionButton); + new FloatingActionButtonController(this, floatingActionButton); ImageButton optionsMenuButton = (ImageButton) searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); @@ -443,23 +442,13 @@ public class DialtactsActivity extends TransactionSafeActivity mParentLayout = (CoordinatorLayout) findViewById(R.id.dialtacts_mainlayout); mParentLayout.setOnDragListener(new LayoutOnDragListener()); - floatingActionButtonContainer - .getViewTreeObserver() - .addOnGlobalLayoutListener( - new ViewTreeObserver.OnGlobalLayoutListener() { - @Override - public void onGlobalLayout() { - final ViewTreeObserver observer = - floatingActionButtonContainer.getViewTreeObserver(); - if (!observer.isAlive()) { - return; - } - observer.removeOnGlobalLayoutListener(this); - int screenWidth = mParentLayout.getWidth(); - mFloatingActionButtonController.setScreenWidth(screenWidth); - mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); - } - }); + ViewUtil.doOnGlobalLayout( + floatingActionButton, + view -> { + int screenWidth = mParentLayout.getWidth(); + mFloatingActionButtonController.setScreenWidth(screenWidth); + mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); + }); Trace.endSection(); @@ -1179,7 +1168,7 @@ public class DialtactsActivity extends TransactionSafeActivity private void showFabInSearchUi() { mFloatingActionButtonController.changeIcon( - getResources().getDrawable(R.drawable.fab_ic_dial, null), + getResources().getDrawable(R.drawable.quantum_ic_dialpad_white_24, null), getResources().getString(R.string.action_menu_dialpad_button)); mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); mFloatingActionButtonController.scaleIn(FAB_SCALE_IN_DELAY_MS); @@ -1364,11 +1353,11 @@ public class DialtactsActivity extends TransactionSafeActivity && !mInRegularSearch && !mInDialpadSearch) { mFloatingActionButtonController.changeIcon( - getResources().getDrawable(R.drawable.ic_person_add_24dp, null), + getResources().getDrawable(R.drawable.quantum_ic_person_add_white_24, null), getResources().getString(R.string.search_shortcut_create_new_contact)); } else { mFloatingActionButtonController.changeIcon( - getResources().getDrawable(R.drawable.fab_ic_dial, null), + getResources().getDrawable(R.drawable.quantum_ic_dialpad_white_24, null), getResources().getString(R.string.action_menu_dialpad_button)); } } |