diff options
author | Mindy Pereira <mindyp@google.com> | 2011-06-01 11:13:08 -0700 |
---|---|---|
committer | Mindy Pereira <mindyp@google.com> | 2011-06-01 11:59:34 -0700 |
commit | 5f2cc770801133c2db389ebe108063427d1cf6aa (patch) | |
tree | 4e1521e6a1c053fe9d47e351d26f18fb85dc079e /chips/src/com/android | |
parent | b29315d91230ded8fc0682f943e379a020f36dac (diff) | |
download | android_frameworks_ex-5f2cc770801133c2db389ebe108063427d1cf6aa.tar.gz android_frameworks_ex-5f2cc770801133c2db389ebe108063427d1cf6aa.tar.bz2 android_frameworks_ex-5f2cc770801133c2db389ebe108063427d1cf6aa.zip |
Make RecipientEditTextViewInner package private.
Also add license and make EmailQuery values package private.
Change-Id: I366ca01ac54f04fbc999377be59dbaa139307550
Diffstat (limited to 'chips/src/com/android')
3 files changed, 26 insertions, 7 deletions
diff --git a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java index e915574..5e32dca 100644 --- a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java +++ b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java @@ -99,7 +99,7 @@ public abstract class BaseRecipientAdapter extends BaseAdapter implements Filter public DirectoryFilter filter; } - protected static class EmailQuery { + /* package */ static class EmailQuery { public static final String[] PROJECTION = { Contacts.DISPLAY_NAME, // 0 Email.DATA, // 1 diff --git a/chips/src/com/android/ex/chips/RecipientAlternatesAdapter.java b/chips/src/com/android/ex/chips/RecipientAlternatesAdapter.java index 0b13cca..9890b3c 100644 --- a/chips/src/com/android/ex/chips/RecipientAlternatesAdapter.java +++ b/chips/src/com/android/ex/chips/RecipientAlternatesAdapter.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.android.ex.chips; diff --git a/chips/src/com/android/ex/chips/RecipientEditTextViewInner.java b/chips/src/com/android/ex/chips/RecipientEditTextViewInner.java index 4314dc1..3efadf0 100644 --- a/chips/src/com/android/ex/chips/RecipientEditTextViewInner.java +++ b/chips/src/com/android/ex/chips/RecipientEditTextViewInner.java @@ -54,7 +54,7 @@ import java.util.ArrayList; * RecipientEditTextView is an auto complete text view for use with applications * that use the new Chips UI for addressing a message to recipients. */ -public class RecipientEditTextViewInner extends MultiAutoCompleteTextView +/* package */ class RecipientEditTextViewInner extends MultiAutoCompleteTextView implements OnItemClickListener { private static final String TAG = "RecipientEditTextView"; @@ -309,6 +309,13 @@ public class RecipientEditTextViewInner extends MultiAutoCompleteTextView super.performFiltering(text, keyCode); } + private void clearSelectedChip() { + if (mSelectedChip != null) { + mSelectedChip.unselectChip(); + mSelectedChip = null; + } + } + @Override public boolean onTouchEvent(MotionEvent event) { int action = event.getAction(); @@ -323,7 +330,7 @@ public class RecipientEditTextViewInner extends MultiAutoCompleteTextView if (currentChip != null) { if (action == MotionEvent.ACTION_UP) { if (mSelectedChip != null && mSelectedChip != currentChip) { - mSelectedChip.unselectChip(); + clearSelectedChip(); mSelectedChip = currentChip.selectChip(); } else if (mSelectedChip == null) { mSelectedChip = currentChip.selectChip(); @@ -335,10 +342,7 @@ public class RecipientEditTextViewInner extends MultiAutoCompleteTextView } } if (action == MotionEvent.ACTION_UP && !chipWasSelected) { - if (mSelectedChip != null) { - mSelectedChip.unselectChip(); - mSelectedChip = null; - } + clearSelectedChip(); } return handled; } |