mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Update ZXingTest to use Holo theme; requires Android 2.3.3
git-svn-id: https://zxing.googlecode.com/svn/trunk@2798 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
f525aa7ebb
commit
20490f1bda
|
@ -16,14 +16,14 @@
|
|||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.zxing.client.androidtest"
|
||||
android:versionName="1.2.1"
|
||||
android:versionCode="7"
|
||||
android:versionName="1.3"
|
||||
android:versionCode="8"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA"/>
|
||||
|
||||
<uses-sdk android:minSdkVersion="7"
|
||||
android:targetSdkVersion="10"/>
|
||||
<uses-sdk android:minSdkVersion="10"
|
||||
android:targetSdkVersion="17"/>
|
||||
|
||||
<supports-screens android:xlargeScreens="true"
|
||||
android:largeScreens="true"
|
||||
|
|
|
@ -14,22 +14,18 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="10dip">
|
||||
<TableRow>
|
||||
<Button android:id="@+id/benchmark_run"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/benchmark_run"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TextView android:id="@+id/benchmark_help"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="false"
|
||||
android:text="@string/benchmark_help"/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<Button android:id="@+id/benchmark_run"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/benchmark_run"/>
|
||||
<TextView android:id="@+id/benchmark_help"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="false"
|
||||
android:text="@string/benchmark_help"
|
||||
android:padding="5dip"/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="10dip">
|
||||
<TableRow>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<LinearLayout android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<Button android:id="@+id/run_benchmark"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -28,8 +28,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/get_camera_parameters"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/scan_product"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -38,8 +36,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/scan_qr_code"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/scan_anything"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -48,8 +44,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/search_book_contents"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/encode_url"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -58,8 +52,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/encode_email"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/encode_phone"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -68,8 +60,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/encode_sms"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/encode_contact"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -78,8 +68,6 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/encode_location"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/encode_hidden_data"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -88,11 +76,9 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/encode_bad_data"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<Button android:id="@+id/share_via_barcode"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/share_via_barcode"/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
22
androidtest/res/menu/main.xml
Normal file
22
androidtest/res/menu/main.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2013 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.
|
||||
-->
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/menu_about"
|
||||
android:title="@string/about_menu"
|
||||
android:icon="@android:drawable/ic_menu_help"
|
||||
android:showAsAction="withText|ifRoom"/>
|
||||
</menu>
|
|
@ -28,6 +28,7 @@ import android.os.Environment;
|
|||
import android.provider.ContactsContract;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
@ -46,7 +47,6 @@ import java.util.regex.Pattern;
|
|||
public final class ZXingTestActivity extends Activity {
|
||||
|
||||
private static final String TAG = ZXingTestActivity.class.getSimpleName();
|
||||
private static final int ABOUT_ID = Menu.FIRST;
|
||||
private static final String PACKAGE_NAME = ZXingTestActivity.class.getPackage().getName();
|
||||
private static final Pattern SEMICOLON = Pattern.compile(";");
|
||||
|
||||
|
@ -73,14 +73,14 @@ public final class ZXingTestActivity extends Activity {
|
|||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
menu.add(0, ABOUT_ID, 0, R.string.about_menu).setIcon(android.R.drawable.ic_menu_info_details);
|
||||
return true;
|
||||
MenuInflater menuInflater = getMenuInflater();
|
||||
menuInflater.inflate(R.menu.main, menu);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == ABOUT_ID) {
|
||||
if (item.getItemId() == R.id.menu_about) {
|
||||
int versionCode;
|
||||
String versionName;
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue