/** * Add a new profile at a specific position to the list * * @param profile * @param position */ public void addProfile(@NonNull IProfile profile, int position) { if (mAccountHeaderBuilder.mProfiles == null) { mAccountHeaderBuilder.mProfiles = new ArrayList<>(); } mAccountHeaderBuilder.mProfiles.add(position, IdDistributor.checkId(profile)); mAccountHeaderBuilder.updateHeaderAndList(); }
/** * Add new profiles to the existing list of profiles * * @param profiles */ public void addProfiles(@NonNull IProfile... profiles) { if (mAccountHeaderBuilder.mProfiles == null) { mAccountHeaderBuilder.mProfiles = new ArrayList<>(); } Collections.addAll(mAccountHeaderBuilder.mProfiles, IdDistributor.checkIds(profiles)); mAccountHeaderBuilder.updateHeaderAndList(); }
/** * Set a new list of profiles for the header * * @param profiles */ public void setProfiles(ArrayList<IProfile> profiles) { mAccountHeaderBuilder.mProfiles = IdDistributor.checkIds(profiles); mAccountHeaderBuilder.updateHeaderAndList(); }