Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/src/main/java/com/pchmn/materialchips/ChipsInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ public void onTextChanged(CharSequence text) {
public List<? extends ChipInterface> getSelectedChipList() {
return mChipsAdapter.getChipList();
}

public ChipsAdapter getAdaptor() {
return mChipsAdapter;
}

public String getHint() {
return mHint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ public int getItemViewType(int position) {
public long getItemId(int position) {
return mChipList.get(position).hashCode();
}


public ChipsInputEditText getChipsInputEditText() {
return mEditText;
}

private void initEditText() {
mEditText.setLayoutParams(new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
Expand Down Expand Up @@ -298,7 +302,8 @@ public void removeChip(ChipInterface chip) {
if (mChipList.size() == 0)
mEditText.setHint(mHintLabel);
// refresh data
notifyDataSetChanged();
//notifyDataSetChanged();
notifyItemRangeChanged(1,mChipList.size());
}

public void removeChip(int position) {
Expand All @@ -311,7 +316,8 @@ public void removeChip(int position) {
if (mChipList.size() == 0)
mEditText.setHint(mHintLabel);
// refresh data
notifyDataSetChanged();
//notifyDataSetChanged();
notifyItemRangeChanged(1,mChipList.size());
}

public void removeChipById(Object id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public void fadeIn() {
int[] coord = new int[2];
mChipsInput.getLocationInWindow(coord);
ViewGroup.MarginLayoutParams layoutParams = (MarginLayoutParams) getLayoutParams();
//if (layoutParams != null) {
layoutParams.topMargin = coord[1] + mChipsInput.getHeight();
// height of the keyboard
layoutParams.bottomMargin = rootView.getHeight() - r.bottom;
Expand All @@ -141,6 +142,7 @@ public void fadeIn() {
anim.setDuration(200);
startAnimation(anim);
setVisibility(VISIBLE);
//}
}

/**
Expand Down