There are field days.

It has a list with days (Mon-Sun), in front of each day is a box for ticks.

enter image description here

Remove any number of checkboxes and click "OK" Go back to the field, and then again go to the list with the days. Put a tick where they are removed and click "Cancel". We return to the field, again open the list with the days. Ticks are selected.

Code in the fragment:

@OnClick(R.id.day_dialog) public void statusClick(View view) { new DialogAutorepublish(getActivity(), infoAutoUpdate, getResources().getString(R.string.Days), new DialogAutorepublish.IDialogActions() { @Override public void addClick(List<model.ads.autoupdate.otherInfo> list) { String changeDay = ""; for (int i = 0; i < list.size(); i++) { if (list.get(i).isSelectedl() == true) { changeDay = new StringBuilder().append(changeDay + ",").append(list.get(i).getDayShort()).toString(); } } setView(changeDay); } @Override public void cancelClick() { } }).show(); } 

DialogAutorepublish code DialogAutorepublish :

 @OnClick(R.id.cancelbtn) void cancelClick() { dismiss(); for (int i = 0; i < tempList.size(); i++) { for (int j = 0; j < daySelected.size(); j++) { if (daySelected.get(j).getPosition() == tempList.get(i)) { daySelected.get(j).setSelectedl(true); } } } listener.cancelClick(); } @OnClick(R.id.okbtn) void addNewsClick() { dismiss(); listener.addClick(daySelected); } 
  • 2
    sorry, but your description is completely incomprehensible - Maxim Kuznetsov
  • more code with comments to it. - Kirill Stoianov

0