Skip to content

Commit

Permalink
Fixed refresh listview problem
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebonk committed Jan 17, 2018
1 parent 25038e9 commit fb122f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chipview/src/main/java/com/allyants/chipview/ChipView.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ChipView extends RelativeLayout{
private EditText etSearch;
private ListView lvList;
private ChipAdapter adapter;
private SimpleSearchAdapter simpleSearchAdapter;

public ChipView(Context context) {
super(context);
Expand All @@ -42,7 +43,7 @@ private void init(AttributeSet attrs){
public void setAdapter(ChipAdapter adapter){
this.adapter = adapter;
adapter.setChipView(this);
final SimpleSearchAdapter simpleSearchAdapter = new SimpleSearchAdapter(getContext(),adapter);
simpleSearchAdapter = new SimpleSearchAdapter(getContext(),adapter);
lvList.setAdapter(simpleSearchAdapter);
etSearch.addTextChangedListener(new TextWatcher() {
@Override
Expand All @@ -64,6 +65,7 @@ public void afterTextChanged(Editable editable) {

public void notifyDataSetChanged(){
refreshFlexbox();
simpleSearchAdapter.notifyDataSetChanged();
}

private void refreshFlexbox(){
Expand Down

0 comments on commit fb122f3

Please sign in to comment.