use of com.github.barcodeeye.scan.api.CardPresenter in project BarcodeEye by BarcodeEye.
the class ProductResultProcessor method getCardResults.
@Override
public List<CardPresenter> getCardResults() {
List<CardPresenter> cardPresenters = new ArrayList<CardPresenter>();
ParsedResult parsedResult = getParsedResult();
String codeValue = parsedResult.getDisplayResult();
for (String key : PRODUCT_SEARCH_ENDPOINTS.keySet()) {
CardPresenter cardPresenter = new CardPresenter();
cardPresenter.setText("Lookup on " + key).setFooter(codeValue);
String url = PRODUCT_SEARCH_ENDPOINTS.get(key);
url = url.replace("{CODE}", codeValue);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
cardPresenter.setPendingIntent(createPendingIntent(getContext(), intent));
if (getPhotoUri() != null) {
cardPresenter.addImage(getPhotoUri());
}
cardPresenters.add(cardPresenter);
}
return cardPresenters;
}
use of com.github.barcodeeye.scan.api.CardPresenter in project BarcodeEye by BarcodeEye.
the class TextResultProcessor method getCardResults.
@Override
public List<CardPresenter> getCardResults() {
List<CardPresenter> cardPresenters = new ArrayList<CardPresenter>();
ParsedResult parsedResult = getParsedResult();
String codeValue = parsedResult.getDisplayResult();
CardPresenter cardPresenter = new CardPresenter();
cardPresenter.setText("Search Web").setFooter(codeValue);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(String.format(SEARCH_URL, codeValue)));
cardPresenter.setPendingIntent(createPendingIntent(getContext(), intent));
cardPresenters.add(cardPresenter);
return cardPresenters;
}
use of com.github.barcodeeye.scan.api.CardPresenter in project BarcodeEye by BarcodeEye.
the class UriResultProcessor method getCardResults.
@Override
public List<CardPresenter> getCardResults() {
List<CardPresenter> cardResults = new ArrayList<CardPresenter>();
URIParsedResult parsedResult = getParsedResult();
CardPresenter cardPresenter = new CardPresenter().setText("Open in Browser").setFooter(parsedResult.getDisplayResult());
if (getPhotoUri() != null) {
cardPresenter.addImage(getPhotoUri());
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(parsedResult.getURI()));
cardPresenter.setPendingIntent(createPendingIntent(getContext(), intent));
cardResults.add(cardPresenter);
return cardResults;
}
use of com.github.barcodeeye.scan.api.CardPresenter in project BarcodeEye by BarcodeEye.
the class IsbnResultProcessor method getCardResults.
@Override
public List<CardPresenter> getCardResults() {
List<CardPresenter> cardPresenters = new ArrayList<CardPresenter>();
ParsedResult parsedResult = getParsedResult();
String codeValue = parsedResult.getDisplayResult();
for (String key : PRODUCT_SEARCH_ENDPOINTS.keySet()) {
CardPresenter cardPresenter = new CardPresenter();
cardPresenter.setText("Lookup on " + key).setFooter(codeValue);
String url = PRODUCT_SEARCH_ENDPOINTS.get(key);
url = url.replace("{CODE}", codeValue);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
cardPresenter.setPendingIntent(createPendingIntent(getContext(), intent));
if (getPhotoUri() != null) {
cardPresenter.addImage(getPhotoUri());
}
cardPresenters.add(cardPresenter);
}
return cardPresenters;
}
Aggregations