Skip to content

Commit

Permalink
update list checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
c0deslinger committed Feb 27, 2020
1 parent 3f71d67 commit d59ad65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
atcListChk.add(new CheckboxData(2, "1", "Satu Dua", false));
atcListChk.add(new CheckboxData(3, "3", "Tiga", false));
MyMultipleCheckbox myMultipleCheckbox = new MyMultipleCheckbox.Builder(ExampleJavaActivity.this)
.setTitle("Select Checkbox").setItem(atcListChk).setFormLayout(formLayout).create();
.setTitle("Select Checkbox").setItem(new ArrayList<>()).setFormLayout(formLayout).create();
myMultipleCheckbox.updateListCheckbox(atcListChk);
ArrayList<String> idSelected = new ArrayList<>();
idSelected.add("1");
idSelected.add("3");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ public void setSelected(ArrayList<String> dataList, SelectedBy selectedBy){
}
}

public void updateListCheckbox(ArrayList<CheckboxData> list){
this.list.clear();
this.list.addAll(list);
if(adapter!=null){
adapter.notifyDataSetChanged();
}
}

public TextView getTxtTitle() {
return txtTitle;
}
Expand Down

0 comments on commit d59ad65

Please sign in to comment.