當前位置: 首頁>>代碼示例>>Java>>正文


Java IntentIntegrator.setDesiredBarcodeFormats方法代碼示例

本文整理匯總了Java中com.google.zxing.integration.android.IntentIntegrator.setDesiredBarcodeFormats方法的典型用法代碼示例。如果您正苦於以下問題:Java IntentIntegrator.setDesiredBarcodeFormats方法的具體用法?Java IntentIntegrator.setDesiredBarcodeFormats怎麽用?Java IntentIntegrator.setDesiredBarcodeFormats使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.zxing.integration.android.IntentIntegrator的用法示例。


在下文中一共展示了IntentIntegrator.setDesiredBarcodeFormats方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
    case R.id.action_refresh:
      createWeexInstance();
      renderPage();
      break;
    case R.id.action_scan:
      IntentIntegrator integrator = new IntentIntegrator(this);
      integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
      integrator.setPrompt("Scan a barcode");
      //integrator.setCameraId(0);  // Use a specific camera of the device
      integrator.setBeepEnabled(true);
      integrator.setOrientationLocked(false);
      integrator.setBarcodeImageEnabled(true);
      integrator.setPrompt(getString(R.string.capture_qrcode_prompt));
      integrator.initiateScan();
      break;
    case android.R.id.home:
      finish();
    default:
      break;
  }

  return super.onOptionsItemSelected(item);
}
 
開發者ID:wangwei123,項目名稱:my-weex,代碼行數:27,代碼來源:WXPageActivity.java

示例2: onClick

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if (textBack.equals(v)) {
        finish();
    } else if (textScan.equals(v)) {
        IntentIntegrator integrator = new IntentIntegrator(this);
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setPrompt("Scan a barcode");
        //integrator.setCameraId(0);  // Use a specific camera of the device
        integrator.setBeepEnabled(true);
        integrator.setOrientationLocked(false);
        integrator.setBarcodeImageEnabled(true);
        integrator.setPrompt("請將條碼置於取景框內掃描");
        integrator.initiateScan();
    } else if (btnSave.equals(v)) {
        save();
    } else if (btnReset.equals(v)) {
        save();
        AppExitUtil.restart(this);
    } else if (btnOpen.equals(v)) {
        String page = editOpen.getText().toString().trim();
        UWXJumpUtil.openPage(this, page);
    }
}
 
開發者ID:weexext,項目名稱:ucar-weex-core,代碼行數:25,代碼來源:WXDebugActivity.java

示例3: callScanner

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
/**
 * Inicia el lector de barras.
 * Devuelve el resultado por {@link #onActivityResult(int, int, Intent)}.
 */
private void callScanner() {
    IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
    integrator.setPrompt(getString(R.string.balance_align_barcode));
    integrator.setBeepEnabled(false);
    integrator.setBarcodeImageEnabled(true);
    integrator.initiateScan();
}
 
開發者ID:AIDEA775,項目名稱:UNCmorfi,代碼行數:13,代碼來源:BalanceFragment.java

示例4: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_refresh:
            createWeexInstance();
            renderPage();
            break;
        case R.id.action_scan:
            IntentIntegrator integrator = new IntentIntegrator(this);
            integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
            integrator.setPrompt("Scan a barcode");
            //integrator.setCameraId(0);  // Use a specific camera of the device
            integrator.setBeepEnabled(true);
            integrator.setOrientationLocked(false);
            integrator.setBarcodeImageEnabled(true);
            integrator.initiateScan();
            //scanQrCode();
            break;
        default:
            break;
    }

    return super.onOptionsItemSelected(item);
}
 
開發者ID:dodola,項目名稱:WeexOne,代碼行數:25,代碼來源:IndexActivity.java

示例5: actionSearchQrcode

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void actionSearchQrcode() {
        IntentIntegrator integrator = new IntentIntegrator(getActivity());
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        integrator.initiateScan();
//        Intent intent = new Intent(getActivity(), FindByQrCode.class);
//        intent.putExtra(FindByQrCode.SCAN_QR_CODE, true);
//        startActivityForResult(intent, MainActivity.RESULT_SCAN);
    }
 
開發者ID:duniter,項目名稱:duniter-android-app,代碼行數:10,代碼來源:IdentityListFragment.java

