From 85734ab9efa254d4542c28defe26d0730b0245ec Mon Sep 17 00:00:00 2001 From: Doug Keen Date: Mon, 14 Oct 2013 08:19:14 -0700 Subject: [PATCH] Decluttered action menus a bit. Added feature to send arrival time message. --- AndroidManifest.xml | 4 ++-- res/drawable-hdpi/ic_action_mail.png | Bin 0 -> 501 bytes res/drawable-ldpi/ic_action_mail.png | Bin 0 -> 281 bytes res/drawable-mdpi/ic_action_mail.png | Bin 0 -> 404 bytes res/drawable-xhdpi/ic_action_mail.png | Bin 0 -> 295 bytes res/menu/route_menu.xml | 4 ++-- res/menu/your_train_context_menu.xml | 5 +++++ res/values/strings.xml | 5 ++++- .../activities/ViewDeparturesActivity.java | 19 +++++++++++++++++- 9 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 res/drawable-hdpi/ic_action_mail.png create mode 100644 res/drawable-ldpi/ic_action_mail.png create mode 100644 res/drawable-mdpi/ic_action_mail.png create mode 100644 res/drawable-xhdpi/ic_action_mail.png 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 0000000000000000000000000000000000000000..6da19ad3fda27732373b6dccc57c19d690f38343 GIT binary patch literal 501 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-s%*9TgAsieWw;%dH0CG7CJR*yM z%CCbkqm#z$3ZS55iEBhjaDG}zd16s2LwR|*US?i)adKios$PCk`s{Z$Qb0v50X`wF z{|5m`jNH`#bdOF+kY6wZBNH<#8wVE;pOA^UwY`(Go0nfuSad>4W^U1(1&f!hTDxJ> zww=589XNF4%;Kpk=YaZFd%8G=cpQH_$(-*{fPl+$>+}tO=N9{Y-!IR~ddNaCP;!6X z((Omj=@b-xj9wP&w?m-!_AiOE$w7w_W96Mv->q(t`Et5S{zQY-e#L7HC*RwBJvW^} zH_pQ9BICvE`(LjKGulRaYMOGeY_ELTtKA^+(rwMnxeev7o(EXloY1}fQqf$pV9Ts! zT}26J{x}r29&Ol~E7lV#le23}WW(0e`f-aFZL#`a{r~Bqqepw#&jvKLq?}mF4Rkhx Mr>mdKI;Vst0I^;ZApigX literal 0 HcmV?d00001 diff --git a/res/drawable-ldpi/ic_action_mail.png b/res/drawable-ldpi/ic_action_mail.png new file mode 100644 index 0000000000000000000000000000000000000000..84d0112250ee1281e5eb007caef0ccba2be11b35 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;w=3*z$5DpHG+YkL80J)q69+AaB z<<~)&(Me-=1yE43#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWD?t0G|-o z|HOg7U4MmuT6jx>{DK*{dA)<864z|nwtN4XhRaeQw|RTIIEF}EPEJ^$_rQ{wmHmR{ z9fNah3hkQQhvJqoJlP=a)^sDdmD{1p&!TFM~}U&3=E8do-U3d z5v^~p`gz{iGjpM9Oc2VqI9<$4>V-4_VLtV^0#TaNu3OVsYa&eWC4#tiK8@7E2QA2vvCB z6n>{=V}o-}vgV{8%;h^=q^lFxw0(6F=MnxPx1&+JWJ7=KnwGETcOFTF$|R&Wytu(+ z>3iof(|boJk9|GLIWOlfbo>*kuzcbP0l+XkK*X*NM literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_action_mail.png b/res/drawable-xhdpi/ic_action_mail.png new file mode 100644 index 0000000000000000000000000000000000000000..7cdad1660c6cbedb300fa6806776375663ab665a GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|e=3*z$5DpHG+YkL80J)q69+AaB z<<~)&(Me-=1yE43#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWD?J0G|-o z|JXpfN8?4H0``(1zhDL?W4BqW&Xm2$v;qnhdb&7wPem_P?68_F zeWH{ 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; }