资源简介
zxing.zip
代码片段和文件信息
package co.huiqu.zxing.activity;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Map;
import java.util.Vector;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Vibrator;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.onclickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.ChecksumException;
import com.google.zxing.DecodeHintType;
import com.google.zxing.FormatException;
import com.google.zxing.NotFoundException;
import com.google.zxing.Result;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeReader;
import co.huiqu.webapp.R;
import co.huiqu.zxing.camera.CameraManager;
import co.huiqu.zxing.decoding.CaptureActivityHandler;
import co.huiqu.zxing.decoding.InactivityTimer;
import co.huiqu.zxing.decoding.RGBLuminanceSource;
import co.huiqu.zxing.view.ViewfinderView;
/**
* Initial the camera
*
* @author zhangguoyu
*
*/
public class CaptureActivity extends Activity implements Callback {
private Button btnLight;
private Button btnOpenImage;
private boolean playBeep;
private boolean vibrate;
private boolean hasSurface;
private String characterSet;
private int ifOpenLight = 0;//判断是否开启闪光灯
private MediaPlayer mediaPlayer;
private ViewfinderView viewfinderView;
private CaptureActivityHandler handler;
private Vector decodeFormats;
private InactivityTimer inactivityTimer;
private static final float BEEP_VOLUME = 0.10f;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
setContentView(R.layout.act_capture);
CameraManager.init(getApplication());
viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
btnLight = (Button) findViewById(R.id.btn_light);
btnOpenImage = (Button) findViewById(R.id.btn_openimg);
hasSurface = false;
inactivityTimer = new InactivityTimer(this);
setListener();
}
/**
* 注册事件
*/
private void setListener() {
((TextView) findViewById(R.id.tv_left_title)).setonclickListener(new onclickListener() {
@Override
public void onclick(View v) {
onBackPres
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-08-22 12:33 zxing\
目录 0 2016-08-22 12:33 zxing\activity\
文件 10076 2016-06-14 14:43 zxing\activity\CaptureActivity.java
目录 0 2016-08-22 12:33 zxing\camera\
文件 1567 2016-06-14 11:44 zxing\camera\AutoFocusCallback.java
文件 8962 2016-06-14 13:23 zxing\camera\CameraConfigurationManager.java
文件 12221 2016-06-14 13:02 zxing\camera\CameraManager.java
文件 4881 2016-06-14 11:44 zxing\camera\FlashlightManager.java
文件 4072 2016-06-14 11:44 zxing\camera\PlanarYUVLuminanceSource.java
文件 1970 2016-06-14 11:44 zxing\camera\PreviewCallback.java
目录 0 2016-08-22 12:33 zxing\decoding\
文件 4837 2016-06-14 11:45 zxing\decoding\CaptureActivityHandler.java
文件 3744 2016-06-14 11:49 zxing\decoding\DecodeFormatManager.java
文件 3773 2016-06-14 11:49 zxing\decoding\DecodeHandler.java
文件 2554 2016-06-14 11:49 zxing\decoding\DecodeThread.java
文件 1264 2016-06-14 11:44 zxing\decoding\FinishListener.java
文件 2094 2016-06-14 11:44 zxing\decoding\InactivityTimer.java
文件 6159 2016-06-14 11:44 zxing\decoding\Intents.java
文件 3127 2016-06-14 11:44 zxing\decoding\RGBLuminanceSource.java
目录 0 2016-08-22 12:34 zxing\layout\
文件 3045 2016-06-30 16:39 zxing\layout\act_capture.xm
文件 67 2016-08-22 12:33 zxing\layout\说明.txt
目录 0 2016-08-22 12:33 zxing\view\
文件 1083 2016-06-14 11:44 zxing\view\ViewfinderResultPointCallback.java
文件 7376 2016-06-14 13:57 zxing\view\ViewfinderView.java
- 上一篇:React Native 瀑布流列表
- 下一篇:冒险岛078登录器网关配套
相关资源
- aa.txt
- Reg1024抢码工具_20141216.rar
- 跑马灯.rar
- Brother操作说明书(数据)_通信节选
- dw2xls和谐补丁.rar
- VMware11.x注册机10.x注册机11.x永久不过
- 微信授权登录.rar
- 20161209163650812.rar
- my-three-MiniProgram.zip
- ESO.rar
- 4.doc
- 20170317095710255.rar
- layui.layim.zip
- arcgis10.2.2网盘地址.txt
- rar(18)
- pdf(11)
- wangpan.txt
- 1949-1987和1992-2015历年林业统计年鉴.
-
ECMAsc
ript6入门.epub - png
- 播放黑屏的需要先安装视频驱动.txt
- 开源老虎微信淘宝客v5.99.34+代理2.99
- 蚁群时间窗.zip
- UDP通信.rar
- 织梦V5.7火车头采集器全套Web发布模块
- 8086交通灯_基于Proteus仿真.rar
- Class5_SequenceModels_URL.txt
- ICN2053_编程指导_重庆祥展科技(1)
- SpringBoot企业微信点餐系统.txt
- vm安装苹果macosMojave系统10.14_cdr(1)
评论
共有 条评论