示例6: zxingScan

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
/**
 * This method handles the communication to the ZXING API -> Apache License 2.0
 * For more information please check out the link below.
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */
public void zxingScan(){
    IntentIntegrator integrator = new IntentIntegrator(activity);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);
    integrator.setPrompt((String) getResources().getText(R.string.xzing_label));
    integrator.setCameraId(0);
    integrator.setBeepEnabled(false);
    integrator.setBarcodeImageEnabled(false);
    integrator.initiateScan();
}
 
開發者ID:Fr4gorSoftware,項目名稱:SecScanQR,代碼行數:16,代碼來源:MainActivity.java

示例7: scan

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void scan() {

        integrator = new IntentIntegrator(this);
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setCameraId(EssensbonUtils.getPreferredCamera());
        integrator.setOrientationLocked(true);
        integrator.setBeepEnabled(false);
        integrator.setCaptureActivity(ScanActivity.class);
        integrator.setPrompt("");
        integrator.initiateScan();

    }
 
開發者ID:LCA311,項目名稱:leoapp-sources,代碼行數:13,代碼來源:EssensbonActivity.java

示例8: openQRScanner

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
void openQRScanner() {
    IntentIntegrator integrator = new IntentIntegrator(getActivity());
    integrator.initiateScan();
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setPrompt("Scan a qr code");
    integrator.initiateScan();
}
 
開發者ID:humaniq,項目名稱:humaniq-android,代碼行數:8,代碼來源:TransferCoinsFragment.java

示例9: openScanner

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void openScanner(){
    IntentIntegrator integrator = new IntentIntegrator(getActivity());
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setPrompt(getString(R.string.qr_scanner_message));
    integrator.setBeepEnabled(false);
    integrator.initiateScan();
}
 
開發者ID:casific,項目名稱:murmur,代碼行數:8,代碼來源:ContactsFragment.java

示例10: joinGame

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void joinGame ()
{
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setPrompt("Scan");
    integrator.setCameraId(0);
    integrator.setBeepEnabled(false);
    integrator.initiateScan();
}
 
開發者ID:rhintersteininger,項目名稱:open-wheels,代碼行數:10,代碼來源:LobbyActivity.java

示例11: takeQrCodePicture

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void takeQrCodePicture() {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setCaptureActivity(MyCaptureActivity.class);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setOrientationLocked(false);
    integrator.addExtra(Intents.Scan.BARCODE_IMAGE_ENABLED, true);
    integrator.initiateScan();
}
 
開發者ID:mirioeggmann,項目名稱:appquest-pedometer,代碼行數:9,代碼來源:WalkActivity.java

示例12: actionScanQrCode

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void actionScanQrCode() {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    integrator.initiateScan();

}
 
開發者ID:duniter,項目名稱:duniter-android-app,代碼行數:8,代碼來源:TransferActivity.java

示例13: configureIntentIntegrator

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
/**
 * Configures the QR Code scanner with invariable parameters
 *
 * @param intentIntegrator the IntentIntegrator to configure
 * @param promptString     the text to display in the prompt of the QR Code scanner overlay
 */
private static void configureIntentIntegrator(IntentIntegrator intentIntegrator,
                                              String promptString) {
    if (null == intentIntegrator) {
        return;
    }
    intentIntegrator.setPrompt(promptString);
    intentIntegrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    intentIntegrator.setCaptureActivity(QRCodeScannerActivity.class);
    intentIntegrator.setBarcodeImageEnabled(true);
    intentIntegrator.setOrientationLocked(false);
    intentIntegrator.initiateScan();
}
 
開發者ID:savoirfairelinux,項目名稱:ring-client-android,代碼行數:19,代碼來源:QRCodeScannerActivity.java

示例14: scanQRCode

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void scanQRCode(View v) {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setOrientationLocked(true);
    integrator.setCameraId(0);
    integrator.setBeepEnabled(true);
    integrator.initiateScan();
}
 
開發者ID:pili-engineering,項目名稱:PLDroidMediaStreaming,代碼行數:9,代碼來源:MainActivity.java

示例15: doScan

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void doScan() {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);
    integrator.setOrientationLocked(true);
    integrator.setTimeout(30 * 1000);
    integrator.setBeepEnabled(false);
    integrator.setPrompt(getString(R.string.scan_barcode));
    integrator.initiateScan();
}
 
開發者ID:citiususc,項目名稱:calendula,代碼行數:10,代碼來源:MedicinesSearchActivity.java


注:本文中的com.google.zxing.integration.android.IntentIntegrator.setDesiredBarcodeFormats方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。