• 大小: 1.03MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-23
  • 语言: Java
  • 标签: 二维码  

资源简介

快速扫描二维码,跟微信差不多,比QQ的快,扫描的代码模块做了封装,其他的容易更改,不会影响关键代码,更适合敏捷开发。

资源截图

代码片段和文件信息

/*
 * Copyright (C) 2008 ZXing authors
 *
 * Licensed under the Apache License Version 2.0 (the “License“);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing software
 * distributed under the License is distributed on an “AS IS“ BASIS
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.dtr.zxing.activity;

import java.io.IOException;
import java.lang.reflect.Field;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.dtr.zxing.R;
import com.dtr.zxing.camera.CameraManager;
import com.dtr.zxing.decode.DecodeThread;
import com.dtr.zxing.utils.BeepManager;
import com.dtr.zxing.utils.CaptureActivityHandler;
import com.dtr.zxing.utils.InactivityTimer;
import com.google.zxing.Result;

/**
 * This activity opens the camera and does the actual scanning on a background
 * thread. It draws a viewfinder to help the user place the barcode correctly
 * shows feedback as the image processing is happening and then overlays the
 * results when a scan is successful.
 * 
 * @author dswitkin@google.com (Daniel Switkin)
 * @author Sean Owen
 */
public final class CaptureActivity extends Activity implements SurfaceHolder.Callback {

private static final String TAG = CaptureActivity.class.getSimpleName();

private CameraManager cameraManager;
private CaptureActivityHandler handler;
private InactivityTimer inactivityTimer;
private BeepManager beepManager;

private SurfaceView scanPreview = null;
private RelativeLayout scanContainer;
private RelativeLayout scanCropView;
private ImageView scanLine;

private Rect mCropRect = null;

public Handler getHandler() {
return handler;
}

public CameraManager getCameraManager() {
return cameraManager;
}

private boolean isHasSurface = false;

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);

Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_capture);

scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
scanLine = (ImageView) findViewById(R.i

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-10-16 14:43  ZXingProject-master\
     文件         290  2014-10-16 14:43  ZXingProject-master\.gitignore
     文件        1081  2014-10-16 14:43  ZXingProject-master\LICENSE
     文件         120  2014-10-16 14:43  ZXingProject-master\README.md
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\
     文件         466  2014-10-16 14:43  ZXingProject-master\ZXingProj\.classpath
     文件         812  2014-10-16 14:43  ZXingProject-master\ZXingProj\.project
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\.settings\
     文件         173  2014-10-16 14:43  ZXingProject-master\ZXingProj\.settings\org.eclipse.jdt.core.prefs
     文件        1667  2014-10-16 14:43  ZXingProject-master\ZXingProj\AndroidManifest.xml
     文件       51394  2014-10-16 14:43  ZXingProject-master\ZXingProj\ic_launcher-web.png
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\libs\
     文件     1000515  2014-10-16 14:43  ZXingProject-master\ZXingProj\libs\zxing.jar
     文件         159  2014-10-16 14:43  ZXingProject-master\ZXingProj\lint.xml
     文件         781  2014-10-16 14:43  ZXingProject-master\ZXingProj\proguard-project.txt
     文件         563  2014-10-16 14:43  ZXingProject-master\ZXingProj\project.properties
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-hdpi\
     文件        7658  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-hdpi\ic_launcher.png
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-mdpi\
     文件        3777  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-mdpi\ic_launcher.png
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xhdpi\
     文件       12516  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xhdpi\ic_launcher.png
     文件        2336  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xhdpi\qr_code_bg.9.png
     文件        6413  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xhdpi\scan_line.png
     文件       17926  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xhdpi\shadow.png
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xxhdpi\
     文件       24777  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\drawable-xxhdpi\ic_launcher.png
     目录           0  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\layout\
     文件        2838  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\layout\activity_capture.xml
     文件        1021  2014-10-16 14:43  ZXingProject-master\ZXingProj\res\layout\activity_result.xml
............此处省略32个文件信息

评论

共有 条评论