diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-11-13 13:29:39 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-13 13:29:39 -0800 |
commit | 1cc54f025ca77481f5346042a7eb107111158fc8 (patch) | |
tree | f582f370d0042628a129e54921d6c0df88cccd8b | |
parent | 86666e2852262162f5ba101b9ab054f981777ef1 (diff) | |
parent | f9d191530fcefad0f730bdf6df490d4fd5b51dd5 (diff) |
am f9d19153: am 759c264e: Merge "Dismiss dialpad when user touches spaces above it." into klp-dev
* commit 'f9d191530fcefad0f730bdf6df490d4fd5b51dd5':
Dismiss dialpad when user touches spaces above it.
-rw-r--r-- | res/layout/dialpad_fragment.xml | 3 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml index 32b1d6094..e673cea98 100644 --- a/res/layout/dialpad_fragment.xml +++ b/res/layout/dialpad_fragment.xml @@ -19,7 +19,8 @@ android:layout_height="match_parent" android:orientation="vertical" > <!-- spacer view --> - <Space + <View + android:id="@+id/spacer" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" /> 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. |