diff options
author | Nancy Chen <nancychen@google.com> | 2014-07-30 17:08:18 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-07-30 17:08:18 +0000 |
commit | 14b1456a734e9338b306ce8252d6980e071295a9 (patch) | |
tree | 951d4fffc8e784087549c7b6b07ce41b95998031 | |
parent | f08b0b690c7fca9cf734f201b5669c4278959820 (diff) | |
parent | e1462170216feb1fa1fd214ced428eefce70a1c5 (diff) |
am e1462170: Merge "Fade menu overflow icon in and out for dialpad" into lmp-dev
* commit 'e1462170216feb1fa1fd214ced428eefce70a1c5':
Fade menu overflow icon in and out for dialpad
-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 |