diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 01f0a41..a1a5c5d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="30" + android:versionName="2.2.3" > diff --git a/res/drawable-hdpi/ic_action_mail.png b/res/drawable-hdpi/ic_action_mail.png new file mode 100644 index 0000000..6da19ad Binary files /dev/null and b/res/drawable-hdpi/ic_action_mail.png differ diff --git a/res/drawable-ldpi/ic_action_mail.png b/res/drawable-ldpi/ic_action_mail.png new file mode 100644 index 0000000..84d0112 Binary files /dev/null and b/res/drawable-ldpi/ic_action_mail.png differ diff --git a/res/drawable-mdpi/ic_action_mail.png b/res/drawable-mdpi/ic_action_mail.png new file mode 100644 index 0000000..cc4b717 Binary files /dev/null and b/res/drawable-mdpi/ic_action_mail.png differ diff --git a/res/drawable-xhdpi/ic_action_mail.png b/res/drawable-xhdpi/ic_action_mail.png new file mode 100644 index 0000000..7cdad16 Binary files /dev/null and b/res/drawable-xhdpi/ic_action_mail.png differ diff --git a/res/menu/route_menu.xml b/res/menu/route_menu.xml index 3b5d153..0a5dd1a 100644 --- a/res/menu/route_menu.xml +++ b/res/menu/route_menu.xml @@ -4,13 +4,13 @@ diff --git a/res/menu/your_train_context_menu.xml b/res/menu/your_train_context_menu.xml index e3a8918..b0c43fa 100644 --- a/res/menu/your_train_context_menu.xml +++ b/res/menu/your_train_context_menu.xml @@ -12,6 +12,11 @@ android:icon="@drawable/ic_action_alarm" android:showAsAction="always|withText" android:title="@string/set_alarm"/> + Leaving Departed Arrive @ dest. ~ - \ No newline at end of file + I\'ll be arriving at %1$s around %2$s + Share arrival time + + \ No newline at end of file diff --git a/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java b/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java index 65e6f11..7ed66c3 100644 --- a/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java +++ b/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java @@ -619,9 +619,10 @@ public class ViewDeparturesActivity extends Activity implements @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { final int itemId = item.getItemId(); + final Departure boardedDeparture = getBoardedDeparture(); if (itemId == R.id.set_alarm_button) { // Don't prompt for alarm if train is about to leave - if (getBoardedDeparture().getMeanSecondsLeft() > 60) { + if (boardedDeparture.getMeanSecondsLeft() > 60) { new TrainAlarmDialogFragment() .show(getSupportFragmentManager() .beginTransaction()); @@ -638,6 +639,22 @@ public class ViewDeparturesActivity extends Activity implements mSwipeHelper.dismissWithAnimation(true); mode.finish(); return true; + } else if (itemId == R.id.share_arrival) { + Intent intent = new Intent(Intent.ACTION_SEND); + intent.setType("text/plain"); + intent.putExtra(Intent.EXTRA_SUBJECT, "My BART train"); + intent.putExtra( + Intent.EXTRA_TEXT, + getString( + R.string.arrival_message, + boardedDeparture.getStationPair() + .getDestination().name, + boardedDeparture + .getEstimatedArrivalTimeText(ViewDeparturesActivity.this))); + + startActivity(Intent.createChooser(intent, + getString(R.string.share_arrival_time))); + return true; } return false; }