├── .gitignore
├── ChipsLibrary
├── .classpath
├── .project
├── Android.mk
├── AndroidManifest.xml
├── libs
│ └── android-support-v4.jar
├── lint.xml
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ ├── chip_background.9.png
│ │ ├── chip_background_invalid.9.png
│ │ ├── chip_background_selected.9.png
│ │ ├── chip_delete.png
│ │ └── ic_contact_picture.png
│ ├── drawable-mdpi
│ │ ├── chip_background.9.png
│ │ ├── chip_background_invalid.9.png
│ │ ├── chip_background_selected.9.png
│ │ ├── chip_delete.png
│ │ └── ic_contact_picture.png
│ ├── drawable-xhdpi
│ │ ├── chip_background.9.png
│ │ ├── chip_background_invalid.9.png
│ │ ├── chip_background_selected.9.png
│ │ └── ic_contact_picture.png
│ ├── drawable
│ │ ├── list_item_font_primary.xml
│ │ └── list_item_font_secondary.xml
│ ├── layout
│ │ ├── chips_alternate_item.xml
│ │ ├── chips_recipient_dropdown_item.xml
│ │ ├── copy_chip_dialog_layout.xml
│ │ └── more_item.xml
│ ├── values-af
│ │ └── strings.xml
│ ├── values-am
│ │ └── strings.xml
│ ├── values-ar
│ │ └── strings.xml
│ ├── values-be
│ │ └── strings.xml
│ ├── values-bg
│ │ └── strings.xml
│ ├── values-ca
│ │ └── strings.xml
│ ├── values-cs
│ │ └── strings.xml
│ ├── values-da
│ │ └── strings.xml
│ ├── values-de
│ │ └── strings.xml
│ ├── values-el
│ │ └── strings.xml
│ ├── values-en-rGB
│ │ └── strings.xml
│ ├── values-es-rUS
│ │ └── strings.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-et
│ │ └── strings.xml
│ ├── values-fa
│ │ └── strings.xml
│ ├── values-fi
│ │ └── strings.xml
│ ├── values-fr
│ │ └── strings.xml
│ ├── values-hi
│ │ └── strings.xml
│ ├── values-hr
│ │ └── strings.xml
│ ├── values-hu
│ │ └── strings.xml
│ ├── values-in
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-iw
│ │ └── strings.xml
│ ├── values-ja
│ │ └── strings.xml
│ ├── values-ko
│ │ └── strings.xml
│ ├── values-land
│ │ └── dimen.xml
│ ├── values-lt
│ │ └── strings.xml
│ ├── values-lv
│ │ └── strings.xml
│ ├── values-ms
│ │ └── strings.xml
│ ├── values-nb
│ │ └── strings.xml
│ ├── values-nl
│ │ └── strings.xml
│ ├── values-pl
│ │ └── strings.xml
│ ├── values-pt-rPT
│ │ └── strings.xml
│ ├── values-pt
│ │ └── strings.xml
│ ├── values-ro
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-sk
│ │ └── strings.xml
│ ├── values-sl
│ │ └── strings.xml
│ ├── values-sr
│ │ └── strings.xml
│ ├── values-sv
│ │ └── strings.xml
│ ├── values-sw
│ │ └── strings.xml
│ ├── values-sw600dp-land
│ │ └── dimen.xml
│ ├── values-sw600dp
│ │ └── styles.xml
│ ├── values-th
│ │ └── strings.xml
│ ├── values-tl
│ │ └── strings.xml
│ ├── values-tr
│ │ └── strings.xml
│ ├── values-uk
│ │ └── strings.xml
│ ├── values-vi
│ │ └── strings.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ ├── values-zu
│ │ └── strings.xml
│ └── values
│ │ ├── attrs.xml
│ │ ├── dimen.xml
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── android
│ └── ex
│ └── chips
│ ├── AccountSpecifier.java
│ ├── BaseRecipientAdapter.java
│ ├── ChipsUtil.java
│ ├── Queries.java
│ ├── RecipientAlternatesAdapter.java
│ ├── RecipientEditTextView.java
│ ├── RecipientEntry.java
│ ├── SingleRecipientArrayAdapter.java
│ └── recipientchip
│ ├── BaseRecipientChip.java
│ ├── DrawableRecipientChip.java
│ ├── InvisibleRecipientChip.java
│ ├── SimpleRecipientChip.java
│ └── VisibleRecipientChip.java
├── ChipsSample
├── .classpath
├── .project
├── Android.mk
├── AndroidManifest.xml
├── lint.xml
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── layout
│ │ ├── contact_recipient_sample_fragment.xml
│ │ └── custom_recipient_sample_fragment.xml
│ ├── menu
│ │ └── activity_main.xml
│ ├── values-af
│ │ └── strings.xml
│ ├── values-am
│ │ └── strings.xml
│ ├── values-ar
│ │ └── strings.xml
│ ├── values-bg
│ │ └── strings.xml
│ ├── values-ca
│ │ └── strings.xml
│ ├── values-cs
│ │ └── strings.xml
│ ├── values-da
│ │ └── strings.xml
│ ├── values-de
│ │ └── strings.xml
│ ├── values-el
│ │ └── strings.xml
│ ├── values-en-rGB
│ │ └── strings.xml
│ ├── values-en-rIN
│ │ └── strings.xml
│ ├── values-es-rUS
│ │ └── strings.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-et-rEE
│ │ └── strings.xml
│ ├── values-fa
│ │ └── strings.xml
│ ├── values-fi
│ │ └── strings.xml
│ ├── values-fr-rCA
│ │ └── strings.xml
│ ├── values-fr
│ │ └── strings.xml
│ ├── values-hi
│ │ └── strings.xml
│ ├── values-hr
│ │ └── strings.xml
│ ├── values-hu
│ │ └── strings.xml
│ ├── values-hy-rAM
│ │ └── strings.xml
│ ├── values-in
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-iw
│ │ └── strings.xml
│ ├── values-ja
│ │ └── strings.xml
│ ├── values-ka-rGE
│ │ └── strings.xml
│ ├── values-km-rKH
│ │ └── strings.xml
│ ├── values-ko
│ │ └── strings.xml
│ ├── values-lo-rLA
│ │ └── strings.xml
│ ├── values-lt
│ │ └── strings.xml
│ ├── values-lv
│ │ └── strings.xml
│ ├── values-mn-rMN
│ │ └── strings.xml
│ ├── values-ms-rMY
│ │ └── strings.xml
│ ├── values-nb
│ │ └── strings.xml
│ ├── values-nl
│ │ └── strings.xml
│ ├── values-pl
│ │ └── strings.xml
│ ├── values-pt-rPT
│ │ └── strings.xml
│ ├── values-pt
│ │ └── strings.xml
│ ├── values-ro
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-sk
│ │ └── strings.xml
│ ├── values-sl
│ │ └── strings.xml
│ ├── values-sr
│ │ └── strings.xml
│ ├── values-sv
│ │ └── strings.xml
│ ├── values-sw
│ │ └── strings.xml
│ ├── values-th
│ │ └── strings.xml
│ ├── values-tl
│ │ └── strings.xml
│ ├── values-tr
│ │ └── strings.xml
│ ├── values-uk
│ │ └── strings.xml
│ ├── values-vi
│ │ └── strings.xml
│ ├── values-zh-rCN
│ │ └── strings.xml
│ ├── values-zh-rHK
│ │ └── strings.xml
│ ├── values-zh-rTW
│ │ └── strings.xml
│ ├── values-zu
│ │ └── strings.xml
│ └── values
│ │ └── strings.xml
└── src
│ └── com
│ └── android
│ └── ex
│ └── chips
│ └── sample
│ ├── ContactsRecipientsFragment.java
│ ├── CustomRecipientEditTextView.java
│ ├── CustomRecipientFragment.java
│ └── MainActivity.java
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /ChipsLibrary/gen
2 | /ChipsLibrary/bin
3 | /ChipsSample/bin
4 | /ChipsSample/gen
5 |
--------------------------------------------------------------------------------
/ChipsLibrary/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ChipsLibrary/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ChipsLibrary
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ChipsLibrary/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2011 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(call my-dir)
16 |
17 | include $(CLEAR_VARS)
18 | LOCAL_MODULE := android-common-chips
19 | LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
20 | LOCAL_SDK_VERSION := 14
21 | LOCAL_SRC_FILES := \
22 | $(call all-java-files-under, src) \
23 | $(call all-logtags-files-under, src)
24 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
25 | include $(BUILD_STATIC_JAVA_LIBRARY)
26 |
27 | ##################################################
28 | # Build all sub-directories
29 |
30 | include $(call all-makefiles-under,$(LOCAL_PATH))
31 |
--------------------------------------------------------------------------------
/ChipsLibrary/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/ChipsLibrary/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/ChipsLibrary/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ChipsLibrary/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | android.library=true
15 | target=android-19
16 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-hdpi/chip_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-hdpi/chip_background.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-hdpi/chip_background_invalid.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-hdpi/chip_background_invalid.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-hdpi/chip_background_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-hdpi/chip_background_selected.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-hdpi/chip_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-hdpi/chip_delete.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-hdpi/ic_contact_picture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-hdpi/ic_contact_picture.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-mdpi/chip_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-mdpi/chip_background.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-mdpi/chip_background_invalid.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-mdpi/chip_background_invalid.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-mdpi/chip_background_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-mdpi/chip_background_selected.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-mdpi/chip_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-mdpi/chip_delete.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-mdpi/ic_contact_picture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-mdpi/ic_contact_picture.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-xhdpi/chip_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-xhdpi/chip_background.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-xhdpi/chip_background_invalid.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-xhdpi/chip_background_invalid.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-xhdpi/chip_background_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-xhdpi/chip_background_selected.9.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable-xhdpi/ic_contact_picture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsLibrary/res/drawable-xhdpi/ic_contact_picture.png
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable/list_item_font_primary.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/drawable/list_item_font_secondary.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/layout/chips_alternate_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/layout/chips_recipient_dropdown_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
25 |
31 |
39 |
48 |
49 |
57 |
58 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/layout/copy_chip_dialog_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/layout/more_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-af/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopieer e-posadres"
21 | "Kopieer foonnommer"
22 | "Terugkeer"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-am/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "የኢሜይል አድራሻ ቅዳ"
21 | "የስልክ ቁጥር ቅዳ"
22 | "መልስ"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ar/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "%1$s+"
20 | "نسخ عنوان البريد الإلكتروني"
21 | "نسخ رقم الهاتف"
22 | "رجوع"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-be/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Скапіраваць адрас электроннай пошты"
21 | "Скапіраваць нумар тэлефона"
22 | "Назад"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-bg/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+ %1$s"
20 | "Копиране на имейл адреса"
21 | "Копиране на телефонния номер"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ca/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copia l\'adreça electrònica"
21 | "Copia el número de telèfon"
22 | "Retorn"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopírovat e-mailovou adresu"
21 | "Kopírovat telefonní číslo"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-da/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiér e-mailadressen"
21 | "Kopiér telefonnummeret"
22 | "Tilbage"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "E-Mail-Adresse kopieren"
21 | "Telefonnummer kopieren"
22 | "Eingabe"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-el/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Αντιγραφή διεύθυνσης ηλεκτρονικού ταχυδρομείου"
21 | "Αντιγραφή αριθμού τηλεφώνου"
22 | "Πλήκτρο Return"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-en-rGB/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | "+%1$s"
21 | "Copy email address"
22 | "Copy phone number"
23 | "Return"
24 |
25 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-es-rUS/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copiar la dirección de correo"
21 | "Copiar el número de teléfono"
22 | "Volver"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copiar dirección de correo electrónico"
21 | "Copiar número de teléfono"
22 | "Intro"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-et/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopeeri e-posti aadress"
21 | "Kopeeri telefoninumber"
22 | "Sisestus"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "کپی آدرس ایمیل"
21 | "کپی شماره تلفن"
22 | "بازگشت"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-fi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "yli %1$s"
20 | "Kopioi sähköpostiosoite"
21 | "Kopioi puhelinnumero"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+ %1$s"
20 | "Copier l\'adresse e-mail"
21 | "Copier le numéro de téléphone"
22 | "Entrée"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-hi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "ईमेल पते की प्रतिलिपि बनाएं"
21 | "फोन नंबर की प्रतिलिपि बनाएं"
22 | "वापस लौटें"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-hr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiranje e-adrese"
21 | "Kopiranje telefonskog broja"
22 | "Vrati"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-hu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "E-mail cím másolása"
21 | "Telefonszám másolása"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-in/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Salin alamat email"
21 | "Salin nomor telepon"
22 | "Kembali"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copia indirizzo email"
21 | "Copia numero di telefono"
22 | "Invio"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-iw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "העתק כתובת דוא\"ל"
21 | "העתק מספר טלפון"
22 | "חזור"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "メールアドレスをコピー"
21 | "電話番号をコピー"
22 | "戻る"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "%1$s명 이상"
20 | "이메일 주소 복사"
21 | "전화번호 복사"
22 | "입력"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-land/dimen.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | 26dip
19 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-lt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+ %1$s"
20 | "Kopijuoti el. pašto adresą"
21 | "Kopijuoti telefono numerį"
22 | "Grįžti"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-lv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Vairāk nekā %1$s"
20 | "Kopēt e-pasta adresi"
21 | "Kopēt tālruņa numuru"
22 | "Iev. taust."
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ms/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Salin alamat e-mel"
21 | "Salin nombor telefon"
22 | "Kembali"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-nb/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiér e-postadressen"
21 | "Kopiér telefonnummeret"
22 | "Gå tilbake"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-nl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "E-mailadres kopiëren"
21 | "Telefoonnummer kopiëren"
22 | "Return"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiuj adres e-mail"
21 | "Kopiuj numer telefonu"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-pt-rPT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copiar endereço de email"
21 | "Copiar número de telefone"
22 | "Voltar"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-pt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copiar endereço de e-mail"
21 | "Copiar número de telefone"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Copiaţi adresa de e-mail"
21 | "Copiaţi numărul de telefon"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "ещё %1$s"
20 | "Скопировать адрес эл. почты"
21 | "Скопировать номер телефона"
22 | "Назад"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopírovať e-mailovú adresu"
21 | "Kopírovať telefónne číslo"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiranje e-poštnega naslova"
21 | "Kopiranje telefonske številke"
22 | "Vračalka"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Копирај адресу е-поште"
21 | "Копирај број телефона"
22 | "Врати"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopiera e-postadress"
21 | "Kopiera telefonnummer"
22 | "Retur"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Nakili anwani ya barua pepe"
21 | "Nakili namba ya simu"
22 | "Inayofuata"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sw600dp-land/dimen.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | 8dip
19 | 32dip
20 | 14sp
21 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-sw600dp/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
29 |
30 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-th/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "คัดลอกที่อยู่อีเมล"
21 | "คัดลอกหมายเลขโทรศัพท์"
22 | "ส่งคืน"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-tl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopyahin ang email address"
21 | "Kopyahin ang numero ng telepono"
22 | "Bumalik"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "E-posta adresini kopyala"
21 | "Telefon numarasını kopyala"
22 | "Enter"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-uk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Копіювати електронну адресу"
21 | "Копіювати номер телефону"
22 | "Return"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-vi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Sao chép địa chỉ email"
21 | "Sao chép số điện thoại"
22 | "Quay lại"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "复制电子邮件地址"
21 | "复制电话号码"
22 | "上一步"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s 人"
20 | "複製電子郵件地址"
21 | "複製電話號碼"
22 | "返回"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values-zu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "+%1$s"
20 | "Kopisha ikheli le-imeyli"
21 | "Kopisha inombolo yefoni"
22 | "Buyela"
23 |
24 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values/dimen.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | 8dip
19 | 32dip
20 | 14sp
21 | 4dip
22 | -1
23 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | \u002B%1$s
19 |
20 |
22 | Copy email address
23 |
25 | Copy phone number
26 |
28 | Return
29 |
30 |
--------------------------------------------------------------------------------
/ChipsLibrary/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
29 |
30 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/AccountSpecifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.ex.chips;
17 | import android.accounts.Account;
18 |
19 | /**
20 | * The AccountSpecificAdapter interface describes an Adapter
21 | * that can take an account to retrieve information tied to
22 | * a specific account.
23 | */
24 | public interface AccountSpecifier
25 | {
26 | public void setAccount(Account account);
27 | }
28 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/ChipsUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.ex.chips;
17 | import android.os.Build;
18 |
19 | public class ChipsUtil
20 | {
21 | /**
22 | * @return true when the caller can use Chips UI in its environment.
23 | */
24 | public static boolean supportsChipsUi()
25 | {
26 | return Build.VERSION.SDK_INT>=Build.VERSION_CODES.ICE_CREAM_SANDWICH;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/Queries.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.ex.chips;
17 | import android.content.res.Resources;
18 | import android.net.Uri;
19 | import android.provider.ContactsContract.CommonDataKinds.Email;
20 | import android.provider.ContactsContract.CommonDataKinds.Phone;
21 | import android.provider.ContactsContract.Contacts;
22 |
23 | /**
24 | * Phone and Email queries for supporting Chips UI.
25 | */
26 | /* package */class Queries
27 | {
28 | public static final Query PHONE =new Query(new String[] {Contacts.DISPLAY_NAME, // 0
29 | Phone.NUMBER, // 1
30 | Phone.TYPE, // 2
31 | Phone.LABEL, // 3
32 | Phone.CONTACT_ID, // 4
33 | Phone._ID, // 5
34 | Contacts.PHOTO_THUMBNAIL_URI,// 6
35 | Contacts.DISPLAY_NAME_SOURCE // 7
36 | },Phone.CONTENT_FILTER_URI,Phone.CONTENT_URI)
37 | {
38 | @Override
39 | public CharSequence getTypeLabel(final Resources res,final int type,final CharSequence label)
40 | {
41 | return Phone.getTypeLabel(res,type,label);
42 | }
43 | };
44 | public static final Query EMAIL =new Query(new String[] {Contacts.DISPLAY_NAME, // 0
45 | Email.DATA, // 1
46 | Email.TYPE, // 2
47 | Email.LABEL, // 3
48 | Email.CONTACT_ID, // 4
49 | Email._ID, // 5
50 | Contacts.PHOTO_THUMBNAIL_URI,// 6
51 | Contacts.DISPLAY_NAME_SOURCE // 7
52 | },Email.CONTENT_FILTER_URI,Email.CONTENT_URI)
53 | {
54 | @Override
55 | public CharSequence getTypeLabel(final Resources res,final int type,final CharSequence label)
56 | {
57 | return Email.getTypeLabel(res,type,label);
58 | }
59 | };
60 |
61 | static abstract class Query
62 | {
63 | private final String[] mProjection;
64 | private final Uri mContentFilterUri;
65 | private final Uri mContentUri;
66 | public static final int NAME =0; // String
67 | public static final int DESTINATION =1; // String
68 | public static final int DESTINATION_TYPE =2; // int
69 | public static final int DESTINATION_LABEL =3; // String
70 | public static final int CONTACT_ID =4; // long
71 | public static final int DATA_ID =5; // long
72 | public static final int PHOTO_THUMBNAIL_URI =6; // String
73 | public static final int DISPLAY_NAME_SOURCE =7; // int
74 |
75 | public Query(final String[] projection,final Uri contentFilter,final Uri content)
76 | {
77 | mProjection=projection;
78 | mContentFilterUri=contentFilter;
79 | mContentUri=content;
80 | }
81 |
82 | public String[] getProjection()
83 | {
84 | return mProjection;
85 | }
86 |
87 | public Uri getContentFilterUri()
88 | {
89 | return mContentFilterUri;
90 | }
91 |
92 | public Uri getContentUri()
93 | {
94 | return mContentUri;
95 | }
96 |
97 | public abstract CharSequence getTypeLabel(Resources res,int type,CharSequence label);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/SingleRecipientArrayAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.ex.chips;
17 | import android.content.Context;
18 | import android.text.util.Rfc822Tokenizer;
19 | import android.view.LayoutInflater;
20 | import android.view.View;
21 | import android.view.ViewGroup;
22 | import android.widget.ArrayAdapter;
23 | import android.widget.ImageView;
24 | import android.widget.TextView;
25 |
26 | class SingleRecipientArrayAdapter extends ArrayAdapter
27 | {
28 | private int mLayoutId;
29 | private final LayoutInflater mLayoutInflater;
30 |
31 | public SingleRecipientArrayAdapter(Context context,int resourceId,RecipientEntry entry)
32 | {
33 | super(context,resourceId,new RecipientEntry[] {entry});
34 | mLayoutInflater=LayoutInflater.from(context);
35 | mLayoutId=resourceId;
36 | }
37 |
38 | @Override
39 | public View getView(int position,View convertView,ViewGroup parent)
40 | {
41 | if(convertView==null)
42 | convertView=newView();
43 | bindView(convertView,getItem(position));
44 | return convertView;
45 | }
46 |
47 | private View newView()
48 | {
49 | return mLayoutInflater.inflate(mLayoutId,null);
50 | }
51 |
52 | private static void bindView(View view,RecipientEntry entry)
53 | {
54 | TextView display=(TextView)view.findViewById(android.R.id.title);
55 | ImageView imageView=(ImageView)view.findViewById(android.R.id.icon);
56 | display.setText(entry.getDisplayName());
57 | display.setVisibility(View.VISIBLE);
58 | imageView.setVisibility(View.VISIBLE);
59 | TextView destination=(TextView)view.findViewById(android.R.id.text1);
60 | destination.setText(Rfc822Tokenizer.tokenize(entry.getDestination())[0].getAddress());
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/recipientchip/BaseRecipientChip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.ex.chips.recipientchip;
18 |
19 | import com.android.ex.chips.RecipientEntry;
20 |
21 | /**
22 | * BaseRecipientChip defines an object that contains information relevant to a particular recipient.
23 | */
24 | interface BaseRecipientChip {
25 |
26 | /**
27 | * Set the selected state of the chip.
28 | */
29 | void setSelected(boolean selected);
30 |
31 | /**
32 | * Return true if the chip is selected.
33 | */
34 | boolean isSelected();
35 |
36 | /**
37 | * Get the text displayed in the chip.
38 | */
39 | CharSequence getDisplay();
40 |
41 | /**
42 | * Get the text value this chip represents.
43 | */
44 | CharSequence getValue();
45 |
46 | /**
47 | * Get the id of the contact associated with this chip.
48 | */
49 | long getContactId();
50 |
51 | /**
52 | * Get the id of the data associated with this chip.
53 | */
54 | long getDataId();
55 |
56 | /**
57 | * Get associated RecipientEntry.
58 | */
59 | RecipientEntry getEntry();
60 |
61 | /**
62 | * Set the text in the edittextview originally associated with this chip before any reverse lookups.
63 | */
64 | void setOriginalText(String text);
65 |
66 | /**
67 | * Set the text in the edittextview originally associated with this chip before any reverse lookups.
68 | */
69 | CharSequence getOriginalText();
70 |
71 | /**
72 | * Checks if this contact was retrieved from a GAL lookup.
73 | *
74 | * @return true
if it came from GAL, false
otherwise
75 | */
76 | boolean isGalContact();
77 | }
78 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/recipientchip/DrawableRecipientChip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.ex.chips.recipientchip;
18 |
19 | import android.graphics.Canvas;
20 | import android.graphics.Rect;
21 |
22 | /**
23 | * RecipientChip defines a drawable object that contains information relevant to a particular recipient.
24 | */
25 | public interface DrawableRecipientChip extends BaseRecipientChip {
26 | /**
27 | * Get the bounds of the chip; may be 0,0 if it is not visibly rendered.
28 | */
29 | Rect getBounds();
30 |
31 | /**
32 | * Draw the chip.
33 | */
34 | void draw(Canvas canvas);
35 | }
36 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/recipientchip/InvisibleRecipientChip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.ex.chips.recipientchip;
18 |
19 | import android.graphics.Canvas;
20 | import android.graphics.Paint;
21 | import android.graphics.Rect;
22 | import android.text.style.ReplacementSpan;
23 |
24 | import com.android.ex.chips.RecipientEntry;
25 |
26 | /**
27 | * RecipientChip defines a span that contains information relevant to a
28 | * particular recipient.
29 | */
30 | public class InvisibleRecipientChip extends ReplacementSpan implements DrawableRecipientChip {
31 | private final SimpleRecipientChip mDelegate;
32 |
33 | public InvisibleRecipientChip(final RecipientEntry entry) {
34 | super();
35 |
36 | mDelegate = new SimpleRecipientChip(entry);
37 | }
38 |
39 | @Override
40 | public void setSelected(final boolean selected) {
41 | mDelegate.setSelected(selected);
42 | }
43 |
44 | @Override
45 | public boolean isSelected() {
46 | return mDelegate.isSelected();
47 | }
48 |
49 | @Override
50 | public CharSequence getDisplay() {
51 | return mDelegate.getDisplay();
52 | }
53 |
54 | @Override
55 | public CharSequence getValue() {
56 | return mDelegate.getValue();
57 | }
58 |
59 | @Override
60 | public long getContactId() {
61 | return mDelegate.getContactId();
62 | }
63 |
64 | @Override
65 | public long getDataId() {
66 | return mDelegate.getDataId();
67 | }
68 |
69 | @Override
70 | public RecipientEntry getEntry() {
71 | return mDelegate.getEntry();
72 | }
73 |
74 | @Override
75 | public void setOriginalText(final String text) {
76 | mDelegate.setOriginalText(text);
77 | }
78 |
79 | @Override
80 | public CharSequence getOriginalText() {
81 | return mDelegate.getOriginalText();
82 | }
83 |
84 | @Override
85 | public boolean isGalContact() {
86 | return mDelegate.isGalContact();
87 | }
88 |
89 | @Override
90 | public void draw(final Canvas canvas, final CharSequence text, final int start, final int end,
91 | final float x, final int top, final int y, final int bottom, final Paint paint) {
92 | // Do nothing.
93 | }
94 |
95 | @Override
96 | public int getSize(final Paint paint, final CharSequence text, final int start, final int end,
97 | final Paint.FontMetricsInt fm) {
98 | return 0;
99 | }
100 |
101 | @Override
102 | public Rect getBounds() {
103 | return new Rect(0, 0, 0, 0);
104 | }
105 |
106 | @Override
107 | public void draw(final Canvas canvas) {
108 | // do nothing.
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/recipientchip/SimpleRecipientChip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.ex.chips.recipientchip;
18 |
19 | import android.text.TextUtils;
20 |
21 | import com.android.ex.chips.RecipientEntry;
22 |
23 | class SimpleRecipientChip implements BaseRecipientChip {
24 | private final CharSequence mDisplay;
25 |
26 | private final CharSequence mValue;
27 |
28 | private final long mContactId;
29 |
30 | private final long mDataId;
31 |
32 | private final RecipientEntry mEntry;
33 |
34 | private boolean mSelected = false;
35 |
36 | private CharSequence mOriginalText;
37 |
38 | public SimpleRecipientChip(final RecipientEntry entry) {
39 | mDisplay = entry.getDisplayName();
40 | mValue = entry.getDestination().trim();
41 | mContactId = entry.getContactId();
42 | mDataId = entry.getDataId();
43 | mEntry = entry;
44 | }
45 |
46 | @Override
47 | public void setSelected(final boolean selected) {
48 | mSelected = selected;
49 | }
50 |
51 | @Override
52 | public boolean isSelected() {
53 | return mSelected;
54 | }
55 |
56 | @Override
57 | public CharSequence getDisplay() {
58 | return mDisplay;
59 | }
60 |
61 | @Override
62 | public CharSequence getValue() {
63 | return mValue;
64 | }
65 |
66 | @Override
67 | public long getContactId() {
68 | return mContactId;
69 | }
70 |
71 | @Override
72 | public long getDataId() {
73 | return mDataId;
74 | }
75 |
76 | @Override
77 | public RecipientEntry getEntry() {
78 | return mEntry;
79 | }
80 |
81 | @Override
82 | public void setOriginalText(final String text) {
83 | if (TextUtils.isEmpty(text)) {
84 | mOriginalText = text;
85 | } else {
86 | mOriginalText = text.trim();
87 | }
88 | }
89 |
90 | @Override
91 | public CharSequence getOriginalText() {
92 | return !TextUtils.isEmpty(mOriginalText) ? mOriginalText : mEntry.getDestination();
93 | }
94 |
95 | @Override
96 | public boolean isGalContact() {
97 | return mEntry.isGalContact();
98 | }
99 |
100 | @Override
101 | public String toString() {
102 | return mDisplay + " <" + mValue + ">";
103 | }
104 | }
--------------------------------------------------------------------------------
/ChipsLibrary/src/com/android/ex/chips/recipientchip/VisibleRecipientChip.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.android.ex.chips.recipientchip;
18 |
19 | import android.graphics.Canvas;
20 | import android.graphics.Rect;
21 | import android.graphics.drawable.Drawable;
22 | import android.text.style.DynamicDrawableSpan;
23 | import android.text.style.ImageSpan;
24 |
25 | import com.android.ex.chips.RecipientEntry;
26 |
27 | /**
28 | * VisibleRecipientChip defines an ImageSpan that contains information relevant to a
29 | * particular recipient and renders a background asset to go with it.
30 | */
31 | public class VisibleRecipientChip extends ImageSpan implements DrawableRecipientChip {
32 | private final SimpleRecipientChip mDelegate;
33 |
34 | public VisibleRecipientChip(final Drawable drawable, final RecipientEntry entry) {
35 | super(drawable, DynamicDrawableSpan.ALIGN_BOTTOM);
36 |
37 | mDelegate = new SimpleRecipientChip(entry);
38 | }
39 |
40 | @Override
41 | public void setSelected(final boolean selected) {
42 | mDelegate.setSelected(selected);
43 | }
44 |
45 | @Override
46 | public boolean isSelected() {
47 | return mDelegate.isSelected();
48 | }
49 |
50 | @Override
51 | public CharSequence getDisplay() {
52 | return mDelegate.getDisplay();
53 | }
54 |
55 | @Override
56 | public CharSequence getValue() {
57 | return mDelegate.getValue();
58 | }
59 |
60 | @Override
61 | public long getContactId() {
62 | return mDelegate.getContactId();
63 | }
64 |
65 | @Override
66 | public long getDataId() {
67 | return mDelegate.getDataId();
68 | }
69 |
70 | @Override
71 | public RecipientEntry getEntry() {
72 | return mDelegate.getEntry();
73 | }
74 |
75 | @Override
76 | public void setOriginalText(final String text) {
77 | mDelegate.setOriginalText(text);
78 | }
79 |
80 | @Override
81 | public CharSequence getOriginalText() {
82 | return mDelegate.getOriginalText();
83 | }
84 |
85 | @Override
86 | public boolean isGalContact() {
87 | return mDelegate.isGalContact();
88 | }
89 |
90 | @Override
91 | public Rect getBounds() {
92 | return getDrawable().getBounds();
93 | }
94 |
95 | @Override
96 | public void draw(final Canvas canvas) {
97 | getDrawable().draw(canvas);
98 | }
99 |
100 | @Override
101 | public String toString() {
102 | return mDelegate.toString();
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/ChipsSample/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ChipsSample/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ChipsSample
4 |
5 |
6 | ChipsLibrary
7 |
8 |
9 |
10 | com.android.ide.eclipse.adt.ResourceManagerBuilder
11 |
12 |
13 |
14 |
15 | com.android.ide.eclipse.adt.PreCompilerBuilder
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javabuilder
21 |
22 |
23 |
24 |
25 | com.android.ide.eclipse.adt.ApkBuilder
26 |
27 |
28 |
29 |
30 |
31 | com.android.ide.eclipse.adt.AndroidNature
32 | org.eclipse.jdt.core.javanature
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ChipsSample/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2013 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH:= $(call my-dir)
16 |
17 | # Include res dir from chips
18 | chips_dir := ../res
19 | res_dirs := res $(chips_dir)
20 |
21 | ##################################################
22 | # Build APK
23 | include $(CLEAR_VARS)
24 |
25 | src_dirs := src
26 | LOCAL_PACKAGE_NAME := ChipsSample
27 |
28 | LOCAL_STATIC_JAVA_LIBRARIES += android-common-chips
29 |
30 | LOCAL_SDK_VERSION := 18
31 |
32 | LOCAL_SRC_FILES := $(call all-java-files-under, src) \
33 | $(call all-logtags-files-under, $(src_dirs))
34 | LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
35 | LOCAL_AAPT_FLAGS := --auto-add-overlay
36 | LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips
37 |
38 | include $(BUILD_PACKAGE)
39 |
40 |
41 | ##################################################
42 | # Build all sub-directories
43 |
44 | include $(call all-makefiles-under,$(LOCAL_PATH))
45 |
--------------------------------------------------------------------------------
/ChipsSample/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ChipsSample/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ChipsSample/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 | android.library.reference.1=../ChipsLibrary
16 |
--------------------------------------------------------------------------------
/ChipsSample/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsSample/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ChipsSample/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsSample/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ChipsSample/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndroidDeveloperLB/ChipsLibrary/0890ccaf3eb7504b52fd6436ac031fa0daf103d1/ChipsSample/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ChipsSample/res/layout/contact_recipient_sample_fragment.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
24 |
25 |
33 |
34 |
45 |
46 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/ChipsSample/res/layout/custom_recipient_sample_fragment.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/ChipsSample/res/menu/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-af/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips-voorbeeld"
20 | "E-posadresse"
21 | "Foonnommers"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-am/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "የቺፕስ ናሙና"
20 | "የኢሜይል አድራሻዎች"
21 | "ስልክ ቁጥሮች"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ar/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "عينة شرائح"
20 | "عناوين البريد الإلكتروني"
21 | "أرقام الهواتف"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-bg/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Имейл адреси"
21 | "Телефонни номера"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ca/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Mostra de xips"
20 | "Adreces electròniques"
21 | "Números de telèfon"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Vzorové čipy"
20 | "E-mailové adresy"
21 | "Telefonní čísla"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-da/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Eksempel på chips"
20 | "E-mailadresser"
21 | "Telefonnumre"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "E-Mail-Adressen"
21 | "Telefonnummern"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-el/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Δείγμα τσιπ"
20 | "Διευθύνσεις ηλεκτρονικού ταχυδρομείου"
21 | "Αριθμοί τηλεφώνου"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-en-rGB/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Email Addresses"
21 | "Phone Numbers"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-en-rIN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Email Addresses"
21 | "Phone Numbers"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-es-rUS/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Muestra de chips"
20 | "Direcciones de correo electrónico"
21 | "Números de teléfono"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Muestra de Chips"
20 | "Direcciones de correo electrónico"
21 | "Números de teléfono"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-et-rEE/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "E-posti aadressid"
21 | "Telefoninumbrid"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "نمونه تراشهها"
20 | "آدرسهای ایمیل"
21 | "شماره تلفنها"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-fi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Sähköpostiosoitteet"
21 | "Puhelinnumerot"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-fr-rCA/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Échantillon Chips"
20 | "Adresses de courriel"
21 | "Numéros de téléphone"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Échantillon Chips"
20 | "Adresses e-mail"
21 | "Numéros de téléphone"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-hi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "चिप्स नमूने"
20 | "ईमेल पते"
21 | "फ़ोन नंबर"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-hr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "E-adrese"
21 | "Telefonski brojevi"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-hu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "„Chips” minta"
20 | "E-mail címek"
21 | "Telefonszámok"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-hy-rAM/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Չիպերի նմուշ"
20 | "Էլփոստի հասցեներ"
21 | "Հեռախոսահամարներ"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-in/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Contoh Chip"
20 | "Alamat Email"
21 | "Nomor Telepon"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Indirizzi email"
21 | "Numeri di telefono"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-iw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "דוגמאות שבבים"
20 | "כתובות דוא\"ל"
21 | "מספרי טלפון"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "チップサンプル"
20 | "メールアドレス"
21 | "電話番号"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ka-rGE/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "ჩიპების ნიმუში"
20 | "ელფოსტის მისამართები"
21 | "ტელეფონის ნომრები"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-km-rKH/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "គំរូបន្ទះសៀគ្វី"
20 | "អាសយដ្ឋានអ៊ីមែល"
21 | "លេខទូរស័ព្ទ"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "칩 샘플"
20 | "이메일 주소"
21 | "전화번호"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-lo-rLA/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "ທີ່ຢູ່ອີເມວ"
21 | "ເບີໂທລະສັບ:"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-lt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Lustų pavyzdžiai"
20 | "El. pašto adresai"
21 | "Telefonų numeriai"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-lv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "E-pasta adreses"
21 | "Tālruņa numuri"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-mn-rMN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Чипний дээж"
20 | "Имэйл хаягууд"
21 | "Утасны дугаарууд"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ms-rMY/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Sampel Cip"
20 | "Alamat E-mel"
21 | "Nombor Telefon"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-nb/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips-eksempel"
20 | "E-postadresser"
21 | "Telefonnumre"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-nl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chipsvoorbeeld"
20 | "E-mailadressen"
21 | "Telefoonnummers"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Próbka chipsów"
20 | "Adresy e-mail"
21 | "Numery telefonów"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-pt-rPT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Amostra de Chips"
20 | "Endereços de email"
21 | "Números de telefone"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-pt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Amostra de chips"
20 | "Endereços de e-mail"
21 | "Números de telefone"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Mostră Chips"
20 | "Adrese de e-mail"
21 | "Numere de telefon"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Адреса эл. почты"
21 | "Номера телефонов"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-sk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Ukážka čipov"
20 | "E-mailové adresy"
21 | "Telefónne čísla"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-sl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Vzorec čipov"
20 | "E-poštni naslovi"
21 | "Telefonske številke"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-sr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Пример чипова"
20 | "Адресе е-поште"
21 | "Бројеви телефона"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-sv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chipsprov"
20 | "E-postadresser"
21 | "Telefonnummer"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-sw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Sampuli ya Chips"
20 | "Anwani za Barua Pepe"
21 | "Nambari za Simu"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-th/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "ตัวอย่างชิป"
20 | "ที่อยู่อีเมล"
21 | "หมายเลขโทรศัพท์"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-tl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Sample ng Mga Chip"
20 | "Mga Email Address"
21 | "Mga Numero ng Telepono"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Fiş Örneği"
20 | "E-posta Adresleri"
21 | "Telefon Numaraları"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-uk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "Електронні адреси"
21 | "Номери телефонів"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-vi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Mẫu chip"
20 | "Địa chỉ email"
21 | "Số điện thoại"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "电子邮件地址"
21 | "电话号码"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-zh-rHK/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "電郵地址"
21 | "電話號碼"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Chips Sample"
20 | "電子郵件地址"
21 | "電話號碼"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values-zu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 | "Isempula yama-chip"
20 | "Amakheli we-imeyili"
21 | "Izinombolo zefoni"
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Chips Sample
5 | Email Addresses
6 | Phone Numbers
7 | add a random recipient
8 | remove a random recipient
9 | To
10 | Repository website
11 | All my repositories
12 | All my apps
13 | More info
14 | This demonstrates how to use the device\'s contacts as the list of recipients.
15 | This demonstrates how to use the device\'s contacts as the list of recipients.
16 | \nIt\'s not supported for the demo versions, as they don\'t allow using the permission to read from contacts
17 | \nIn order to check out the full sample, you need to check out the original code
18 | This demonstrates how to put your own customized list of recipients.
19 | \nIt shows fake contacts, and as opposed to the original sample, clicking a chip will only allow you to remove it, instead of showing alternatives to choose from.
20 | \nOf course, it\'s possible to do it yourself…
21 | available recipients list:
22 |
23 |
--------------------------------------------------------------------------------
/ChipsSample/src/com/android/ex/chips/sample/ContactsRecipientsFragment.java:
--------------------------------------------------------------------------------
1 | package com.android.ex.chips.sample;
2 | import java.util.ArrayList;
3 | import java.util.Collection;
4 | import java.util.List;
5 | import java.util.Random;
6 | import android.app.Fragment;
7 | import android.content.pm.PackageManager;
8 | import android.os.Bundle;
9 | import android.text.util.Rfc822Tokenizer;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.View.OnClickListener;
13 | import android.view.ViewGroup;
14 | import android.widget.MultiAutoCompleteTextView;
15 | import android.widget.TextView;
16 | import com.android.ex.chips.BaseRecipientAdapter;
17 | import com.android.ex.chips.RecipientEditTextView;
18 | import com.android.ex.chips.RecipientEditTextView.IChipListener;
19 | import com.android.ex.chips.RecipientEntry;
20 |
21 | public class ContactsRecipientsFragment extends Fragment
22 | {
23 | private RecipientEditTextView mPhoneRetv;
24 | final Random mRandom =new Random();
25 |
26 | @Override
27 | public View onCreateView(final LayoutInflater inflater,final ViewGroup container,final Bundle savedInstanceState)
28 | {
29 | final View rootView=inflater.inflate(R.layout.contact_recipient_sample_fragment,container,false);
30 | // email recipients textview sample
31 | final RecipientEditTextView emailRetv=(RecipientEditTextView)rootView.findViewById(R.id.email_retv);
32 | emailRetv.setTokenizer(new Rfc822Tokenizer());
33 | emailRetv.setAdapter(new BaseRecipientAdapter(BaseRecipientAdapter.QUERY_TYPE_EMAIL,getActivity())
34 | {});
35 | emailRetv.setChipListener(new IChipListener()
36 | {
37 | @Override
38 | public void onDataChanged()
39 | {
40 | android.util.Log.d("Applog","emails view data changed:");
41 | printAllItems(emailRetv);
42 | }
43 | });
44 | // contacts recipients textview sample
45 | mPhoneRetv=(RecipientEditTextView)rootView.findViewById(R.id.phone_retv);
46 | mPhoneRetv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
47 | final BaseRecipientAdapter adapter=new BaseRecipientAdapter(BaseRecipientAdapter.QUERY_TYPE_PHONE,getActivity())
48 | {};
49 | mPhoneRetv.setThreshold(2);
50 | mPhoneRetv.setAdapter(adapter);
51 | mPhoneRetv.setChipListener(new IChipListener()
52 | {
53 | @Override
54 | public void onDataChanged()
55 | {
56 | android.util.Log.d("Applog"," \nphones view data changed:");
57 | printAllItems(mPhoneRetv);
58 | }
59 | });
60 | // NOTE: the query should run on a background thread. this is just for demonstration
61 | final View removeRecipientButton=rootView.findViewById(R.id.removeRecipientButton);
62 | removeRecipientButton.setOnClickListener(new OnClickListener()
63 | {
64 | @Override
65 | public void onClick(final View v)
66 | {
67 | final View view=getActivity().getCurrentFocus();
68 | if(view instanceof RecipientEditTextView)
69 | removeRandomRecipient((RecipientEditTextView)view);
70 | }
71 | });
72 | final View addRecipientButton=rootView.findViewById(R.id.addRecipientButton);
73 | final TextView tutorialTextView=(TextView)rootView.findViewById(R.id.device_recipients_tutorialTextView);
74 | if(!checkReadContactsPermission())
75 | {
76 | tutorialTextView.setText(R.string.device_recipients_tutorial_unavailable);
77 | mPhoneRetv.setEnabled(false);
78 | emailRetv.setEnabled(false);
79 | addRecipientButton.setEnabled(false);
80 | removeRecipientButton.setEnabled(false);
81 | }
82 | else
83 | {
84 | tutorialTextView.setText(R.string.device_recipients_tutorial);
85 | final List allEntries=adapter.doQuery();
86 | android.util.Log.d("Applog","entries count:"+allEntries.size());
87 | addRecipientButton.setOnClickListener(new OnClickListener()
88 | {
89 | @Override
90 | public void onClick(final View v)
91 | {
92 | final View view=getActivity().getCurrentFocus();
93 | if(view instanceof RecipientEditTextView)
94 | addRandomRecipient((RecipientEditTextView)view,allEntries);
95 | }
96 | });
97 | }
98 | return rootView;
99 | }
100 |
101 | private boolean checkReadContactsPermission()
102 | {
103 | final String permission="android.permission.READ_CONTACTS";
104 | final int res=getActivity().checkCallingOrSelfPermission(permission);
105 | return res==PackageManager.PERMISSION_GRANTED;
106 | }
107 |
108 | private void removeRandomRecipient(final RecipientEditTextView view)
109 | {
110 | final List recipients=new ArrayList(view.getChosenRecipients());
111 | final int count=recipients.size();
112 | if(count==0)
113 | return;
114 | final int idx=mRandom.nextInt(count);
115 | view.removeRecipient(recipients.get(idx),true);
116 | // Log.d("Applog","data after removing a random recipient:");
117 | // printAllItems(view);
118 | }
119 |
120 | private void addRandomRecipient(final RecipientEditTextView view,final List allEntries)
121 | {
122 | final int idx=mRandom.nextInt(allEntries.size());
123 | view.addRecipient(allEntries.get(idx),true);
124 | // Log.d("Applog","data after adding a random recipient:");
125 | // printAllItems(view);
126 | }
127 |
128 | private void printAllItems(final RecipientEditTextView view)
129 | {
130 | final Collection recipients=view.getChosenRecipients();
131 | for(final RecipientEntry entry : recipients)
132 | android.util.Log.d("Applog",entry.getContactId()+" "+entry.getDisplayName());
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/ChipsSample/src/com/android/ex/chips/sample/CustomRecipientEditTextView.java:
--------------------------------------------------------------------------------
1 | package com.android.ex.chips.sample;
2 | import android.content.Context;
3 | import android.database.AbstractCursor;
4 | import android.database.Cursor;
5 | import android.provider.BaseColumns;
6 | import android.util.AttributeSet;
7 | import android.widget.ListAdapter;
8 | import com.android.ex.chips.RecipientAlternatesAdapter;
9 | import com.android.ex.chips.RecipientEditTextView;
10 | import com.android.ex.chips.recipientchip.DrawableRecipientChip;
11 |
12 | /** this class is provided just for the demo, which doesn't have read-contacts permission */
13 | public class CustomRecipientEditTextView extends RecipientEditTextView
14 | {
15 | public CustomRecipientEditTextView(final Context context,final AttributeSet attrs)
16 | {
17 | super(context,attrs);
18 | }
19 |
20 | protected Cursor getCursorForConstruction(final Context context,final long contactId,final int queryType)
21 | {
22 | return new AbstractCursor()
23 | {
24 | @Override
25 | public boolean isNull(final int column)
26 | {
27 | return false;
28 | }
29 |
30 | @Override
31 | public String getString(final int column)
32 | {
33 | return null;
34 | }
35 |
36 | @Override
37 | public short getShort(final int column)
38 | {
39 | return 0;
40 | }
41 |
42 | @Override
43 | public long getLong(final int column)
44 | {
45 | return 0;
46 | }
47 |
48 | @Override
49 | public int getInt(final int column)
50 | {
51 | return 0;
52 | }
53 |
54 | @Override
55 | public float getFloat(final int column)
56 | {
57 | return 0;
58 | }
59 |
60 | @Override
61 | public double getDouble(final int column)
62 | {
63 | return 0;
64 | }
65 |
66 | @Override
67 | public int getCount()
68 | {
69 | return 0;
70 | }
71 |
72 | @Override
73 | public String[] getColumnNames()
74 | {
75 | return new String[] {BaseColumns._ID};
76 | }
77 | };
78 | }
79 |
80 | @Override
81 | protected ListAdapter createAlternatesAdapter(final DrawableRecipientChip chip)
82 | {
83 | return new RecipientAlternatesAdapter(getContext(),//
84 | getCursorForConstruction(getContext(),chip.getContactId(),getAdapter().getQueryType()),//
85 | chip.getDataId(),getAdapter().getQueryType(),this)
86 | {};
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/ChipsSample/src/com/android/ex/chips/sample/CustomRecipientFragment.java:
--------------------------------------------------------------------------------
1 | package com.android.ex.chips.sample;
2 | import java.util.ArrayList;
3 | import java.util.List;
4 | import java.util.Random;
5 | import android.app.Fragment;
6 | import android.os.Bundle;
7 | import android.provider.ContactsContract.DisplayNameSources;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.view.ViewGroup;
12 | import android.widget.MultiAutoCompleteTextView;
13 | import android.widget.TextView;
14 | import com.android.ex.chips.BaseRecipientAdapter;
15 | import com.android.ex.chips.RecipientEditTextView;
16 | import com.android.ex.chips.RecipientEntry;
17 |
18 | public class CustomRecipientFragment extends Fragment
19 | {
20 | final Random mRandom =new Random();
21 |
22 | @Override
23 | public View onCreateView(final LayoutInflater inflater,final ViewGroup container,final Bundle savedInstanceState)
24 | {
25 | final View rootView=inflater.inflate(R.layout.custom_recipient_sample_fragment,container,false);
26 | // custom recipients textview sample
27 | final RecipientEditTextView customRetv=(RecipientEditTextView)rootView.findViewById(R.id.custom_retv);
28 | customRetv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
29 | customRetv.setThreshold(2);
30 | final List allEntries=generateFakeRecipientsEntries();
31 | customRetv.setAdapter(new BaseRecipientAdapter(getActivity(),4,allEntries)
32 | {});
33 | final View removeRecipientButton=rootView.findViewById(R.id.removeRecipientButton);
34 | removeRecipientButton.setOnClickListener(new OnClickListener()
35 | {
36 | @Override
37 | public void onClick(final View v)
38 | {
39 | final View view=getActivity().getCurrentFocus();
40 | if(view instanceof RecipientEditTextView)
41 | removeRandomRecipient((RecipientEditTextView)view);
42 | }
43 | });
44 | final View addRecipientButton=rootView.findViewById(R.id.addRecipientButton);
45 | android.util.Log.d("Applog","entries count:"+allEntries.size());
46 | addRecipientButton.setOnClickListener(new OnClickListener()
47 | {
48 | @Override
49 | public void onClick(final View v)
50 | {
51 | final View view=getActivity().getCurrentFocus();
52 | if(view instanceof RecipientEditTextView)
53 | addRandomRecipient((RecipientEditTextView)view,allEntries);
54 | }
55 | });
56 | final TextView availableRecipientsTextView=(TextView)rootView.findViewById(R.id.availableRecipientsTextView);
57 | for(final RecipientEntry recipientEntry : allEntries)
58 | availableRecipientsTextView.append("\n"+recipientEntry.getDisplayName()+" - "+recipientEntry.getDestination());
59 | return rootView;
60 | }
61 |
62 | private List generateFakeRecipientsEntries()
63 | {
64 | final List allEntries=new ArrayList();
65 | for(int i=0;i<100;++i)
66 | {
67 | final RecipientEntry entry=RecipientEntry.constructTopLevelEntry("abc"+i,DisplayNameSources.NICKNAME,"address"+i,0,null,i,i,(String)null,true,false);
68 | allEntries.add(entry);
69 | }
70 | return allEntries;
71 | }
72 |
73 | private void removeRandomRecipient(final RecipientEditTextView view)
74 | {
75 | final List recipients=new ArrayList(view.getChosenRecipients());
76 | final int count=recipients.size();
77 | if(count==0)
78 | return;
79 | final int idx=mRandom.nextInt(count);
80 | view.removeRecipient(recipients.get(idx),true);
81 | // Log.d("Applog","data after removing a random recipient:");
82 | // printAllItems(view);
83 | }
84 |
85 | private void addRandomRecipient(final RecipientEditTextView view,final List allEntries)
86 | {
87 | final int idx=mRandom.nextInt(allEntries.size());
88 | view.addRecipient(allEntries.get(idx),true);
89 | // Log.d("Applog","data after adding a random recipient:");
90 | // printAllItems(view);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/ChipsSample/src/com/android/ex/chips/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.ex.chips.sample;
17 | import java.util.ArrayList;
18 | import android.app.ActionBar;
19 | import android.app.ActionBar.OnNavigationListener;
20 | import android.app.Activity;
21 | import android.content.Intent;
22 | import android.net.Uri;
23 | import android.os.Bundle;
24 | import android.view.Menu;
25 | import android.view.MenuItem;
26 | import android.widget.ArrayAdapter;
27 |
28 | public class MainActivity extends Activity
29 | {
30 | // code and sample found here:https://plus.google.com/+RichHyndman/posts/TSxaARVsRjF
31 | // and imported from here:https://android.googlesource.com/platform/frameworks/ex/+/android-sdk-support_r11
32 | @Override
33 | protected void onCreate(final Bundle savedInstanceState)
34 | {
35 | super.onCreate(savedInstanceState);
36 | getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
37 | final ArrayList itemList=new ArrayList();
38 | itemList.add("Contacts Recipients");
39 | itemList.add("Customized Recipients");
40 | final ArrayAdapter navAdapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1,android.R.id.text1,itemList);
41 | getActionBar().setListNavigationCallbacks(navAdapter,new OnNavigationListener()
42 | {
43 | @Override
44 | public boolean onNavigationItemSelected(final int itemPosition,final long itemId)
45 | {
46 | switch(itemPosition)
47 | {
48 | case 0:
49 | getFragmentManager().beginTransaction().replace(android.R.id.content,new ContactsRecipientsFragment()).commit();
50 | break;
51 | case 1:
52 | getFragmentManager().beginTransaction().replace(android.R.id.content,new CustomRecipientFragment()).commit();
53 | break;
54 | }
55 | return true;
56 | }
57 | });
58 | }
59 |
60 | @Override
61 | public boolean onCreateOptionsMenu(final Menu menu)
62 | {
63 | getMenuInflater().inflate(R.menu.activity_main,menu);
64 | return super.onCreateOptionsMenu(menu);
65 | }
66 |
67 | @Override
68 | public boolean onOptionsItemSelected(final MenuItem item)
69 | {
70 | String url=null;
71 | switch(item.getItemId())
72 | {
73 | case R.id.menuItem_all_my_apps:
74 | url="https://play.google.com/store/apps/developer?id=AndroidDeveloperLB";
75 | break;
76 | case R.id.menuItem_all_my_repositories:
77 | url="https://github.com/AndroidDeveloperLB";
78 | break;
79 | case R.id.menuItem_current_repository_website:
80 | url="https://github.com/AndroidDeveloperLB/ChipsLibrary";
81 | break;
82 | }
83 | if(url==null)
84 | return true;
85 | final Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
86 | intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
87 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
88 | startActivity(intent);
89 | return true;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Note: this is deprecated. Google made better solution for it in its Material-design SDK:
2 |
3 | - https://material.io/components/chips/android#using-chips
4 | - https://medium.com/material-design-in-action/chips-material-components-for-android-46001664a40f
5 | - https://developer.android.com/reference/com/google/android/material/chip/Chip
6 |
7 | ----
8 |
9 | ChipsLibrary
10 | =================
11 |
12 | This is a fork of Google's chips library shown [**here**][1], and can be downloaded from [**here**][3]
13 |
14 | ![screenshot][3]
15 |
16 | What's different from the original library :
17 |
18 | 1. It's easy to import and build on Eclipse. :)
19 |
20 | 2. Removed buggy dragging feature and the classes it uses.
21 |
22 | 3. fixed setOnItemClickListener (for clicking on chips) so that it will use both the chips library's logic AND your code.
23 |
24 | 4. Removed T9 searching for phones, and instead you can search for either phone numbers or names, by exactly what you type.
25 | Of course, you can always revert back to what Google has done, if you wish.
26 |
27 | 5. Added features :
28 | 1. getRecipients - query all recipients (should usually be done on a background thread)
29 | 2. addRecipient , removeRecipient - adds/removes a recipient. also, ability to control if you wish to be notified about chips added/removed when you are the one who triggered it.
30 | 4. setChipListener - sets a listener that'll notify you when the number of chips has changed.
31 | 5. setFocusBehavior - ability to choose what to do when focus removed/received.
32 | 6. New CTOR for the BaseRecipientAdapter, which allows to choose which recipients to use . Note that this is only for demonstrations
33 | 7. setChosenRecipients - ability to set all chosen recipients.
34 | 8. removeAllRecipients - removes all of the chosen recipients
35 | 9. getChosenRecipients - returns all of the chosen recipients
36 |
37 | IMPORTANT: you can only safely call the recipients' operations after the view got its size feagured out.
38 | You can use the function "runJustBeforeBeingDrawn" as I've written on some StackOverflow posts (like [**here**][4]), in case you need to use those operations as soon as possible.
39 |
40 | In order to make it easy for you to find the code for those added features, I've put them all at the end of "RecipientEditTextView.java" file.
41 |
42 | 6. Made the code a bit more readable. Not enough, but still... :)
43 |
44 | Notes :
45 |
46 | - on some devices (like Galaxy S2 and Galaxy S3) , pressing backspace after the chip will sometimes show its number instead of removing the chip (and its data) completely.
47 | There might be some other weird behaviors on those devices, which are caused due to changes on the default behavior of MultiAutoCompleteTextView
48 |
49 | - It seems the original library has a lot of "TODO"s and even some that say to fix issues. Not sure how important they are though
50 |
51 | - I've tried to balance the changes I've made vs the code that is available, so that I won't create more bugs.
52 | If you've noticed a bug, please write about it, especially if you know how to fix it.
53 |
54 | - Like the original library, this one's minimal API is 11 .
55 |
56 | - Be sure to check the sample. It's a bit messy, but it shows what can be done.
57 |
58 | - There is also a "demo" for those who don't wish to use it to show real contacts. It lacks some of the features of the original one (showing contacts images, showing alternative contacts, and maybe others), but you can customize it to your needs and also add the missing features.
59 |
60 |
61 |
62 | [1]: https://plus.google.com/+RichHyndman/posts/TSxaARVsRjF
63 | [2]: http://https://android.googlesource.com/platform/frameworks/ex/+/android-sdk-support_r11/chips/
64 | [3]: https://lh3.googleusercontent.com/-0tiDXRdjE9w/UEKSRdUaS6I/AAAAAAAAoqw/thtcKMWSWKs/w393-h683-no/png.png
65 | [4]: http://stackoverflow.com/a/10923514/878126
66 |
--------------------------------------------------------------------------------