• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResultHandlerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.zxing.client.android.result.ResultHandlerFactory的典型用法代码示例。如果您正苦于以下问题:Java ResultHandlerFactory类的具体用法?Java ResultHandlerFactory怎么用?Java ResultHandlerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResultHandlerFactory类属于com.google.zxing.client.android.result包,在下文中一共展示了ResultHandlerFactory类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult The contents of the barcode.
 * @param barcode   A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode) {
  lastResult = rawResult;
  ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

  boolean fromLiveScan = barcode != null;
  if (fromLiveScan) {
    drawResultPoints(barcode, rawResult);
  }

  switch (source) {
    case NATIVE_APP_INTENT:
    case PRODUCT_SEARCH_LINK:
      handleDecodeExternally(rawResult, resultHandler, barcode);
      break;
    case NONE:
      if (fromLiveScan) {
        String message = " (bulk scan)";
        Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
        // Wait a moment or else it will scan the same barcode continuously about 3 times
        restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
      } else {
      }
      break;
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:32,代码来源:AppInvCaptureActivity.java


示例2: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult The contents of the barcode.
 * @param scaleFactor amount by which thumbnail was scaled
 * @param barcode   A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
  inactivityTimer.onActivity();
  lastResult = rawResult;
  ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

  boolean fromLiveScan = barcode != null;
  if (fromLiveScan) {
    // Then not from history, so beep/vibrate and we have an image to draw on
    beepManager.playBeepSoundAndVibrate();
    drawResultPoints(barcode, scaleFactor, rawResult);
  }

  switch (source) {
    case NATIVE_APP_INTENT:
    case PRODUCT_SEARCH_LINK:
      handleDecodeExternally(rawResult, resultHandler, barcode);
      break;
    case ZXING_LINK:
      if (scanFromWebPageManager == null || !scanFromWebPageManager.isScanFromWebPage()) {
        handleDecodeInternally(rawResult, resultHandler, barcode);
      } else {
        handleDecodeExternally(rawResult, resultHandler, barcode);
      }
      break;
    case NONE:
      SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
      if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
        Toast.makeText(getApplicationContext(),
                       getResources().getString(R.string.msg_bulk_mode_scanned) + " (" + rawResult.getText() + ')',
                       Toast.LENGTH_SHORT).show();
        // Wait a moment or else it will scan the same barcode continuously about 3 times
        restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
      } else {
        handleDecodeInternally(rawResult, resultHandler, barcode);
      }
      break;
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:46,代码来源:CaptureActivity.java


示例3: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult The contents of the barcode.
 * @param barcode   A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode) {
  inactivityTimer.onActivity();
  lastResult = rawResult;
  ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

  boolean fromLiveScan = barcode != null;
  if (fromLiveScan) {
    historyManager.addHistoryItem(rawResult, resultHandler);
    // Then not from history, so beep/vibrate and we have an image to draw on
    beepManager.playBeepSoundAndVibrate();
    drawResultPoints(barcode, rawResult);
  }

  switch (source) {
    case NATIVE_APP_INTENT:
    case PRODUCT_SEARCH_LINK:
      handleDecodeExternally(rawResult, resultHandler, barcode);
      break;
    case ZXING_LINK:
      if (returnUrlTemplate == null){
        handleDecodeInternally(rawResult, resultHandler, barcode);
      } else {
        handleDecodeExternally(rawResult, resultHandler, barcode);
      }
      break;
    case NONE:
      SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
      if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
        String message = getResources().getString(fakeR.getId("string", "msg_bulk_mode_scanned"))
            + " (" + rawResult.getText() + ')';
        Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
        // Wait a moment or else it will scan the same barcode continuously about 3 times
        restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
      } else {
        handleDecodeInternally(rawResult, resultHandler, barcode);
      }
      break;
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:46,代码来源:CaptureActivity.java


示例4: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult The contents of the barcode.
 * @param scaleFactor amount by which thumbnail was scaled
 * @param barcode   A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
  inactivityTimer.onActivity();
  lastResult = rawResult;
  ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

  boolean fromLiveScan = barcode != null;
  if (fromLiveScan) {
    historyManager.addHistoryItem(rawResult, resultHandler);
    // Then not from history, so beep/vibrate and we have an image to draw on
    beepManager.playBeepSoundAndVibrate();
    drawResultPoints(barcode, scaleFactor, rawResult);
  }

  switch (source) {
    case NATIVE_APP_INTENT:
    case PRODUCT_SEARCH_LINK:
      handleDecodeExternally(rawResult, resultHandler, barcode);
      break;
    case ZXING_LINK:
      if (scanFromWebPageManager == null || !scanFromWebPageManager.isScanFromWebPage()) {
        handleDecodeInternally(rawResult, resultHandler, barcode);
      } else {
        handleDecodeExternally(rawResult, resultHandler, barcode);
      }
      break;
    case NONE:
      SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
      if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
        Toast.makeText(getApplicationContext(),
                       getResources().getString(R.string.msg_bulk_mode_scanned) + " (" + rawResult.getText() + ')',
                       Toast.LENGTH_SHORT).show();
        // Wait a moment or else it will scan the same barcode continuously about 3 times
        restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
      } else {
        handleDecodeInternally(rawResult, resultHandler, barcode);
      }
      break;
  }
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:47,代码来源:CaptureActivity.java


示例5: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult   The contents of the barcode.
 * @param scaleFactor amount by which thumbnail was scaled
 * @param barcode     A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
    inactivityTimer.onActivity();
    lastResult = rawResult;
    ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

    boolean fromLiveScan = barcode != null;
    if (fromLiveScan) {
        historyManager.addHistoryItem(rawResult, resultHandler);
        // Then not from history, so beep/vibrate and we have an image to draw on
        beepManager.playBeepSoundAndVibrate();
        drawResultPoints(barcode, scaleFactor, rawResult);
    }

    switch (source) {
        case NATIVE_APP_INTENT:
        case PRODUCT_SEARCH_LINK:
            handleDecodeExternally(rawResult, resultHandler, barcode);
            break;
        case ZXING_LINK:
            if (scanFromWebPageManager == null || !scanFromWebPageManager.isScanFromWebPage()) {
                handleDecodeInternally(rawResult, resultHandler, barcode);
            } else {
                handleDecodeExternally(rawResult, resultHandler, barcode);
            }
            break;
        case NONE:
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
            if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
                String message = getResources().getString(R.string.msg_bulk_mode_scanned)
                        + " (" + rawResult.getText() + ')';
                Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
                // Wait a moment or else it will scan the same barcode continuously about 3 times
                restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
            } else {
                handleDecodeInternally(rawResult, resultHandler, barcode);
            }
            break;
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:47,代码来源:CaptureActivity.java


示例6: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show
 * the results.
 * 
 * @param rawResult
 *            The contents of the barcode.
 * @param scaleFactor
 *            amount by which thumbnail was scaled
 * @param barcode
 *            A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
	inactivityTimer.onActivity();
	ScanResult resultHandler = ResultHandlerFactory.parseResult(rawResult);

	boolean fromLiveScan = barcode != null;
	if (fromLiveScan) {
		drawResultPoints(barcode, scaleFactor, rawResult);
	}

	handleDecodeInternally(rawResult, resultHandler, barcode);

}
 
