本文整理汇总了Java中com.google.zxing.integration.android.IntentIntegrator.setOrientationLocked方法的典型用法代码示例。如果您正苦于以下问题:Java IntentIntegrator.setOrientationLocked方法的具体用法?Java IntentIntegrator.setOrientationLocked怎么用?Java IntentIntegrator.setOrientationLocked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.integration.android.IntentIntegrator
的用法示例。
在下文中一共展示了IntentIntegrator.setOrientationLocked方法的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);
}
示例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);
}
}
示例3: 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);
}
示例4: decodeUseCamera
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
private void decodeUseCamera() {
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
integrator.setBeepEnabled(true);
integrator.setBarcodeImageEnabled(true);
integrator.setOrientationLocked(true);
integrator.initiateScan();
}
示例5: 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();
}
示例6: scan
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@OnClick(R.id.btn_qr_scan)
void scan() {
IntentIntegrator integrator = new IntentIntegrator(AddSiteActivity.this);
integrator.setCaptureActivity(MyCaptureActivity.class);
integrator.setOrientationLocked(true);
integrator.setPrompt("请扫描二维码");
integrator.addExtra("SCAN_WIDTH", 480);
integrator.addExtra("SCAN_HEIGHT", 480);
integrator.initiateScan(IntentIntegrator.QR_CODE_TYPES);
}
示例7: MainController
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public MainController(Activity activity){
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setOrientationLocked(true);
integrator.setBeepEnabled(false);
integrator.setCaptureActivity(ReadQRCodeScreen.class);
integrator.initiateScan();
}
示例8: startScanActivity
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
private void startScanActivity() {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCaptureActivity(CustomCaptureActivity.class);
integrator.setOrientationLocked(false);
integrator.initiateScan();
}
示例9: 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();
}
示例10: scanFromFragment
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public void scanFromFragment() {
IntentIntegrator integrator = IntentIntegrator.forFragment(this);
integrator.setCaptureActivity(MyCaptureActivity.class);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
integrator.setBeepEnabled(prefs.getBoolean("beep", true));
integrator.setOrientationLocked(false);
integrator.setPrompt(getResources().getString(R.string.scan_text));
integrator.initiateScan();
}
示例11: onOptionsItemSelected
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.webModeration:
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setCaptureActivity(CaptureActivityAnyOrientation.class);
integrator.setOrientationLocked(false);
integrator.initiateScan();
}
return super.onOptionsItemSelected(item);
}
示例12: ScanModule
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public ScanModule(MainActivity currentActivity) {
super();
mIntentIntegrator = new IntentIntegrator(currentActivity);
mIntentIntegrator.setOrientationLocked(true);
mIntentIntegrator.setCaptureActivity(YeeuuCaptureActivity.class);
currentActivity.getActivityResultManager().put(IntentIntegrator.REQUEST_CODE, this);
}
示例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();
}
示例14: startBarcodeScan
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
* Start scanning activity with any screen orientation
*/
private void startBarcodeScan() {
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
integrator.setCaptureActivity(CaptureAnyOrientationActivity.class);
integrator.setOrientationLocked(false);
integrator.initiateScan();
}
示例15: 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();
}