From 1a1f025445408fa034fa4301d7df2fa4d4175e40 Mon Sep 17 00:00:00 2001 From: milos192 Date: Thu, 1 Dec 2016 17:14:13 +0100 Subject: [PATCH] Returning to the MaterialAutoCompleteTextView implementation for the time being. --- library/build.gradle | 4 ++++ library/src/main/java/com/seraphim/chips/ChipsEditText.java | 4 ++-- library/src/main/java/com/seraphim/chips/ChipsView.java | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 5cc85f6..3f9b8be 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -32,6 +32,10 @@ dependencies { compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.android.support:appcompat-v7:23.4.0' compile 'de.hdodenhof:circleimageview:2.0.0' + compile('com.rengwuxian.materialedittext:library:2.1.4') { + exclude module: 'appcompat-v7' + exclude module: 'support-annotations' + } testCompile 'junit:junit:4.12' } diff --git a/library/src/main/java/com/seraphim/chips/ChipsEditText.java b/library/src/main/java/com/seraphim/chips/ChipsEditText.java index 157cc3d..fa1abd8 100644 --- a/library/src/main/java/com/seraphim/chips/ChipsEditText.java +++ b/library/src/main/java/com/seraphim/chips/ChipsEditText.java @@ -25,7 +25,6 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.widget.AdapterView; -import android.widget.AutoCompleteTextView; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; @@ -34,11 +33,12 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.load.resource.bitmap.CenterCrop; +import com.rengwuxian.materialedittext.MaterialAutoCompleteTextView; import java.util.ArrayList; import java.util.List; -class ChipsEditText extends AutoCompleteTextView implements AdapterView.OnItemClickListener { +class ChipsEditText extends MaterialAutoCompleteTextView implements AdapterView.OnItemClickListener { private InputConnectionWrapperInterface mInputConnectionWrapperInterface; private ItemClickListener mItemClickListener; diff --git a/library/src/main/java/com/seraphim/chips/ChipsView.java b/library/src/main/java/com/seraphim/chips/ChipsView.java index b8948c4..7d1cdf4 100644 --- a/library/src/main/java/com/seraphim/chips/ChipsView.java +++ b/library/src/main/java/com/seraphim/chips/ChipsView.java @@ -193,9 +193,10 @@ private void init() { editTextParams.bottomMargin = (int) (SPACING_BOTTOM * density) + verticalSpacing; editText.setLayoutParams(editTextParams); editText.setMinHeight((int) (CHIP_HEIGHT * density)); - editText.setPadding(0, 0, 0, 0); + editText.setPaddings(0, 0, 0, 0); editText.setLineSpacing(verticalSpacing, (CHIP_HEIGHT * density) / editText.getLineHeight()); editText.setBackgroundColor(Color.argb(0, 0, 0, 0)); + editText.setHideUnderline(true); editText.setImeOptions(EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI); editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); editText.setOnEditorActionListener(this);