diff options
author | Nancy Chen <nancychen@google.com> | 2014-07-30 17:01:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-25 21:16:23 +0000 |
commit | e1462170216feb1fa1fd214ced428eefce70a1c5 (patch) | |
tree | 604226cf092bea868a867a334739e4df407515a8 /src | |
parent | 378eee666ed5c5dd6e0d67f1766483cd9f4f3f35 (diff) | |
parent | 00067445f4120fca1a3089290f21a46b2384b00e (diff) |
Merge "Fade menu overflow icon in and out for dialpad" into lmp-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 450b9af75..0491d973a 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -76,8 +76,10 @@ import com.android.dialer.SpecialCharSequenceMgr; import com.android.dialer.util.DialerUtils; import com.android.phone.common.CallLogAsync; import com.android.phone.common.HapticFeedback; +import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.dialpad.DialpadKeyButton; import com.android.phone.common.dialpad.DialpadView; + import com.google.common.annotations.VisibleForTesting; import java.util.HashSet; @@ -169,6 +171,7 @@ public class DialpadFragment extends Fragment /** Remembers if we need to clear digits field when the screen is completely gone. */ private boolean mClearDigitsOnStop; + private View mOverflowMenuButton; private PopupMenu mOverflowPopupMenu; private View mDelete; private ToneGenerator mToneGenerator; @@ -285,6 +288,9 @@ public class DialpadFragment extends Fragment final Activity activity = getActivity(); if (activity != null) { activity.invalidateOptionsMenu(); + + boolean transitionIn = mWasEmptyBeforeTextChange? true : false; + updateMenuOverflowButton(transitionIn); } } @@ -646,10 +652,11 @@ public class DialpadFragment extends Fragment mSmsPackageComponentName = DialerUtils.getSmsComponent(activity); - View overflowMenuButton = mDialpadView.getOverflowMenuButton(); - mOverflowPopupMenu = buildOptionsMenu(overflowMenuButton); - overflowMenuButton.setOnTouchListener(mOverflowPopupMenu.getDragToOpenListener()); - overflowMenuButton.setOnClickListener(this); + mOverflowMenuButton = mDialpadView.getOverflowMenuButton(); + mOverflowPopupMenu = buildOptionsMenu(mOverflowMenuButton); + mOverflowMenuButton.setOnTouchListener(mOverflowPopupMenu.getDragToOpenListener()); + mOverflowMenuButton.setOnClickListener(this); + mOverflowMenuButton.setVisibility(View.INVISIBLE); } @Override @@ -1480,6 +1487,21 @@ public class DialpadFragment extends Fragment } /** + * Handle transitions for the menu button depending on the state of the digits edit text. + * Transition out when going from digits to no digits and transition in when the first digit + * is pressed. + * @param transitionIn True if transitioning in, False if transitioning out + */ + private void updateMenuOverflowButton(boolean transitionIn) { + mOverflowMenuButton = mDialpadView.getOverflowMenuButton(); + if (transitionIn) { + AnimUtils.fadeIn(mOverflowMenuButton, AnimUtils.DEFAULT_DURATION); + } else { + AnimUtils.fadeOut(mOverflowMenuButton, AnimUtils.DEFAULT_DURATION); + } + } + + /** * Check if voicemail is enabled/accessible. * * @return true if voicemail is enabled and accessibly. Note that this can be false |