开发者ID:bushidowallet,项目名称:bushido-android-app,代码行数:24,代码来源:BarcodeFragment.java


示例7: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
   * A valid barcode has been found, so give an indication of success and show the results.
   *
   * @param rawResult The contents of the barcode.
   * @param barcode   A greyscale bitmap of the camera data which was decoded.
   */
  public void handleDecode(Result rawResult, Bitmap barcode) {
    inactivityTimer.onActivity();
    lastResult = rawResult;
    ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

    boolean fromLiveScan = barcode != null;
    if (fromLiveScan) {
//      historyManager.addHistoryItem(rawResult, resultHandler);
      // Then not from history, so beep/vibrate and we have an image to draw on
      beepManager.playBeepSoundAndVibrate();
      drawResultPoints(barcode, rawResult);
    }

    switch (source) {
      case NATIVE_APP_INTENT:
      case PRODUCT_SEARCH_LINK:
        handleDecodeExternally(rawResult, resultHandler, barcode);
        break;
      case ZXING_LINK:
        if (returnUrlTemplate == null){
          handleDecodeInternally(rawResult, resultHandler, barcode);
        } else {
          handleDecodeExternally(rawResult, resultHandler, barcode);
        }
        break;
      case NONE:
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
          String message = getResources().getString(R.string.msg_bulk_mode_scanned)
              + " (" + rawResult.getText() + ')';
          Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
          // Wait a moment or else it will scan the same barcode continuously about 3 times
          restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
        } else {
          handleDecodeInternally(rawResult, resultHandler, barcode);
        }
        break;
    }
  }
 
