diff options
author | Yorke Lee <yorkelee@google.com> | 2013-07-29 08:53:16 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-07-29 08:57:22 -0700 |
commit | 9b66cff4a7580753a910e119de19f3c529386cd8 (patch) | |
tree | a1a7e48c0b3203f46864d2d2b63084645f70e683 | |
parent | 80a05ed48a899da3f54792bb12e62200a5683f99 (diff) |
Code cleanup
Change-Id: Ib2ee17d3a236c79a5a4495fd28281e2c29479a99
-rw-r--r-- | src/com/android/dialer/dialpad/NewDialpadFragment.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/android/dialer/dialpad/NewDialpadFragment.java b/src/com/android/dialer/dialpad/NewDialpadFragment.java index 96b1039c7..15627c797 100644 --- a/src/com/android/dialer/dialpad/NewDialpadFragment.java +++ b/src/com/android/dialer/dialpad/NewDialpadFragment.java @@ -158,8 +158,6 @@ public class NewDialpadFragment extends Fragment private OnDialpadQueryChangedListener mDialpadQueryListener; - private View mFragmentView; - /** * View (usually FrameLayout) containing mDigits field. This can be null, in which mDigits * isn't enclosed by the container. @@ -343,22 +341,22 @@ public class NewDialpadFragment extends Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) { - View fragmentView = inflater.inflate(R.layout.new_dialpad_fragment, container, false); - mFragmentView = fragmentView; - mFragmentView.buildLayer(); + final View fragmentView = inflater.inflate(R.layout.new_dialpad_fragment, container, + false); + fragmentView.buildLayer(); - // Set the translationY to the correct value before it is drawn for the first frame - // to prevent flicker when the animation first starts - final ViewTreeObserver vto = mFragmentView.getViewTreeObserver(); + // TODO krelease: Get rid of this ugly hack which is to prevent the first frame of the + // animation from drawing the fragment at translationY = 0 + final ViewTreeObserver vto = fragmentView.getViewTreeObserver(); final OnPreDrawListener preDrawListener = new OnPreDrawListener() { @Override public boolean onPreDraw() { if (isHidden()) return true; - if (mFragmentView.getTranslationY() == 0) { - ((DialpadSlidingLinearLayout) mFragmentView).setYFraction(0.67f); + if (fragmentView.getTranslationY() == 0) { + ((DialpadSlidingLinearLayout) fragmentView).setYFraction(0.67f); } - final ViewTreeObserver vto = mFragmentView.getViewTreeObserver(); + final ViewTreeObserver vto = fragmentView.getViewTreeObserver(); vto.removeOnPreDrawListener(this); return true; } |