From b572e2b0eb2ea8110dec363722cb7f286251ff06 Mon Sep 17 00:00:00 2001 From: srowen Date: Tue, 11 Jan 2011 23:15:29 +0000 Subject: [PATCH] Old change -- forgot to include ISBN in quick info retrieval for 1D barcodes git-svn-id: https://zxing.googlecode.com/svn/trunk@1701 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../result/supplement/ProductResultInfoRetriever.java | 8 +++----- .../result/supplement/SupplementalInfoRetriever.java | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java index 8991a8935..619891f09 100644 --- a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java +++ b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java @@ -22,7 +22,6 @@ import android.util.Log; import android.widget.TextView; import com.google.zxing.client.android.AndroidHttpClient; import com.google.zxing.client.android.LocaleManager; -import com.google.zxing.client.result.ProductParsedResult; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; @@ -47,17 +46,16 @@ final class ProductResultInfoRetriever extends SupplementalInfoRetriever { Pattern.compile("owb63p\">([^<]+).+zdi3pb\">([^<]+)"); - private final ProductParsedResult result; + private final String productID; - ProductResultInfoRetriever(TextView textView, ProductParsedResult result, Handler handler, Context context) { + ProductResultInfoRetriever(TextView textView, String productID, Handler handler, Context context) { super(textView, handler, context); - this.result = result; + this.productID = productID; } @Override void retrieveSupplementalInfo() throws IOException, InterruptedException { - String productID = result.getProductID(); String encodedProductID = URLEncoder.encode(productID, "UTF-8"); String uri = BASE_PRODUCT_URI + encodedProductID; diff --git a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java index bb16337af..64b6032b0 100644 --- a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java +++ b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java @@ -24,6 +24,7 @@ import android.text.Html; import android.text.Spanned; import android.view.View; import android.widget.TextView; +import com.google.zxing.client.result.ISBNParsedResult; import com.google.zxing.client.result.ParsedResult; import com.google.zxing.client.result.ProductParsedResult; import com.google.zxing.client.result.URIParsedResult; @@ -59,7 +60,9 @@ public abstract class SupplementalInfoRetriever implements Callable { if (result instanceof URIParsedResult) { retriever = new URIResultInfoRetriever(textView, (URIParsedResult) result, handler, context); } else if (result instanceof ProductParsedResult) { - retriever = new ProductResultInfoRetriever(textView, (ProductParsedResult) result, handler, context); + retriever = new ProductResultInfoRetriever(textView, ((ProductParsedResult) result).getProductID(), handler, context); + } else if (result instanceof ISBNParsedResult) { + retriever = new ProductResultInfoRetriever(textView, ((ISBNParsedResult) result).getISBN(), handler, context); } if (retriever != null) { ExecutorService executor = getExecutorService();