diff options
author | Android Dialer <noreply@google.com> | 2017-10-17 01:36:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-17 01:36:29 +0000 |
commit | c6f46340fb800ac1e972bfffb224a4afdb1c82ce (patch) | |
tree | 02ae217584fca494f5c4795038b2c72ed81a551b /java/com/android/dialer | |
parent | 2eba54e028fc387ddc969c70c7b9f0dfd9c906b6 (diff) | |
parent | 5a6cb962ae30ad9e308b5bcc00920daf84618808 (diff) |
Merge changes Iab543850,I305f8a0e
am: 5a6cb962ae
Change-Id: I82c93bbdcf35d08495987aec98a01cfea62c3f7c
Diffstat (limited to 'java/com/android/dialer')
4 files changed, 18 insertions, 9 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 791a710a9..56e0a95e5 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -900,7 +900,7 @@ public class DialtactsActivity extends TransactionSafeActivity } @Override - public void onContactsListScrolled(int scrollState) { + public void onContactsListScrolled(boolean isDragging) { // intentionally empty. } diff --git a/java/com/android/dialer/contactsfragment/ContactsFragment.java b/java/com/android/dialer/contactsfragment/ContactsFragment.java index 759897f91..a8daa546a 100644 --- a/java/com/android/dialer/contactsfragment/ContactsFragment.java +++ b/java/com/android/dialer/contactsfragment/ContactsFragment.java @@ -93,7 +93,7 @@ public class ContactsFragment extends Fragment /** Listener for contacts list scroll state. */ public interface OnContactsListScrolledListener { - void onContactsListScrolled(int scrollState); + void onContactsListScrolled(boolean isDragging); } /** @@ -248,7 +248,9 @@ public class ContactsFragment extends Fragment String anchoredHeaderString = adapter.getHeaderString(firstCompletelyVisible); FragmentUtils.getParentUnsafe(this, OnContactsListScrolledListener.class) - .onContactsListScrolled(recyclerView.getScrollState()); + .onContactsListScrolled( + recyclerView.getScrollState() == RecyclerView.SCROLL_STATE_DRAGGING + || fastScroller.isDragStarted()); // If the user swipes to the top of the list very quickly, there is some strange behavior // between this method updating headers and adapter#onBindViewHolder updating headers. diff --git a/java/com/android/dialer/contactsfragment/FastScroller.java b/java/com/android/dialer/contactsfragment/FastScroller.java index 2a86a3bb6..2bd07ac5d 100644 --- a/java/com/android/dialer/contactsfragment/FastScroller.java +++ b/java/com/android/dialer/contactsfragment/FastScroller.java @@ -81,8 +81,13 @@ public class FastScroller extends RelativeLayout { container.setVisibility(INVISIBLE); scrollBar.setSelected(false); return true; + default: + return super.onTouchEvent(event); } - return super.onTouchEvent(event); + } + + public boolean isDragStarted() { + return dragStarted; } private void setRecyclerViewPosition(float y) { diff --git a/java/com/android/dialer/dialpadview/DialpadFragment.java b/java/com/android/dialer/dialpadview/DialpadFragment.java index c4e6c61d8..2316e86d2 100644 --- a/java/com/android/dialer/dialpadview/DialpadFragment.java +++ b/java/com/android/dialer/dialpadview/DialpadFragment.java @@ -1430,19 +1430,21 @@ public class DialpadFragment extends Fragment if (getActivity() == null || getView() == null) { return; } - final DialpadView dialpadView = getView().findViewById(R.id.dialpad_view); if (!hidden && !isDialpadChooserVisible()) { if (mAnimate) { - dialpadView.animateShow(); + mDialpadView.animateShow(); } ThreadUtil.getUiThreadHandler() .postDelayed( - () -> mFloatingActionButtonController.scaleIn(), + () -> { + if (!isDialpadChooserVisible()) { + mFloatingActionButtonController.scaleIn(); + } + }, mAnimate ? mDialpadSlideInDuration : 0); FragmentUtils.getParentUnsafe(this, DialpadListener.class).onDialpadShown(); mDigits.requestFocus(); - } - if (hidden) { + } else if (hidden) { mFloatingActionButtonController.scaleOut(); } } |