mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
More proper support for geo: URLs in Android
git-svn-id: https://zxing.googlecode.com/svn/trunk@301 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
b0f43f0991
commit
76757bdcd4
|
@ -20,7 +20,7 @@
|
|||
<string name="button_ok">OK</string>
|
||||
<string name="button_yes">Yes</string>
|
||||
<string name="menu_about">About...</string>
|
||||
<string name="msg_about">ZXing Barcode Reader v0.4\nhttp://code.google.com/p/zxing</string>
|
||||
<string name="msg_about">ZXing Barcode Reader v0.6\nhttp://code.google.com/p/zxing</string>
|
||||
<string name="msg_no_barcode_detected">Sorry, no barcode was found.</string>
|
||||
<string name="title_about">About</string>
|
||||
<string name="title_barcode_detected">Barcode Detected</string>
|
||||
|
@ -30,5 +30,6 @@
|
|||
<string name="title_add_contact">Add Contact?</string>
|
||||
<string name="title_compose_email">Compose E-mail?</string>
|
||||
<string name="title_lookup_barcode">Look Up Barcode Online?</string>
|
||||
<string name="title_dial">Dial Number?</string>
|
||||
<string name="title_dial">Dial Number?</string>
|
||||
<string name="title_view_maps">View In Google Maps?</string>
|
||||
</resources>
|
||||
|
|
|
@ -207,6 +207,8 @@ public final class BarcodeReaderCaptureActivity extends Activity {
|
|||
return R.string.title_lookup_barcode;
|
||||
} else if (type.equals(ParsedReaderResultType.TEL)) {
|
||||
return R.string.title_dial;
|
||||
} else if (type.equals(ParsedReaderResultType.GEO)) {
|
||||
return R.string.title_view_maps;
|
||||
} else {
|
||||
return R.string.title_barcode_detected;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.google.zxing.client.result.AddressBookDoCoMoParsedResult;
|
|||
import com.google.zxing.client.result.BookmarkDoCoMoParsedResult;
|
||||
import com.google.zxing.client.result.EmailAddressParsedResult;
|
||||
import com.google.zxing.client.result.EmailDoCoMoParsedResult;
|
||||
import com.google.zxing.client.result.GeoParsedResult;
|
||||
import com.google.zxing.client.result.ParsedReaderResult;
|
||||
import com.google.zxing.client.result.ParsedReaderResultType;
|
||||
import com.google.zxing.client.result.TelParsedResult;
|
||||
|
@ -102,15 +103,12 @@ final class ResultHandler extends Handler {
|
|||
intent = new Intent(Intent.DIAL_ACTION, new ContentURI("tel:" + telResult.getNumber()));
|
||||
} catch (URISyntaxException e) {
|
||||
}
|
||||
//} else if (type.equals(ParsedReaderResultType.GEO)) {
|
||||
// GeoParsedResult geoResult = (GeoParsedResult) result;
|
||||
// try {
|
||||
// intent = new Intent(Intent.VIEW_ACTION, new ContentURI(geoResult.getGoogleMapsURI()));
|
||||
// // or can we send the raw geo: URI to Android? maybe it'll open Maps?
|
||||
// // or just open a MapView
|
||||
// } catch (URISyntaxException e) {
|
||||
// return;
|
||||
// }
|
||||
} else if (type.equals(ParsedReaderResultType.GEO)) {
|
||||
GeoParsedResult geoResult = (GeoParsedResult) result;
|
||||
try {
|
||||
intent = new Intent(Intent.VIEW_ACTION, new ContentURI(geoResult.getGeoURI()));
|
||||
} catch (URISyntaxException e) {
|
||||
}
|
||||
} else if (type.equals(ParsedReaderResultType.UPC)) {
|
||||
UPCParsedResult upcResult = (UPCParsedResult) result;
|
||||
try {
|
||||
|
|
|
@ -115,6 +115,7 @@ public final class GeoParsedResult extends ParsedReaderResult {
|
|||
* by this instance, and sets the zoom level in a way that roughly reflects the
|
||||
* altitude, if specified
|
||||
*/
|
||||
/*
|
||||
public String getGoogleMapsURI() {
|
||||
StringBuffer result = new StringBuffer(50);
|
||||
result.append("http://maps.google.com/?ll=");
|
||||
|
@ -139,5 +140,6 @@ public final class GeoParsedResult extends ParsedReaderResult {
|
|||
}
|
||||
return result.toString();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
Loading…
Reference in a new issue