- Fixed Issue 892: Barcode Scanner crashes when started via Intent with scanning rectangle dimensions.

- Updated What's New page.
- Bumped Android SDK version.


git-svn-id: https://zxing.googlecode.com/svn/trunk@1847 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin@google.com 2011-07-06 15:43:55 +00:00
parent 4a545af746
commit a3ec3038dd
6 changed files with 41 additions and 23 deletions

View file

@ -8,6 +8,9 @@
<ul>
<li>Fixed a couple of crashes.</li>
<li>Made items in the History easier to read.</li>
<li>New Indonesian and Greek translations.</li>
<li>Fixes for Slovakian, Hebrew, and Danish translations.</li>
<li>Prevented secure URIs from being added to History or copied to the clipboard.</li>
</ul>
<p><b>New in version 3.6:</b></p>
<ul>

View file

@ -8,4 +8,4 @@
# project structure.
# Project target.
target=android-9
target=android-10

View file

@ -71,6 +71,9 @@ public final class CameraManager {
private boolean previewing;
private boolean reverseImage;
private final boolean useOneShotPreviewCallback;
private int requestedFramingRectWidth;
private int requestedFramingRectHeight;
/**
* Preview frames are delivered here, which we pass on to the registered handler. Make sure to
* clear the handler so it will only receive one message.
@ -132,6 +135,11 @@ public final class CameraManager {
if (!initialized) {
initialized = true;
configManager.initFromCameraParameters(camera);
if (requestedFramingRectWidth > 0 && requestedFramingRectHeight > 0) {
setManualFramingRect(requestedFramingRectWidth, requestedFramingRectHeight);
requestedFramingRectWidth = 0;
requestedFramingRectHeight = 0;
}
}
configManager.setDesiredCameraParameters(camera);
@ -275,18 +283,23 @@ public final class CameraManager {
* @param height The height in pixels to scan.
*/
public void setManualFramingRect(int width, int height) {
Point screenResolution = configManager.getScreenResolution();
if (width > screenResolution.x) {
width = screenResolution.x;
if (initialized) {
Point screenResolution = configManager.getScreenResolution();
if (width > screenResolution.x) {
width = screenResolution.x;
}
if (height > screenResolution.y) {
height = screenResolution.y;
}
int leftOffset = (screenResolution.x - width) / 2;
int topOffset = (screenResolution.y - height) / 2;
framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height);
Log.d(TAG, "Calculated manual framing rect: " + framingRect);
framingRectInPreview = null;
} else {
requestedFramingRectWidth = width;
requestedFramingRectHeight = height;
}
if (height > screenResolution.y) {
height = screenResolution.y;
}
int leftOffset = (screenResolution.x - width) / 2;
int topOffset = (screenResolution.y - height) / 2;
framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height);
Log.d(TAG, "Calculated manual framing rect: " + framingRect);
framingRectInPreview = null;
}
/**

View file

@ -18,14 +18,16 @@
package="com.google.zxing.client.androidtest"
android:versionName="1.12"
android:versionCode="4">
<!-- We require Cupcake (Android 1.5) or later. -->
<uses-sdk android:minSdkVersion="3"/>
<!-- Donut-specific flags which allow us to run on large and high dpi screens. -->
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<!-- We require Cupcake (Android 1.5) or later, but are really targeting Donut. -->
<uses-sdk android:minSdkVersion="3"
android:targetSdkVersion="4"/>
<!-- Donut-specific flags which allow us to run on any dpi screens. -->
<supports-screens android:xlargeScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-feature android:name="android.hardware.camera"/>
<application android:label="@string/app_name"
android:icon="@drawable/icon"
android:debuggable="true">

View file

@ -8,4 +8,4 @@
# project structure.
# Project target.
target=Google Inc.:Google APIs:4
target=android-10

View file

@ -1,7 +1,7 @@
version=1.6
# Set to the location where ProGuard's proguard.jar file can be found
#proguard-jar=
proguard-jar=/Users/dswitkin/Source/android-sdk/tools/proguard/lib/proguard.jar
# If you are building the J2ME client:
#
@ -28,7 +28,7 @@ version=1.6
# Set this to the location where you installed the Android SDK.
#android-home=C:\\Program Files\\android-sdk-windows
#android-home=/usr/local/android
android-home=/Users/dswitkin/Source/android-sdk
# Set this to the location of a Tomcat installation if you want to compile and run the zxing.org
# web site and web application