Java 类com.google.zxing.client.android.result.ResultHandlerFactory 实例源码

项目:appinventor-extensions    文件:AppInvCaptureActivity.java   
/**
 * 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;
  }
}
项目:keepass2android    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:KeePass2Android    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:sres-app    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:faims-android    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:Discounty    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:bushido-android-app    文件:BarcodeFragment.java   
/**
 * 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);

}
项目:reacteu-app    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:CordovaDemo    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:ng-cordova-demo    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:ngCordova-demo    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:CordovaW8BarcodeDemo    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:zxing-android-portrait    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:cordova-template    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:oxPush    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:hive-ios    文件:CaptureActivity.java   
/**
 * 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;
  }
}
项目:zxing_android_qr    文件:CaptureActivity.java   
/**
   * 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;
    }
  }
项目:AndroidMultiChannelMiddleware    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:weex-3d-map    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:PortraitZXing    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:PortraitZXing    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:PortraitZXing    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:PortraitZXing    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:weex-analyzer-android    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:weex-3d-map    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:Weex-TestDemo    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:weex    文件:CaptureActivity.java   
/**
 * 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;
    }
}
项目:BibSearch    文件:CaptureActivity.java   
/**
 * 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;
    }
  }
}