Make RecipientEditTextViewInner package private.
Also add license and make EmailQuery values package private.
Change-Id: I366ca01ac54f04fbc999377be59dbaa139307550
diff --git a/src/com/android/ex/chips/BaseRecipientAdapter.java b/src/com/android/ex/chips/BaseRecipientAdapter.java
index e915574..5e32dca 100644
--- a/src/com/android/ex/chips/BaseRecipientAdapter.java
+++ b/src/com/android/ex/chips/BaseRecipientAdapter.java
@@ -99,7 +99,7 @@
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/src/com/android/ex/chips/RecipientAlternatesAdapter.java b/src/com/android/ex/chips/RecipientAlternatesAdapter.java
index 0b13cca..9890b3c 100644
--- a/src/com/android/ex/chips/RecipientAlternatesAdapter.java
+++ b/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/src/com/android/ex/chips/RecipientEditTextViewInner.java b/src/com/android/ex/chips/RecipientEditTextViewInner.java
index 4314dc1..3efadf0 100644
--- a/src/com/android/ex/chips/RecipientEditTextViewInner.java
+++ b/src/com/android/ex/chips/RecipientEditTextViewInner.java
@@ -54,7 +54,7 @@
* 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 @@
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 @@
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 @@
}
}
if (action == MotionEvent.ACTION_UP && !chipWasSelected) {
- if (mSelectedChip != null) {
- mSelectedChip.unselectChip();
- mSelectedChip = null;
- }
+ clearSelectedChip();
}
return handled;
}