From a4ef50949a828e5757cbf8fceeb235c84e38d818 Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Tue, 12 Nov 2013 13:41:27 -0800 Subject: Dismiss dialpad when user touches spaces above it. Only applies if the user has not input any digits yet. Bug: 11648799 Change-Id: I28a57fcd7eae0faaf5e234e9ec7531140903e2f5 --- src/com/android/dialer/dialpad/DialpadFragment.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/com/android/dialer') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 9ebf1121c..00b8281a7 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -206,6 +206,8 @@ public class DialpadFragment extends Fragment private ToneGenerator mToneGenerator; private final Object mToneGeneratorLock = new Object(); private View mDialpad; + private View mSpacer; + /** * Set of dialpad keys that are currently being pressed */ @@ -428,6 +430,18 @@ public class DialpadFragment extends Fragment mDelete.setOnLongClickListener(this); } + mSpacer = fragmentView.findViewById(R.id.spacer); + mSpacer.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + if (isDigitsEmpty()) { + hideAndClearDialpad(); + return true; + } + return false; + } + }); + mDialpad = fragmentView.findViewById(R.id.dialpad); // This is null in landscape mode. // In landscape we put the keyboard in phone mode. -- cgit v1.2.3