Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FilterableListView.java #75

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
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