开发者ID:credentials,项目名称:zxing_android_qr,代码行数:46,代码来源:CaptureActivity.java


示例8: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 * 
 * @param rawResult
 *            The contents of the barcode.
 * @param barcode
 *            A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode) {
    inactivityTimer.onActivity();
    lastResult = rawResult;
    ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

    boolean fromLiveScan = barcode != null;
    if (fromLiveScan) {
        historyManager.addHistoryItem(rawResult, resultHandler);
        // Then not from history, so beep/vibrate and we have an image to draw on
        beepManager.playBeepSoundAndVibrate();
        drawResultPoints(barcode, rawResult);
    }

    switch (source) {
    case NATIVE_APP_INTENT:
    case PRODUCT_SEARCH_LINK:
        handleDecodeExternally(rawResult, resultHandler, barcode);
        break;
    case ZXING_LINK:
        if (returnUrlTemplate == null) {
            handleDecodeInternally(rawResult, resultHandler, barcode);
        } else {
            handleDecodeExternally(rawResult, resultHandler, barcode);
        }
        break;
    case NONE:
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
            String message = getResources().getString(R.string.msg_bulk_mode_scanned) + " (" + rawResult.getText()
                    + ')';
            Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
            // Wait a moment or else it will scan the same barcode continuously about 3 times
            restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
        } else {
            handleDecodeInternally(rawResult, resultHandler, barcode);
        }
        break;
    }
}
 
开发者ID:thomas-bornschlegel,项目名称:AndroidMultiChannelMiddleware,代码行数:48,代码来源:CaptureActivity.java


示例9: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show
 * the results.
 * 
 * @param rawResult
 *            The contents of the barcode.
 * @param scaleFactor
 *            amount by which thumbnail was scaled
 * @param barcode
 *            A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
	inactivityTimer.onActivity();
	lastResult = rawResult;
	ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(
			this, rawResult);

	boolean fromLiveScan = barcode != null;
	if (fromLiveScan) {
		historyManager.addHistoryItem(rawResult, resultHandler);
		// Then not from history, so beep/vibrate and we have an image to
		// draw on
		beepManager.playBeepSoundAndVibrate();
		drawResultPoints(barcode, scaleFactor, rawResult);
	}

	switch (source) {
	case NATIVE_APP_INTENT:
	case PRODUCT_SEARCH_LINK:
		handleDecodeExternally(rawResult, resultHandler, barcode);
		break;
	case ZXING_LINK:
		if (scanFromWebPageManager == null
				|| !scanFromWebPageManager.isScanFromWebPage()) {
			handleDecodeInternally(rawResult, resultHandler, barcode);
		} else {
			handleDecodeExternally(rawResult, resultHandler, barcode);
		}
		break;
	case NONE:
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(this);
		if (fromLiveScan
				&& prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE,
						false)) {
			Toast.makeText(
					getApplicationContext(),
					getResources()
							.getString(R.string.msg_bulk_mode_scanned)
							+ " (" + rawResult.getText() + ')',
					Toast.LENGTH_SHORT).show();
			// Wait a moment or else it will scan the same barcode
			// continuously about 3 times
			restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
		} else {
			handleDecodeInternally(rawResult, resultHandler, barcode);
		}
		break;
	}
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:61,代码来源:CaptureActivity.java


