mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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
This commit is contained in:
parent
7119d3878b
commit
b572e2b0eb
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<Void> {
|
|||
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();
|
||||
|
|
Loading…
Reference in a new issue