From ed2ade34e7e2f34e630571f893cba2c1953c9cb2 Mon Sep 17 00:00:00 2001 From: dswitkin Date: Thu, 6 Nov 2008 16:25:39 +0000 Subject: Finished renaming UPC --> Product in a few places. git-svn-id: http://zxing.googlecode.com/svn/trunk/android@671 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- res/values/strings.xml | 4 +- .../android/result/ProductResultHandler.java | 59 ++++++++++++++++++++++ .../android/result/ResultHandlerFactory.java | 2 +- .../client/android/result/UPCResultHandler.java | 59 ---------------------- 4 files changed, 62 insertions(+), 62 deletions(-) create mode 100644 src/com/google/zxing/client/android/result/ProductResultHandler.java delete mode 100644 src/com/google/zxing/client/android/result/UPCResultHandler.java diff --git a/res/values/strings.xml b/res/values/strings.xml index b5745124..f1377d1f 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -81,10 +81,10 @@ Found email address Found geographic coordinates Found book + Found product Found SMS address Found phone number Found plain text - Found product Found URL Google Book Search @@ -93,5 +93,5 @@ Help http://code.google.com/p/zxing - ZXing-Android/1.0 + ZXing-Android/1.1 diff --git a/src/com/google/zxing/client/android/result/ProductResultHandler.java b/src/com/google/zxing/client/android/result/ProductResultHandler.java new file mode 100644 index 00000000..bd21684c --- /dev/null +++ b/src/com/google/zxing/client/android/result/ProductResultHandler.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008 ZXing authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.zxing.client.android.result; + +import android.app.Activity; +import com.google.zxing.client.android.R; +import com.google.zxing.client.result.ParsedResult; +import com.google.zxing.client.result.ProductParsedResult; + +public class ProductResultHandler extends ResultHandler { + + private static final int[] mButtons = { + R.string.button_product_search, + R.string.button_web_search + }; + + public ProductResultHandler(Activity activity, ParsedResult result) { + super(activity, result); + } + + public int getButtonCount() { + return mButtons.length; + } + + public int getButtonText(int index) { + return mButtons[index]; + } + + public void handleButtonPress(int index) { + ProductParsedResult productResult = (ProductParsedResult) mResult; + switch (index) { + case 0: + openProductSearch(productResult.getNormalizedProductID()); + break; + case 1: + webSearch(productResult.getNormalizedProductID()); + break; + } + } + + public int getDisplayTitle() { + return R.string.result_product; + } + +} diff --git a/src/com/google/zxing/client/android/result/ResultHandlerFactory.java b/src/com/google/zxing/client/android/result/ResultHandlerFactory.java index 0470baef..f53cad84 100644 --- a/src/com/google/zxing/client/android/result/ResultHandlerFactory.java +++ b/src/com/google/zxing/client/android/result/ResultHandlerFactory.java @@ -32,7 +32,7 @@ public class ResultHandlerFactory { } else if (type.equals(ParsedResultType.EMAIL_ADDRESS)) { return new EmailAddressResultHandler(activity, result); } else if (type.equals(ParsedResultType.PRODUCT)) { - return new UPCResultHandler(activity, result); + return new ProductResultHandler(activity, result); } else if (type.equals(ParsedResultType.URI)) { return new URIResultHandler(activity, result); } else if (type.equals(ParsedResultType.TEXT)) { diff --git a/src/com/google/zxing/client/android/result/UPCResultHandler.java b/src/com/google/zxing/client/android/result/UPCResultHandler.java deleted file mode 100644 index 44ecd228..00000000 --- a/src/com/google/zxing/client/android/result/UPCResultHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2008 ZXing authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.zxing.client.android.result; - -import android.app.Activity; -import com.google.zxing.client.android.R; -import com.google.zxing.client.result.ParsedResult; -import com.google.zxing.client.result.ProductParsedResult; - -public class UPCResultHandler extends ResultHandler { - - private static final int[] mButtons = { - R.string.button_product_search, - R.string.button_web_search - }; - - public UPCResultHandler(Activity activity, ParsedResult result) { - super(activity, result); - } - - public int getButtonCount() { - return mButtons.length; - } - - public int getButtonText(int index) { - return mButtons[index]; - } - - public void handleButtonPress(int index) { - ProductParsedResult upcResult = (ProductParsedResult) mResult; - switch (index) { - case 0: - openProductSearch(upcResult.getNormalizedProductID()); - break; - case 1: - webSearch(upcResult.getNormalizedProductID()); - break; - } - } - - public int getDisplayTitle() { - return R.string.result_upc; - } - -} -- cgit v1.2.3