示例10: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show
 * the results.
 *
 * @param rawResult
 *            The contents of the barcode.
 * @param scaleFactor
 *            amount by which thumbnail was scaled
 * @param barcode
 *            A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
	inactivityTimer.onActivity();
	lastResult = rawResult;
	ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);

	boolean fromLiveScan = barcode != null;
	if (fromLiveScan) {
		historyManager.addHistoryItem(rawResult, resultHandler);
		// Then not from history, so beep/vibrate and we have an image to
		// draw on
		beepManager.playBeepSoundAndVibrate();
		drawResultPoints(barcode, scaleFactor, rawResult);
	}

	switch (source) {
	case NATIVE_APP_INTENT:
	case PRODUCT_SEARCH_LINK:
		handleDecodeExternally(rawResult, resultHandler, barcode);
		break;
	case ZXING_LINK:
		if (scanFromWebPageManager == null || !scanFromWebPageManager.isScanFromWebPage()) {
			handleDecodeInternally(rawResult, resultHandler, barcode);
		} else {
			handleDecodeExternally(rawResult, resultHandler, barcode);
		}
		break;
	case NONE:
		SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
		if (fromLiveScan && prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
			Toast.makeText(getApplicationContext(),
					getResources().getString(R.string.msg_bulk_mode_scanned) + " (" + rawResult.getText() + ')',
					Toast.LENGTH_SHORT).show();
			// Wait a moment or else it will scan the same barcode
			// continuously about 3 times
			restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
		} else {
			handleDecodeInternally(rawResult, resultHandler, barcode);
		}
		break;
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:53,代码来源:CaptureActivity.java


示例11: handleDecode

import com.google.zxing.client.android.result.ResultHandlerFactory; //导入依赖的package包/类
/**
 * A valid barcode has been found, so give an indication of success and show the results.
 *
 * @param rawResult The contents of the barcode.
 * @param barcode   A greyscale bitmap of the camera data which was decoded.
 */
public void handleDecode(Result rawResult, Bitmap barcode) {
  inactivityTimer.onActivity();
  lastResult = rawResult;
  ResultHandler resultHandler = ResultHandlerFactory.makeResultHandler(this, rawResult);
  historyManager.addHistoryItem(rawResult, resultHandler);

  if (barcode == null) {
    // This is from history -- no saved barcode
    handleDecodeInternally(rawResult, resultHandler, null);
  } else {
    beepManager.playBeepSoundAndVibrate();
    drawResultPoints(barcode, rawResult);
    switch (source) {
      case NATIVE_APP_INTENT:
      case PRODUCT_SEARCH_LINK:
        handleDecodeExternally(rawResult, resultHandler, barcode);
        break;
      case ZXING_LINK:
        if (returnUrlTemplate == null){
          handleDecodeInternally(rawResult, resultHandler, barcode);
        } else {
          handleDecodeExternally(rawResult, resultHandler, barcode);
        }
        break;
      case NONE:
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (prefs.getBoolean(PreferencesActivity.KEY_BULK_MODE, false)) {
          Toast.makeText(this, R.string.msg_bulk_mode_scanned, Toast.LENGTH_SHORT).show();
          // Wait a moment or else it will scan the same barcode continuously about 3 times
          if (handler != null) {
            handler.sendEmptyMessageDelayed(R.id.restart_preview, BULK_MODE_SCAN_DELAY_MS);
          }
          resetStatusView();
        } else {
          handleDecodeInternally(rawResult, resultHandler, barcode);
        }
        break;
    }
  }
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:47,代码来源:CaptureActivity.java



注:本文中的com.google.zxing.client.android.result.ResultHandlerFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RegistrationIntentService类代码示例发布时间:2022-05-21
下一篇:
Java OpenCameraInterface类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap