private void mergeMyGroups(ArrayList<AskTag> myTags) { if (AskTagHelper.getAskTagsNumber() > 0) { List<AskTag> selectedGroups = AskTagHelper.getSelectedTags(); for (int i = 0; i < myTags.size(); i++) { AskTag tmpTag = myTags.get(i); boolean selected = false; for (int j = 0; j < selectedGroups.size(); j++) { if (selectedGroups.get(j).getValue().equals(tmpTag.getValue())) { selected = true; break; } } tmpTag.setSelected(selected); if (selected) { tmpTag.setOrder(i); } else { tmpTag.setOrder(1024 + i); } } } }
public void getButtons() { List<AskTag> selectedSections = AskTagHelper.getSelectedTags(); List<AskTag> unselectedSections = AskTagHelper.getUnselectedTags(); ArrayList<MovableButton> selectedButtons = new ArrayList<>(); for (int i = 0; i < selectedSections.size(); i++) { AskTag section = selectedSections.get(i); AskTagMovableButton button = new AskTagMovableButton(this); button.setSection(section); selectedButtons.add(button); } ArrayList<MovableButton> unselectedButtons = new ArrayList<>(); for (int i = 0; i < unselectedSections.size(); i++) { AskTag section = unselectedSections.get(i); AskTagMovableButton button = new AskTagMovableButton(this); button.setSection(section); unselectedButtons.add(button); } desk.setSelectedButtons(selectedButtons); desk.setUnselectedButtons(unselectedButtons); }