mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
Lint cleanup
git-svn-id: https://zxing.googlecode.com/svn/trunk@2704 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
1f054946be
commit
44c6b383e3
|
@ -34,18 +34,17 @@
|
||||||
<uses-feature android:name="android.hardware.camera"/>
|
<uses-feature android:name="android.hardware.camera"/>
|
||||||
|
|
||||||
<application android:label="@string/app_name"
|
<application android:label="@string/app_name"
|
||||||
android:icon="@drawable/icon">
|
android:icon="@drawable/icon"
|
||||||
|
android:allowBackup="true">
|
||||||
<activity android:name="ZXingTestActivity"
|
<activity android:name="ZXingTestActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name">
|
||||||
android:screenOrientation="portrait">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="BenchmarkActivity"
|
<activity android:name="BenchmarkActivity"
|
||||||
android:label="@string/benchmark_name"
|
android:label="@string/benchmark_name"/>
|
||||||
android:screenOrientation="portrait"/>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,32 +1,30 @@
|
||||||
|
# This is a configuration file for ProGuard.
|
||||||
|
# http://proguard.sourceforge.net/index.html#manual/usage.html
|
||||||
|
|
||||||
|
# Optimizations: If you don't want to optimize, use the
|
||||||
|
# proguard-android.txt configuration file instead of this one, which
|
||||||
|
# turns off the optimization flags. Adding optimization introduces
|
||||||
|
# certain risks, since for example not all optimizations performed by
|
||||||
|
# ProGuard works on all versions of Dalvik. The following flags turn
|
||||||
|
# off various optimizations known to have issues, but the list may not
|
||||||
|
# be complete or up to date. (The "arithmetic" optimization can be
|
||||||
|
# used if you are only targeting Android 2.0 or later.) Make sure you
|
||||||
|
# test thoroughly if you go this route.
|
||||||
|
-optimizations !code/simplification/cast,!field/*,!class/merging/*
|
||||||
|
-optimizationpasses 5
|
||||||
|
-allowaccessmodification
|
||||||
|
-dontpreverify
|
||||||
|
|
||||||
|
# The remainder of this file is identical to the non-optimized version
|
||||||
|
# of the Proguard configuration file (except that the other file has
|
||||||
|
# flags to turn off optimization).
|
||||||
|
|
||||||
-dontusemixedcaseclassnames
|
-dontusemixedcaseclassnames
|
||||||
-dontskipnonpubliclibraryclasses
|
-dontskipnonpubliclibraryclasses
|
||||||
-verbose
|
-verbose
|
||||||
|
|
||||||
-dontpreverify
|
|
||||||
|
|
||||||
-optimizations !class/merging/*
|
|
||||||
-optimizationpasses 5
|
|
||||||
-allowaccessmodification
|
|
||||||
|
|
||||||
-keep public class * extends android.app.Activity
|
|
||||||
-keep public class * extends android.app.Application
|
|
||||||
-keep public class * extends android.app.Service
|
|
||||||
-keep public class * extends android.content.BroadcastReceiver
|
|
||||||
-keep public class * extends android.content.ContentProvider
|
|
||||||
-keep public class * extends android.app.backup.BackupAgentHelper
|
|
||||||
-keep public class * extends android.preference.Preference
|
|
||||||
-keep public class com.android.vending.licensing.ILicensingService
|
|
||||||
|
|
||||||
-keepattributes *Annotation*
|
-keepattributes *Annotation*
|
||||||
-keep public class * extends android.app.Activity
|
-keep public class com.google.vending.licensing.ILicensingService
|
||||||
-keep public class * extends android.app.Application
|
|
||||||
-keep public class * extends android.app.Service
|
|
||||||
-keep public class * extends android.content.BroadcastReceiver
|
|
||||||
-keep public class * extends android.content.ContentProvider
|
|
||||||
-keep public class * extends android.app.backup.BackupAgent
|
|
||||||
-keep public class * extends android.preference.Preference
|
|
||||||
-keep public class * extends android.support.v4.app.Fragment
|
|
||||||
-keep public class * extends android.app.Fragment
|
|
||||||
-keep public class com.android.vending.licensing.ILicensingService
|
-keep public class com.android.vending.licensing.ILicensingService
|
||||||
|
|
||||||
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
||||||
|
@ -34,21 +32,14 @@
|
||||||
native <methods>;
|
native <methods>;
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep public class * extends android.view.View {
|
# keep setters in Views so that animations can still work.
|
||||||
public <init>(android.content.Context);
|
# see http://proguard.sourceforge.net/manual/examples.html#beans
|
||||||
public <init>(android.content.Context, android.util.AttributeSet);
|
-keepclassmembers public class * extends android.view.View {
|
||||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
void set*(***);
|
||||||
public void set*(...);
|
*** get*();
|
||||||
}
|
|
||||||
|
|
||||||
-keepclasseswithmembers class * {
|
|
||||||
public <init>(android.content.Context, android.util.AttributeSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
-keepclasseswithmembers class * {
|
|
||||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# We want to keep methods in Activity that could be used in the XML attribute onClick
|
||||||
-keepclassmembers class * extends android.app.Activity {
|
-keepclassmembers class * extends android.app.Activity {
|
||||||
public void *(android.view.View);
|
public void *(android.view.View);
|
||||||
}
|
}
|
||||||
|
|
BIN
androidtest/res/drawable-hdpi/icon.png
Normal file
BIN
androidtest/res/drawable-hdpi/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
BIN
androidtest/res/drawable-xhdpi/icon.png
Normal file
BIN
androidtest/res/drawable-xhdpi/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -18,7 +18,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:padding="10px">
|
android:padding="10dip">
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<Button android:id="@+id/benchmark_run"
|
<Button android:id="@+id/benchmark_run"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:padding="10px">
|
android:padding="10dip">
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<Button android:id="@+id/run_benchmark"
|
<Button android:id="@+id/run_benchmark"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
<resources>
|
|
||||||
<color name="status_view">#50000000</color>
|
|
||||||
<color name="status_text">#ffffffff</color>
|
|
||||||
<color name="transparent">#00000000</color>
|
|
||||||
<color name="viewfinder_frame">#ffffffff</color>
|
|
||||||
<color name="viewfinder_mask">#ccff0000</color>
|
|
||||||
</resources>
|
|
|
@ -16,16 +16,12 @@
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<string name="about_menu">About</string>
|
<string name="about_menu">About</string>
|
||||||
<string name="about_message">A utility written by the ZXing Team to help with the development
|
<string name="about_message">A utility written by the ZXing Team to help with the development of Barcode Scanner. http://code.google.com/p/zxing</string>
|
||||||
of Barcode Scanner.</string>
|
|
||||||
<string name="app_name">ZXing Test</string>
|
<string name="app_name">ZXing Test</string>
|
||||||
|
|
||||||
<string name="benchmark_name">ZXing Benchmark</string>
|
<string name="benchmark_name">ZXing Benchmark</string>
|
||||||
<string name="benchmark_help">Place images in /sdcard/zxingbenchmark, then check \"adb logcat\"
|
<string name="benchmark_help">Place images in /sdcard/zxingbenchmark, then check \"adb logcat\" for results. Turn on Airplane Mode first for more reliable results.</string>
|
||||||
for results. Turn on Airplane Mode first for more reliable results.</string>
|
|
||||||
<string name="benchmark_run">Run benchmark</string>
|
<string name="benchmark_run">Run benchmark</string>
|
||||||
<string name="benchmark_running">Benchmark running\u2026</string>
|
<string name="benchmark_running">Benchmark running\u2026</string>
|
||||||
|
|
||||||
<string name="encode_bad_data">Encode bad data</string>
|
<string name="encode_bad_data">Encode bad data</string>
|
||||||
<string name="encode_contact">Encode contact</string>
|
<string name="encode_contact">Encode contact</string>
|
||||||
<string name="encode_email">Encode email</string>
|
<string name="encode_email">Encode email</string>
|
||||||
|
@ -34,23 +30,14 @@
|
||||||
<string name="encode_phone">Encode phone</string>
|
<string name="encode_phone">Encode phone</string>
|
||||||
<string name="encode_sms">Encode SMS</string>
|
<string name="encode_sms">Encode SMS</string>
|
||||||
<string name="encode_url">Encode URL</string>
|
<string name="encode_url">Encode URL</string>
|
||||||
|
|
||||||
<string name="get_camera_parameters">Get camera parameters</string>
|
<string name="get_camera_parameters">Get camera parameters</string>
|
||||||
<string name="ok_button">OK</string>
|
<string name="ok_button">OK</string>
|
||||||
<string name="parameters_message">Collecting camera parameters to email to ZXing Team\u2026</string>
|
|
||||||
|
|
||||||
<string name="result_failed">No barcode found</string>
|
<string name="result_failed">No barcode found</string>
|
||||||
<string name="result_failed_why">"The user gave up and pressed Back"</string>
|
<string name="result_failed_why">"The user gave up and pressed Back"</string>
|
||||||
<string name="result_succeeded">Found barcode</string>
|
<string name="result_succeeded">Found barcode</string>
|
||||||
|
|
||||||
<string name="save_failed">Save failed - is the SD card installed?</string>
|
|
||||||
<string name="save_succeeded">Save succeeded</string>
|
|
||||||
<string name="scan_anything">Scan anything</string>
|
<string name="scan_anything">Scan anything</string>
|
||||||
<string name="scan_product">Scan product</string>
|
<string name="scan_product">Scan product</string>
|
||||||
<string name="scan_qr_code">Scan QR Code</string>
|
<string name="scan_qr_code">Scan QR Code</string>
|
||||||
<string name="search_book_contents">Search Book Contents</string>
|
<string name="search_book_contents">Search Book Contents</string>
|
||||||
<string name="share_via_barcode">Share via barcode</string>
|
<string name="share_via_barcode">Share via barcode</string>
|
||||||
<string name="status_message">Press the shutter button or Search to save test images to the
|
|
||||||
SD card. Press DPAD_CENTER to trigger autofocus.</string>
|
|
||||||
<string name="take_test_photos">Take test photos</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -18,6 +18,7 @@ package com.google.zxing.client.androidtest;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -28,7 +29,7 @@ import android.widget.TextView;
|
||||||
public final class BenchmarkActivity extends Activity {
|
public final class BenchmarkActivity extends Activity {
|
||||||
|
|
||||||
private static final String TAG = BenchmarkActivity.class.getSimpleName();
|
private static final String TAG = BenchmarkActivity.class.getSimpleName();
|
||||||
private static final String PATH = "/sdcard/zxingbenchmark";
|
private static final String PATH = Environment.getExternalStorageDirectory().getPath() + "/zxingbenchmark";
|
||||||
|
|
||||||
private Button runBenchmarkButton;
|
private Button runBenchmarkButton;
|
||||||
private TextView textView;
|
private TextView textView;
|
||||||
|
|
|
@ -18,7 +18,7 @@ package com.google.zxing.client.androidtest;
|
||||||
|
|
||||||
import com.google.zxing.BarcodeFormat;
|
import com.google.zxing.BarcodeFormat;
|
||||||
|
|
||||||
public final class BenchmarkItem {
|
final class BenchmarkItem {
|
||||||
|
|
||||||
private final String path;
|
private final String path;
|
||||||
private final int[] times;
|
private final int[] times;
|
||||||
|
@ -26,7 +26,7 @@ public final class BenchmarkItem {
|
||||||
private boolean decoded;
|
private boolean decoded;
|
||||||
private BarcodeFormat format;
|
private BarcodeFormat format;
|
||||||
|
|
||||||
public BenchmarkItem(String path, int runs) {
|
BenchmarkItem(String path, int runs) {
|
||||||
if (runs <= 0) {
|
if (runs <= 0) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
@ -37,16 +37,16 @@ public final class BenchmarkItem {
|
||||||
format = null;
|
format = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addResult(int microseconds) {
|
void addResult(int microseconds) {
|
||||||
times[position] = microseconds;
|
times[position] = microseconds;
|
||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDecoded(boolean decoded) {
|
void setDecoded(boolean decoded) {
|
||||||
this.decoded = decoded;
|
this.decoded = decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFormat(BarcodeFormat format) {
|
void setFormat(BarcodeFormat format) {
|
||||||
this.format = format;
|
this.format = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ public final class BenchmarkItem {
|
||||||
*
|
*
|
||||||
* @return The average decoding time in microseconds.
|
* @return The average decoding time in microseconds.
|
||||||
*/
|
*/
|
||||||
public int getAverageTime() {
|
int getAverageTime() {
|
||||||
int size = times.length;
|
int size = times.length;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
int max = times[0];
|
int max = times[0];
|
||||||
|
|
|
@ -24,6 +24,7 @@ import android.content.pm.PackageManager;
|
||||||
import android.hardware.Camera;
|
import android.hardware.Camera;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -40,12 +41,14 @@ import java.io.OutputStreamWriter;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public final class ZXingTestActivity extends Activity {
|
public final class ZXingTestActivity extends Activity {
|
||||||
|
|
||||||
private static final String TAG = ZXingTestActivity.class.getSimpleName();
|
private static final String TAG = ZXingTestActivity.class.getSimpleName();
|
||||||
private static final int ABOUT_ID = Menu.FIRST;
|
private static final int ABOUT_ID = Menu.FIRST;
|
||||||
private static final String PACKAGE_NAME = ZXingTestActivity.class.getPackage().getName();
|
private static final String PACKAGE_NAME = ZXingTestActivity.class.getPackage().getName();
|
||||||
|
private static final Pattern SEMICOLON = Pattern.compile(";");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
|
@ -305,7 +308,7 @@ public final class ZXingTestActivity extends Activity {
|
||||||
result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n');
|
result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n');
|
||||||
|
|
||||||
String flattened = getFlattenedParams();
|
String flattened = getFlattenedParams();
|
||||||
String[] params = flattened.split(";");
|
String[] params = SEMICOLON.split(flattened);
|
||||||
Arrays.sort(params);
|
Arrays.sort(params);
|
||||||
for (String param : params) {
|
for (String param : params) {
|
||||||
result.append(param).append('\n');
|
result.append(param).append('\n');
|
||||||
|
@ -318,10 +321,10 @@ public final class ZXingTestActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void writeStats(String resultString) {
|
private static void writeStats(String resultString) {
|
||||||
|
File cameraParamsFile = new File(Environment.getExternalStorageDirectory().getPath() + "/CameraParameters.txt");
|
||||||
Writer out = null;
|
Writer out = null;
|
||||||
try {
|
try {
|
||||||
out = new OutputStreamWriter(new FileOutputStream(new File("/sdcard/CameraParameters.txt")),
|
out = new OutputStreamWriter(new FileOutputStream(cameraParamsFile), Charset.forName("UTF-8"));
|
||||||
Charset.forName("UTF-8"));
|
|
||||||
out.write(resultString);
|
out.write(resultString);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "Cannot write parameters file ", e);
|
Log.e(TAG, "Cannot write parameters file ", e);
|
||||||
|
|
Loading…
Reference in a new issue