Adressed some of the observations made re the last commits.

This commit is contained in:
Daniele Gobbetti 2015-06-27 18:56:05 +02:00
parent 371a7bb4af
commit 3068d687bf
2 changed files with 5 additions and 14 deletions

View File

@ -190,6 +190,7 @@ public class GBAlarm implements Parcelable, Comparable {
String alarmString = iterator.next();
if(this.equals(new GBAlarm(alarmString))) {
iterator.remove();
break;
}
}
newPrefs.add(this.toPreferences());

View File

@ -40,13 +40,8 @@ public class GBAlarmListAdapter extends ArrayAdapter<GBAlarm> {
this.mContext = context;
alarmList = new ArrayList<GBAlarm>();
if (preferencesAlarmListSet != null) {
Iterator<String> iterator = preferencesAlarmListSet.iterator();
while (iterator.hasNext()) {
String alarmString = iterator.next();
alarmList.add(new GBAlarm(alarmString));
}
for (String alarmString : preferencesAlarmListSet) {
alarmList.add(new GBAlarm(alarmString));
}
Collections.sort(alarmList);
@ -55,13 +50,8 @@ public class GBAlarmListAdapter extends ArrayAdapter<GBAlarm> {
public void setAlarmList(Set<String> preferencesAlarmListSet) {
alarmList = new ArrayList<GBAlarm>();
if (preferencesAlarmListSet != null) {
Iterator<String> iterator = preferencesAlarmListSet.iterator();
while (iterator.hasNext()) {
String alarmString = iterator.next();
alarmList.add(new GBAlarm(alarmString));
}
for (String alarmString : preferencesAlarmListSet) {
alarmList.add(new GBAlarm(alarmString));
}
Collections.sort(alarmList);