mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Minor style tweaks
git-svn-id: https://zxing.googlecode.com/svn/trunk@503 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
42940c4580
commit
6d124e1be5
|
@ -275,7 +275,9 @@ final class CameraManager {
|
|||
int previewHeight = (int) (stillResolution.x * stillMultiplier * 1.5f);
|
||||
int previewWidth = previewHeight * screenResolution.x / screenResolution.y;
|
||||
previewWidth = ((previewWidth + 7) >> 3) << 3;
|
||||
if (previewWidth > cameraResolution.x) previewWidth = cameraResolution.x;
|
||||
if (previewWidth > cameraResolution.x) {
|
||||
previewWidth = cameraResolution.x;
|
||||
}
|
||||
previewHeight = previewWidth * screenResolution.y / screenResolution.x;
|
||||
previewResolution = new Point(previewWidth, previewHeight);
|
||||
Log.v(TAG, "previewWidth " + previewWidth + " previewHeight " + previewHeight);
|
||||
|
|
|
@ -214,9 +214,8 @@ final class DecodeThread extends Thread {
|
|||
return null;
|
||||
}
|
||||
|
||||
private String getNewPhotoName() {
|
||||
Date now = new Date();
|
||||
return "capture" + now.getTime() + ".jpg";
|
||||
private static String getNewPhotoName() {
|
||||
return "capture" + System.currentTimeMillis() + ".jpg";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ import java.io.IOException;
|
|||
*/
|
||||
public final class BugBarcodeApp implements IButtonEventListener, ImageObserver {
|
||||
|
||||
private ICameraDevice camera;
|
||||
private ICameraModuleControl cameraControl;
|
||||
private Frame frame;
|
||||
private final ICameraDevice camera;
|
||||
private final ICameraModuleControl cameraControl;
|
||||
private final Frame frame;
|
||||
private Image image;
|
||||
private ImageCanvas imageCanvas;
|
||||
private Label barcodeLabel;
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.google.zxing.ReaderException;
|
|||
*/
|
||||
public abstract class GridSampler {
|
||||
|
||||
private static GridSampler gridSampler;
|
||||
private static GridSampler gridSampler = null;
|
||||
|
||||
/**
|
||||
* Sets the implementation of {@link GridSampler} used by the library. One global
|
||||
|
@ -56,6 +56,8 @@ public abstract class GridSampler {
|
|||
* @return the current implementation of {@link GridSampler}
|
||||
*/
|
||||
public static GridSampler getInstance() {
|
||||
// No real point in trying to make this thread-safe;
|
||||
// doesn't matter if a second instance is created
|
||||
if (gridSampler == null) {
|
||||
gridSampler = new DefaultGridSampler();
|
||||
}
|
||||
|
|
|
@ -141,7 +141,9 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements
|
|||
*/
|
||||
boolean checkChecksum(String s) throws ReaderException {
|
||||
int length = s.length();
|
||||
if (length == 0) return false;
|
||||
if (length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
for (int i = length - 2; i >= 0; i -= 2) {
|
||||
|
|
|
@ -163,7 +163,7 @@ final class DecodeEmailTask extends TimerTask {
|
|||
}
|
||||
}
|
||||
|
||||
private void closeResources(Store store, Folder inbox) {
|
||||
private static void closeResources(Store store, Folder inbox) {
|
||||
try {
|
||||
if (inbox != null) {
|
||||
inbox.close(true);
|
||||
|
|
Loading…
Reference in a new issue