本文整理汇总了Java中com.xys.libzxing.zxing.activity.CaptureActivity类的典型用法代码示例。如果您正苦于以下问题:Java CaptureActivity类的具体用法?Java CaptureActivity怎么用?Java CaptureActivity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CaptureActivity类属于com.xys.libzxing.zxing.activity包,在下文中一共展示了CaptureActivity类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onRequestPermissionsResult
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
switch (requestCode) {
case StaticClass.SMS_PER_CODE:
if (grantResults.length > 0 && grantResults[0] == PackageManager
.PERMISSION_GRANTED) {
switchSms();
} else {
Toast.makeText(this, "You denied the permission", Toast.LENGTH_SHORT)
.show();
mSwSms.setSelected(false);
ShareUtil.putBoolean(this, "isSms", mSwSms.isChecked());
}
break;
case QRCODE_RESULT:
Intent openCameraIntent = new Intent(SettingActivity.this, CaptureActivity
.class);
startActivityForResult(openCameraIntent, QRCODE_RESULT);
break;
default:
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
开发者ID:Hultron,项目名称:LifeHelper,代码行数:25,代码来源:SettingActivity.java
示例2: CaptureActivityHandler
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
public CaptureActivityHandler(CaptureActivity activity, CameraManager cameraManager, int decodeMode) {
this.activity = activity;
decodeThread = new DecodeThread(activity, decodeMode);
decodeThread.start();
state = State.SUCCESS;
// Start ourselves capturing previews and decoding.
this.cameraManager = cameraManager;
cameraManager.startPreview();
restartPreviewAndDecode();
}
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:12,代码来源:CaptureActivityHandler.java
示例3: DecodeThread
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
public DecodeThread(CaptureActivity activity, int decodeMode) {
this.activity = activity;
handlerInitLatch = new CountDownLatch(1);
hints = new EnumMap<DecodeHintType, Object>(DecodeHintType.class);
Collection<BarcodeFormat> decodeFormats = new ArrayList<BarcodeFormat>();
decodeFormats.addAll(EnumSet.of(BarcodeFormat.AZTEC));
decodeFormats.addAll(EnumSet.of(BarcodeFormat.PDF_417));
switch (decodeMode) {
case BARCODE_MODE:
decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats());
break;
case QRCODE_MODE:
decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats());
break;
case ALL_MODE:
decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats());
decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats());
break;
default:
break;
}
hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
}
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:32,代码来源:DecodeThread.java
示例4: start
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
/**
* 用于启动扫码的Activity,启动之前要做权限判断。
*/
@LuaViewApi
public void start() {
if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {//还没有授予权限
if (ActivityCompat.shouldShowRequestPermissionRationale(mActivity, Manifest.permission.CAMERA)) {
Toast.makeText(mActivity, "Please Allow the Camera permission.", Toast.LENGTH_SHORT).show();
} else {
ActivityCompat.requestPermissions(mActivity, new String[]{Manifest.permission.CAMERA}, MainActivity.REQUEST_CAMERA);
}
} else {
mActivity.startActivityForResult(new Intent(mActivity , CaptureActivity.class) , 0);
}
}
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:16,代码来源:ScanBridge.java
示例5: onRequestPermissionsResult
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case REQUEST_CAMERA:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
this.startActivityForResult(new Intent(this , CaptureActivity.class) , 0);
} else {
Toast.makeText(this, "Camera Permission Denied.", Toast.LENGTH_SHORT).show();
}
break;
default:
break;
}
}
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:16,代码来源:MainActivity.java
示例6: onClick
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.sw_speak:
//切换相反
sw_speak.setSelected(!sw_speak.isSelected());
//保存状态
ShareUtil.putBoolean(this, "isSpeak", sw_speak.isChecked());
break;
case R.id.sw_sms:
//切换相反
sw_sms.setSelected(!sw_sms.isSelected());
//保存状态
ShareUtil.putBoolean(this, "isSms", sw_sms.isChecked());
if (sw_sms.isChecked()) {
startService(new Intent(this, SmsService.class));
} else {
stopService(new Intent(this, SmsService.class));
}
break;
case R.id.ll_scan:
L.i("ll_scan");
//打开扫描界面扫描条形码或二维码
Intent openCameraIntent = new Intent(this, CaptureActivity.class);
startActivityForResult(openCameraIntent, 0);
break;
case R.id.ll_qr_code:
startActivity(new Intent(this, QrCodeActivity.class));
break;
case R.id.ll_about:
startActivity(new Intent(this,AboutActivity.class));
break;
}
}
开发者ID:lijizhi,项目名称:studydemo,代码行数:38,代码来源:SettingActivity.java
示例7: DecodeHandler
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
public DecodeHandler(CaptureActivity activity, Map<DecodeHintType, Object> hints) {
multiFormatReader = new MultiFormatReader();
multiFormatReader.setHints(hints);
this.activity = activity;
}
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:6,代码来源:DecodeHandler.java
示例8: onClick
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.sw_speak:
//切换相反
mSwSpeack.setSelected(!mSwSpeack.isChecked());
//保存状态
ShareUtil.putBoolean(this, "isSpeak", mSwSpeack.isChecked());
break;
case R.id.sw_sms:
if (Build.VERSION.SDK_INT >= 23) {
requestDrawOverLays();
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECEIVE_SMS},
StaticClass.SMS_PER_CODE);
} else {
switchSms();
}
break;
case R.id.ll_update:
/*步骤:
* 1.请求服务器的配置文件,拿到code
* 2.比较
* 3.dialog
* 4.跳转到更新界面并且把url传递过去*/
RxVolley.get(StaticClass.CHECK_UPDATE_URL, new HttpCallback() {
@Override
public void onSuccess(String t) {
LogUtil.i(t);
parsingJson(t);
}
});
break;
case R.id.qrcode_scan:
//打开扫描界面扫描条形码或二维码
if (ContextCompat.checkSelfPermission(SettingActivity.this, Manifest.permission
.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(SettingActivity.this, new String[]{Manifest
.permission.CAMERA}, REQUEST_CAMERA_CODE);
} else {
Intent openCameraIntent = new Intent(SettingActivity.this, CaptureActivity
.class);
startActivityForResult(openCameraIntent, QRCODE_RESULT);
}
break;
case R.id.qrcode_share:
startActivity(new Intent(this, QrCodeShareActivity.class));
break;
case R.id.my_location:
startActivity(new Intent(this, LocationActivity.class));
break;
}
}
开发者ID:Hultron,项目名称:LifeHelper,代码行数:57,代码来源:SettingActivity.java
示例9: scan
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
public void scan(View view) {
startActivityForResult(new Intent(MainActivity.this, CaptureActivity.class), 0);
}
开发者ID:Cherry-Gun,项目名称:QRCode,代码行数:4,代码来源:MainActivity.java
示例10: onClick
import com.xys.libzxing.zxing.activity.CaptureActivity; //导入依赖的package包/类
@Override
public void onClick(View arg0) {
Intent intent = new Intent(LinkActivity.this, CaptureActivity.class);
startActivityForResult(intent, 1);
}
开发者ID:1anc3r,项目名称:AirFree-Client,代码行数:6,代码来源:LinkActivity.java
注:本文中的com.xys.libzxing.zxing.activity.CaptureActivity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论