diff options
Diffstat (limited to 'src/net/cbaines/suma/BusSpecificStopView.java')
-rw-r--r-- | src/net/cbaines/suma/BusSpecificStopView.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 293da03..4cac19a 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -108,6 +108,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener if (stop.bus.id != null) { if (stop.live) { + onClickMessage = "Bus " + stop.bus.toString() + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); } else { @@ -121,6 +122,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener } else { onClickMessage = "Timetabled bus (" + stop.bus.getName() + ") at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(stop.arivalTime); + } } } else { @@ -128,6 +130,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener if (stop.live) { onClickMessage = "Bus " + stop.bus.toString(); } else { + onClickMessage = "Timetabled bus " + stop.bus.toString(); } } else { @@ -135,6 +138,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener onClickMessage = "Unidentified bus (" + stop.bus.getName() + ")"; } else { onClickMessage = "Timetabled bus (" + stop.bus.getName() + ")"; + } } } @@ -148,7 +152,9 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener public void onClick(View v) { if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, onClickMessage, Toast.LENGTH_SHORT); + } else { context.activityToast.setText(onClickMessage); context.activityToast.setDuration(Toast.LENGTH_SHORT); @@ -157,6 +163,7 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener } public boolean onLongClick(View v) { // TODO + DatabaseHelper helper = OpenHelperManager.getHelper(context, DatabaseHelper.class); try { @@ -170,10 +177,12 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener ((Activity) context).startActivityForResult(i, 0); } else { if (context.activityToast == null) { + context.activityToast = Toast.makeText(context, "Arival prediction not avalible for timetabled buses", Toast.LENGTH_SHORT); } else { context.activityToast.setText("Arival prediction not avalible for timetabled buses"); + context.activityToast.setDuration(Toast.LENGTH_SHORT); } context.activityToast.show(); @@ -184,5 +193,4 @@ public class BusSpecificStopView extends LinearLayout implements OnClickListener } return false; } - } |