summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2011-10-31 16:03:39 +0100
committerlado <herrlado@gmail.com>2011-10-31 16:03:39 +0100
commit2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5 (patch)
tree997498f01d50c9840672597bd33a5fad708a2a41
parent0833bf11afe593976cb7c78a1d986be277f543de (diff)
downloadvdr-manager-2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5.tar.gz
vdr-manager-2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5.tar.bz2
do not show ad hoc time
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchTimesListActivity.java13
1 files changed, 8 insertions, 5 deletions
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<EpgSearchTimeValue> adapter;
+
List<EpgSearchTimeValue> 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<EpgSearchTimeValue>(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));
}
}