public void add(SliderItem item, int position) { if (item.mSliderMenu != null) { throw new IllegalArgumentException( "Item already has a parent: " + item + " (" + item.mSliderMenu + ")"); } item.mSliderMenu = this; mItems.add(position, item); notifyChanged(); }
public void remove(SliderItem item) { if (mItems.remove(item)) { item.mSliderMenu = null; } notifyChanged(); }