diff options
author | Yorke Lee <yorkelee@google.com> | 2015-04-03 23:59:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-03 23:59:48 +0000 |
commit | 029e1a8918f8735a7d2c4a56b1037a291cecaab6 (patch) | |
tree | ba036cb7e819d115944d559dacba87aabefc0b74 | |
parent | c35c84cd418e8825ebf8b16782e99b5a010cc43e (diff) | |
parent | d522989fe9e77a8a7da1199948f44aa6cd03293e (diff) |
Merge "Use hardware layer for SearchFragment fade in"
-rw-r--r-- | src/com/android/dialer/list/SearchFragment.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index 000e139fe..50c294608 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -15,6 +15,9 @@ */ package com.android.dialer.list; +import android.animation.Animator; +import android.animation.AnimatorInflater; +import android.animation.AnimatorListenerAdapter; import android.app.Activity; import android.content.Intent; import android.content.res.Resources; @@ -129,6 +132,26 @@ public class SearchFragment extends PhoneNumberPickerFragment { } @Override + public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) { + Animator animator = null; + if (nextAnim != 0) { + animator = AnimatorInflater.loadAnimator(getActivity(), nextAnim); + } + if (animator != null) { + final View view = getView(); + final int oldLayerType = view.getLayerType(); + view.setLayerType(View.LAYER_TYPE_HARDWARE, null); + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + view.setLayerType(oldLayerType, null); + } + }); + } + return animator; + } + + @Override protected void setSearchMode(boolean flag) { super.setSearchMode(flag); // This hides the "All contacts with phone numbers" header in the search fragment |