mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Minimal changes to build successfully with Java 8, plus optional profile to enable it
This commit is contained in:
parent
4fb569cce8
commit
fabd9f6473
|
@ -37,7 +37,7 @@ final class InactivityTimer {
|
||||||
private final Activity activity;
|
private final Activity activity;
|
||||||
private final BroadcastReceiver powerStatusReceiver;
|
private final BroadcastReceiver powerStatusReceiver;
|
||||||
private boolean registered;
|
private boolean registered;
|
||||||
private AsyncTask<?,?,?> inactivityTask;
|
private AsyncTask<Object,Object,Object> inactivityTask;
|
||||||
|
|
||||||
InactivityTimer(Activity activity) {
|
InactivityTimer(Activity activity) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
|
|
|
@ -24,9 +24,11 @@ import android.view.View;
|
||||||
import android.widget.Adapter;
|
import android.widget.Adapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public final class AppPickerActivity extends ListActivity {
|
public final class AppPickerActivity extends ListActivity {
|
||||||
|
|
||||||
private AsyncTask<?,?,?> backgroundTask;
|
private AsyncTask<Object,Object,List<AppInfo>> backgroundTask;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ public final class BenchmarkActivity extends Activity {
|
||||||
|
|
||||||
private View runBenchmarkButton;
|
private View runBenchmarkButton;
|
||||||
private TextView textView;
|
private TextView textView;
|
||||||
private AsyncTask<?,?,?> benchmarkTask;
|
private AsyncTask<Object,Object,String> benchmarkTask;
|
||||||
|
|
||||||
private final View.OnClickListener runBenchmark = new View.OnClickListener() {
|
private final View.OnClickListener runBenchmark = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,7 +47,7 @@ public abstract class Binarizer {
|
||||||
* and passed in with each call for performance. However it is legal to keep more than one row
|
* and passed in with each call for performance. However it is legal to keep more than one row
|
||||||
* at a time if needed.
|
* at a time if needed.
|
||||||
*
|
*
|
||||||
* @param y The row to fetch, 0 <= y < bitmap height.
|
* @param y The row to fetch, which must be in [0, bitmap height)
|
||||||
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
||||||
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
||||||
* @return The array of bits for this row (true means black).
|
* @return The array of bits for this row (true means black).
|
||||||
|
|
|
@ -56,7 +56,7 @@ public final class BinaryBitmap {
|
||||||
* cached data. Callers should assume this method is expensive and call it as seldom as possible.
|
* cached data. Callers should assume this method is expensive and call it as seldom as possible.
|
||||||
* This method is intended for decoding 1D barcodes and may choose to apply sharpening.
|
* This method is intended for decoding 1D barcodes and may choose to apply sharpening.
|
||||||
*
|
*
|
||||||
* @param y The row to fetch, 0 <= y < bitmap height.
|
* @param y The row to fetch, which must be in [0, bitmap height)
|
||||||
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
||||||
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
|
||||||
* @return The array of bits for this row (true means black).
|
* @return The array of bits for this row (true means black).
|
||||||
|
@ -96,8 +96,8 @@ public final class BinaryBitmap {
|
||||||
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
||||||
* original data rather than a copy. Only callable if isCropSupported() is true.
|
* original data rather than a copy. Only callable if isCropSupported() is true.
|
||||||
*
|
*
|
||||||
* @param left The left coordinate, 0 <= left < getWidth().
|
* @param left The left coordinate, which must be in [0,getWidth())
|
||||||
* @param top The top coordinate, 0 <= top <= getHeight().
|
* @param top The top coordinate, which must be in [0,getHeight())
|
||||||
* @param width The width of the rectangle to crop.
|
* @param width The width of the rectangle to crop.
|
||||||
* @param height The height of the rectangle to crop.
|
* @param height The height of the rectangle to crop.
|
||||||
* @return A cropped version of this object.
|
* @return A cropped version of this object.
|
||||||
|
|
|
@ -42,7 +42,7 @@ public abstract class LuminanceSource {
|
||||||
* to only fetch this row rather than the whole image, since no 2D Readers may be installed and
|
* to only fetch this row rather than the whole image, since no 2D Readers may be installed and
|
||||||
* getMatrix() may never be called.
|
* getMatrix() may never be called.
|
||||||
*
|
*
|
||||||
* @param y The row to fetch, 0 <= y < getHeight().
|
* @param y The row to fetch, which must be in [0,getHeight())
|
||||||
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
* @param row An optional preallocated array. If null or too small, it will be ignored.
|
||||||
* Always use the returned object, and ignore the .length of the array.
|
* Always use the returned object, and ignore the .length of the array.
|
||||||
* @return An array containing the luminance data.
|
* @return An array containing the luminance data.
|
||||||
|
@ -51,7 +51,7 @@ public abstract class LuminanceSource {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches luminance data for the underlying bitmap. Values should be fetched using:
|
* Fetches luminance data for the underlying bitmap. Values should be fetched using:
|
||||||
* int luminance = array[y * width + x] & 0xff;
|
* {@code int luminance = array[y * width + x] & 0xff}
|
||||||
*
|
*
|
||||||
* @return A row-major 2D array of luminance values. Do not use result.length as it may be
|
* @return A row-major 2D array of luminance values. Do not use result.length as it may be
|
||||||
* larger than width * height bytes on some platforms. Do not modify the contents
|
* larger than width * height bytes on some platforms. Do not modify the contents
|
||||||
|
@ -84,8 +84,8 @@ public abstract class LuminanceSource {
|
||||||
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
* Returns a new object with cropped image data. Implementations may keep a reference to the
|
||||||
* original data rather than a copy. Only callable if isCropSupported() is true.
|
* original data rather than a copy. Only callable if isCropSupported() is true.
|
||||||
*
|
*
|
||||||
* @param left The left coordinate, 0 <= left < getWidth().
|
* @param left The left coordinate, which must be in [0,getWidth())
|
||||||
* @param top The top coordinate, 0 <= top <= getHeight().
|
* @param top The top coordinate, which must be in [0,getHeight())
|
||||||
* @param width The width of the rectangle to crop.
|
* @param width The width of the rectangle to crop.
|
||||||
* @param height The height of the rectangle to crop.
|
* @param height The height of the rectangle to crop.
|
||||||
* @return A cropped version of this object.
|
* @return A cropped version of this object.
|
||||||
|
|
|
@ -68,8 +68,8 @@ public class ResultPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Orders an array of three ResultPoints in an order [A,B,C] such that AB < AC and
|
* Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC
|
||||||
* BC < AC and the angle between BC and BA is less than 180 degrees.
|
* and BC is less than AC, and the angle between BC and BA is less than 180 degrees.
|
||||||
*/
|
*/
|
||||||
public static void orderBestPatterns(ResultPoint[] patterns) {
|
public static void orderBestPatterns(ResultPoint[] patterns) {
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ import com.google.zxing.common.BitArray;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Implements decoding of the UPC-E format.</p>
|
* <p>Implements decoding of the UPC-E format.</p>
|
||||||
* <p/>
|
|
||||||
* <p><a href="http://www.barcodeisland.com/upce.phtml">This</a> is a great reference for
|
* <p><a href="http://www.barcodeisland.com/upce.phtml">This</a> is a great reference for
|
||||||
* UPC-E information.</p>
|
* UPC-E information.</p>
|
||||||
*
|
*
|
||||||
|
|
24
pom.xml
24
pom.xml
|
@ -592,6 +592,30 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>java8</id>
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>8</source>
|
||||||
|
<target>8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<javadocVersion>1.8</javadocVersion>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in a new issue