Giter Site home page Giter Site logo

kpbird / chips-edittext-library Goto Github PK

View Code? Open in Web Editor NEW
380.0 22.0 75.0 1.17 MB

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

chips-edittext-library's Introduction

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

chips-edittext-library's People

Contributors

kpbird avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chips-edittext-library's Issues

Gradle install

Please, provide a package to install via gradle or maven repositories.
It will make life easier for many developers

Problem with android:inputType="textEmailAddress"

Hi,
I have a problem when I set:
android:inputType="textEmailAddress"
to the ChipsMultiAutoCompleteTextview. When I do that, I can't make it multiline. I try with all these properties:
android:lines="20"
android:ems="10"
android:scrollHorizontally="false"
android:scrollbars="vertical"
android:singleLine="false"

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).

Duplicate chips when pressed enter in multi line.

chipstext

Hi in the attached image ,I am using Chipstext. I first added word "the" and pressed comma which makes it tag just fine. Then i pressed enter and added word "which" and pressed comma. Its creating duplicate tag of which. please help me with this.!

Problem in jelly bean

Hi,
When I press the backspace in the keyboard, in Ginger and ICS works fine, but in Jelly I have to delete character by character all the word, what should I do to fix that?
Thanks!

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.

input comma

when first input is comma there comes a crash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.