Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android

Overview

Chips EditText Library

Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android

=============

Alt text

Step 1: Clone git repor or download zip file

Step 2: Import ChipsEditTextLibrary in your eclipse workspace

Step 3: Create new Android project

Step 4: Set ChipsEditTextLibrary as reference of your project

Alt text

Right Click on Project -> Properties -> Android ->Add

Step 4: Open your xml layout file and add ChipsEditText control

  <com.kpbird.chipsedittextlibrary.ChipsMultiAutoCompleteTextview
        android:id="@+id/chipsMultiAutoCompleteTextview1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:ems="10"
        android:text="" >

        <requestFocus />
    </com.kpbird.chipsedittextlibrary.ChipsMultiAutoCompleteTextview>

Step 5: Open your Activity class and write following code.

  package com.kpbird.chipsedittextdemo;

  import java.util.ArrayList;

  import android.app.Activity;
  import android.content.res.TypedArray;
  import android.os.Bundle;
  import android.util.Log;
  
  import com.kpbird.chipsedittextlibrary.ChipsAdapter;
  import com.kpbird.chipsedittextlibrary.ChipsItem;
  import com.kpbird.chipsedittextlibrary.ChipsMultiAutoCompleteTextview;
  
  public class MainActivity extends Activity {
  
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  ChipsMultiAutoCompleteTextview ch = (ChipsMultiAutoCompleteTextview) findViewById(R.id.chipsMultiAutoCompleteTextview1);

  String[] countries = getResources().getStringArray(R.array.country);
  TypedArray imgs = getResources().obtainTypedArray(R.array.flags);

  ArrayList<ChipsItem> arrCountry = new ArrayList<ChipsItem>();

  for (int i = 0; i < countries.length; i++) {
   arrCountry.add(new ChipsItem(countries[i], imgs
     .getResourceId(i, -1)));
   Log.i("Main Activity", arrCountry.get(i).getTitle() + " = "
     + arrCountry.get(i).getImageid());
  }

  Log.i("MainActivity", "Array :" + arrCountry.size());

  ChipsAdapter chipsAdapter = new ChipsAdapter(this, arrCountry);
  ch.setAdapter(chipsAdapter);

 }

}

Step 6: You need to use ChipsItem and ChipsAdapter to provide data. ChipsItem has two field 1. Title and 2. Image Id (R.drawable.android), In above sample I have created two array in string.xml for title and images.

For more detail please refer : http://www.kpbird.com/2013/02/android-chips-edittext-token-edittext_26.html

You might also like...
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.
AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.

AutoscaleEditText AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size. Latest Version How to use

Float Label Edit Texts for Android

Floating Label Edit Text for Android For more info, see this blog post. Salient features Simple and clean library (open up the source to see for yours

Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Awesome Android Typeahead library - User mention plugin, UI widget for auto complete user mention using the at sign (@) like Twitter or Facebook.

android-typeahead Awesome Android Typeahead library - User mention plugin, UI widget for auto complete user mention using the at sign (@) like Twitter

MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.
MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.

MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.
RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android. Looking for iOS? Check out cjwirth/RichEditorView Supported Functions Bold

:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0
:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0

LIBRARY IS NO LONGER MAINTAINED If you want to adopt + maintain this library, please drop me a message - [email protected] Android Full Justific

[DISCONTINUED] Rrich text editor for android platform. 安卓富文本编辑器,暂停维护

icarus-android Maybe the best rich text editor on android platform. Base on Simditor Features Alignment (left/center/right) Bold Blockquote Code Horiz

Comments
  • Created an Apache License file

    Created an Apache License file

    I'd like to use this library, but it doesn't have any license declaration. @kpbird

    Trying to add a LICENSE file to declare the license type of this repo. Thanks.

    opened by patrickyin 0
  • multiple chipView

    multiple chipView

    Hi, really thanks for the Library.

    Can you please guide me how the onChipClick get its parent chipview when I have more than one chipview in an activity? I found the onClick(View v) inside ChipView class doesn't return the clicked ChipView (return a null v instead).

    opened by b-e-e 0
  • License

    License

    Hi would you consider adding a License file to clarify which license you have release this code under?

    Thanks for this library, we are finding this very useful.

    opened by shabda 0
Owner
kpbird
I write code
kpbird
Uma biblioteca completa e performática para destacar trechos de textos usando Spannable com Expressões Regulares (Regex) para Android.

Highlight Uma biblioteca completa e performática para destacar trechos de textos usando Spannable com Expressões Regulares (Regex) para Android totalm

Irineu A. Silva 16 Dec 22, 2022
An easy approach on how to create your country code picker for the edit text.

Country-Code-Picker Original Article on Dev.to Click below ?? App's Overview In this article, I am going to demonstrate how to create a simple country

Siddharth Singh 5 Mar 10, 2022
Android Custom View for prevent the view behind on-screen keyboard when edit text is focused

Group Focusable Prevent the view behind on-screen keyboard when edit text is focused in Android UI Download Gradle implementation 'com.akexorcist:grou

Akexorcist 8 Jun 22, 2022
LocalizedEditText - Custom edit text that allow only one language

LocalizedEditText Custom edit text that allow only one language Supported languages : Arabic , English Default language : English Examples

Mostafa Gad 1 Nov 28, 2021
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

Ali Muzaffar 439 Nov 29, 2022
Android Bubble View

BubbleTextView Custom arrow position Custom fillet radius Custom background color Can be placed anywhere Two default style Two default theme Snapshot

null 669 Nov 11, 2022
A editable text with a constant text/placeholder for Android.

ParkedTextView A EditText with a constant text in the end. How to use <com.goka.parkedtextview.ParkedTextView xmlns:app="http://schemas.android.co

goka 270 Nov 11, 2022
RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

mehran elyasi 4 Feb 14, 2022
Android library contain custom realisation of EditText component for masking and formatting input text

Masked-Edittext Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality. Install Maven <dependency

Evgeny Safronov 600 Nov 29, 2022
Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

Azimo Labs 161 Nov 25, 2022