From 2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5 Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 31 Oct 2011 16:03:39 +0100 Subject: do not show ad hoc time --- .../vdrmanager/gui/EpgSearchTimesListActivity.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'vdrmanager') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchTimesListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchTimesListActivity.java index 891babf..6cc5a3d 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchTimesListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchTimesListActivity.java @@ -1,6 +1,8 @@ package de.bjusystems.vdrmanager.gui; +import java.util.Calendar; import java.util.List; +import java.util.TimeZone; import android.app.Activity; import android.app.TimePickerDialog; @@ -31,8 +33,8 @@ public class EpgSearchTimesListActivity extends Activity implements OnClickListener, OnTimeSetListener { ArrayAdapter adapter; + List values; - Preferences prefs; @Override protected void onCreate(final Bundle savedInstanceState) { @@ -41,6 +43,8 @@ public class EpgSearchTimesListActivity extends Activity // Attach view setContentView(R.layout.epg_search_times_list); + setTitle(R.string.epg_search_times_window); + // Create adapter for ListView adapter = new ArrayAdapter(this, R.layout.epg_search_times_item); final ListView listView = (ListView) findViewById(R.id.epg_search_times_list); @@ -56,9 +60,9 @@ public class EpgSearchTimesListActivity extends Activity } public void onClick(final View v) { - + final Calendar cal = Calendar.getInstance(TimeZone.getDefault()); // show time selection - final TimePickerDialog dialog = new TimePickerDialog(this, this, 0, 0, true); + final TimePickerDialog dialog = new TimePickerDialog(this, this, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), Preferences.get().isUse24hFormat()); dialog.show(); } @@ -107,7 +111,6 @@ public class EpgSearchTimesListActivity extends Activity if (item.getItemId() == R.id.epg_search_time_delete) { values.remove(time); adapter.remove(time); - save(); } @@ -119,7 +122,7 @@ public class EpgSearchTimesListActivity extends Activity // get values values = new EpgSearchTimeValues(this).getValues(); adapter.clear(); - for(int i = 2; i < values.size(); i++) { + for(int i = 2; i < values.size() - 1; i++) { adapter.add(values.get(i)); } } -- cgit v1.2.3