diff options
Diffstat (limited to 'androvdr/src/de/bjusystems/androvdr/data/EpgSearchTimeValues.java')
-rw-r--r-- | androvdr/src/de/bjusystems/androvdr/data/EpgSearchTimeValues.java | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/androvdr/src/de/bjusystems/androvdr/data/EpgSearchTimeValues.java b/androvdr/src/de/bjusystems/androvdr/data/EpgSearchTimeValues.java deleted file mode 100644 index 7300e8e..0000000 --- a/androvdr/src/de/bjusystems/androvdr/data/EpgSearchTimeValues.java +++ /dev/null @@ -1,62 +0,0 @@ -package de.bjusystems.androvdr.data; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import android.content.Context; -import de.bjusystems.androvdr.R; - -public class EpgSearchTimeValues { - - private final List<EpgSearchTimeValue> values = new ArrayList<EpgSearchTimeValue>(); - private final Context context; - - public EpgSearchTimeValues(final Context context) { - - this.context = context; - } - - public List<EpgSearchTimeValue> getValues() { - - final Preferences prefs = Preferences.getPreferences(); - - // fixed values for now and next - values.add(new EpgSearchTimeValue(0, context.getString(R.string.epg_list_time_now))); - values.add(new EpgSearchTimeValue(1, context.getString(R.string.epg_list_time_next))); - - // get user defined values - final String userValueString = prefs.getEpgSearchTimes(); - - final String[] userValues = userValueString.split(","); - - Arrays.sort(userValues); - - for(final String userValue : userValues) { - if (userValue.contains(":")) { - values.add(new EpgSearchTimeValue(values.size(), userValue)); - } - } - - return values; - } - - public void saveValues(final List<EpgSearchTimeValue> values) { - - // get old values - final Preferences prefs = Preferences.getPreferences(); - - // add value - String newValues = ""; - for(int i = 2; i < values.size(); i++) { - final EpgSearchTimeValue value = values.get(i); - if (newValues.length() > 0) { - newValues += ","; - } - newValues += value.toString(); - } - - // save new values - prefs.setEpgSearchTimes(context, newValues); - } -} |