Browse Source

Added Shazam song share support (issue 193).

pull/11/head
Eric Kok 13 years ago
parent
commit
57cf033b5c
  1. 6
      android/src/org/transdroid/gui/search/SendIntentHelper.java

6
android/src/org/transdroid/gui/search/SendIntentHelper.java

@ -13,6 +13,8 @@ public class SendIntentHelper { @@ -13,6 +13,8 @@ public class SendIntentHelper {
private static final String SOUNDHOUND1 = "Just used #SoundHound to find ";
private static final String SOUNDHOUND1_END = " http://";
private static final String SHAZAM = "I just used Shazam to discover ";
private static final String SHAZAM_END = ". http://";
private static final String YOUTUBE_ID= "Watch \"";
private static final String YOUTUBE_START = "\"";
private static final String YOUTUBE_END = "\"";
@ -29,6 +31,10 @@ public class SendIntentHelper { @@ -29,6 +31,10 @@ public class SendIntentHelper {
if (text.startsWith(SOUNDHOUND1)) {
return cutOut(text, SOUNDHOUND1, SOUNDHOUND1_END).replace(" by ", " ");
}
// Shazam song share
if (text.startsWith(SHAZAM)) {
return cutOut(text, SHAZAM, SHAZAM_END).replace(" by ", " ");
}
// YouTube app share (stores title in EXTRA_SUBJECT)
if (intent.hasExtra(Intent.EXTRA_SUBJECT)) {
String subject = intent.getStringExtra(Intent.EXTRA_SUBJECT);

Loading…
Cancel
Save