Bladeren bron

初始化ipu-scan-lib

leijie 9 jaren geleden
bovenliggende
commit
13197609f0

+ 8 - 0
Ipu-scan-lib/.classpath

@ -0,0 +1,8 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="output" path="bin/classes"/>
8
</classpath>

+ 2 - 0
Ipu-scan-lib/.gitignore

@ -0,0 +1,2 @@
1
/gen/
2
/bin/

+ 33 - 0
Ipu-scan-lib/.project

@ -0,0 +1,33 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>Ipu-scan-lib</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.jdt.core.javabuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
		<buildCommand>
24
			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
28
	</buildSpec>
29
	<natures>
30
		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31
		<nature>org.eclipse.jdt.core.javanature</nature>
32
	</natures>
33
</projectDescription>

+ 11 - 0
Ipu-scan-lib/AndroidManifest.xml

@ -0,0 +1,11 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
    package="com.ipu.scan"
4
    android:versionCode="1"
5
    android:versionName="1.0" >
6
7
    <uses-sdk
8
        android:minSdkVersion="8"
9
        android:targetSdkVersion="21" />
10
11
</manifest>

BIN
Ipu-scan-lib/libs/ipu-scan.jar


+ 20 - 0
Ipu-scan-lib/proguard-project.txt

@ -0,0 +1,20 @@
1
# To enable ProGuard in your project, edit project.properties
2
# to define the proguard.config property as described in that file.
3
#
4
# Add project specific ProGuard rules here.
5
# By default, the flags in this file are appended to flags specified
6
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7
# You can edit the include path and order by changing the ProGuard
8
# include property in project.properties.
9
#
10
# For more details, see
11
#   http://developer.android.com/guide/developing/tools/proguard.html
12
13
# Add any project specific keep options here:
14
15
# If your project uses WebView with JS, uncomment the following
16
# and specify the fully qualified class name to the JavaScript interface
17
# class:
18
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19
#   public *;
20
#}

+ 15 - 0
Ipu-scan-lib/project.properties

@ -0,0 +1,15 @@
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12
13
# Project target.
14
target=android-22
15
android.library=true

+ 5 - 0
Ipu-scan-lib/res/drawable/scan_cancel.xml

@ -0,0 +1,5 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">  
3
    <item android:drawable="@drawable/scan_cancel_normal" android:state_pressed="false"/>  
4
    <item android:drawable="@drawable/scan_cancel_press" android:state_pressed="true"/>  
5
</selector>

BIN
Ipu-scan-lib/res/drawable/scan_cancel_normal.png


BIN
Ipu-scan-lib/res/drawable/scan_cancel_press.png


BIN
Ipu-scan-lib/res/drawable/scan_flashlight_off.png


BIN
Ipu-scan-lib/res/drawable/scan_flashlight_on.png


+ 79 - 0
Ipu-scan-lib/res/layout/activity_scan_multiple.xml

@ -0,0 +1,79 @@
1
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
    xmlns:tools="http://schemas.android.com/tools"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    tools:context="com.ipu.scan.ScanActivity" >
6
    
7
            
8
	 <SurfaceView
9
        android:id="@+id/preview_view"
10
        android:layout_width="wrap_content"
11
        android:layout_height="match_parent"
12
        android:layout_gravity="center" />
13
	 
14
	 <LinearLayout 
15
	     android:layout_width="match_parent"
16
	     android:layout_height="match_parent"
17
	     android:orientation="vertical">
18
19
	    <RelativeLayout 
20
	        android:id="@+id/rl_viewfinder"
21
	        android:layout_width="match_parent"
22
	        android:layout_height="wrap_content"
23
	        android:layout_gravity="center">
24
	        
25
	        <RelativeLayout 
26
	            android:layout_width="wrap_content"
27
	            android:layout_height="wrap_content"
28
	            >
29
	            
30
	            <ImageButton
31
		            android:id="@+id/btn_cancel_scan"
32
		            android:layout_width="wrap_content"
33
		            android:layout_height="wrap_content"
34
		            android:layout_alignParentLeft="true"
35
		            android:layout_alignParentTop="true"
36
		            android:src="@drawable/scan_cancel_normal" />
37
		        
38
		        <Button 
39
		            android:id="@+id/btn_call_result"
40
		            android:layout_width="wrap_content"
41
		            android:layout_height="wrap_content"
42
		            android:layout_centerInParent="true"
43
		            android:text="返回结果集"
44
		            android:textSize="23sp"/>
45
		
46
		        <ImageButton
47
		            android:id="@+id/btn_flashlight"
48
		            android:layout_width="wrap_content"
49
		            android:layout_height="wrap_content"
50
		            android:layout_alignParentRight="true"
51
		            android:layout_alignParentTop="true"
52
		            android:src="@drawable/scan_flashlight_off" />
53
	        </RelativeLayout>
54
		
55
		        <com.ipu.scan.view.ViewfinderView
56
			        android:id="@+id/viewfinder_view"
57
			        android:layout_width="wrap_content"
58
			        android:layout_height="wrap_content"
59
			        />
60
		    </RelativeLayout>
61
		    
62
	    <RelativeLayout 
63
	        android:layout_width="match_parent"
64
	        android:layout_height="0dp"
65
	        android:layout_weight="1">
66
	              
67
	      <ListView 
68
		   	    android:id="@+id/list_scan_result"
69
		   	    android:layout_width="match_parent"
70
		   	    android:background="@android:color/white"
71
		   	    android:layout_height="match_parent">
72
		   	</ListView>
73
	        
74
	    </RelativeLayout>
75
	  
76
		   	
77
	 </LinearLayout>
78
79
</RelativeLayout>

+ 41 - 0
Ipu-scan-lib/res/layout/item_scan_result.xml

@ -0,0 +1,41 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:orientation="horizontal" >
6
    
7
    <LinearLayout 
8
        android:layout_width="0dp"
9
        android:layout_weight="1"
10
        android:layout_height="match_parent">
11
           
12
    <TextView
13
        android:id="@+id/tv_scan_result"
14
        android:layout_width="wrap_content"
15
        android:layout_height="wrap_content"
16
        android:textSize="18sp"
17
        android:textColor="@android:color/darker_gray"
18
        android:gravity="center_vertical"
19
        android:layout_margin="3dp"
20
        android:singleLine="true"
21
        android:layout_gravity="center_vertical"/>
22
        
23
    </LinearLayout>
24
    
25
    <LinearLayout 
26
        android:layout_width="wrap_content"
27
        android:layout_height="match_parent">
28
            
29
    <Button 
30
        android:id="@+id/btn_delete"
31
        android:layout_width="wrap_content"
32
        android:layout_height="wrap_content"
33
        android:text="删除"
34
        android:textSize="20sp"
35
        android:background="@android:color/transparent"
36
        android:layout_gravity="right|center_vertical"
37
        android:gravity="center"/>
38
        
39
    </LinearLayout>
40
41
</LinearLayout>

+ 39 - 0
Ipu-scan-lib/res/layout/scan_zxing_capture.xml

@ -0,0 +1,39 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="fill_parent"
4
    android:layout_height="fill_parent" >
5
6
    <SurfaceView
7
        android:id="@+id/preview_view"
8
        android:layout_width="wrap_content"
9
        android:layout_height="wrap_content"
10
        android:layout_gravity="center" />
11
    
12
    <RelativeLayout
13
        android:layout_width="match_parent"
14
        android:layout_height="match_parent"
15
        android:layout_gravity="center">
16
17
        <ImageButton
18
            android:id="@+id/btn_cancel_scan"
19
            android:layout_width="wrap_content"
20
            android:layout_height="wrap_content"
21
            android:layout_alignParentLeft="true"
22
            android:layout_alignParentTop="true"
23
            android:src="@drawable/scan_cancel_normal" />
24
25
        <ImageButton
26
            android:id="@+id/btn_flashlight"
27
            android:layout_width="wrap_content"
28
            android:layout_height="wrap_content"
29
            android:layout_alignParentRight="true"
30
            android:layout_alignParentTop="true"
31
            android:src="@drawable/scan_flashlight_off" />
32
33
        <com.ipu.scan.view.ViewfinderView
34
	        android:id="@+id/viewfinder_view"
35
	        android:layout_width="wrap_content"
36
	        android:layout_height="wrap_content"/>
37
38
    </RelativeLayout>
39
</FrameLayout>

BIN
Ipu-scan-lib/res/raw/beep.ogg


+ 11 - 0
Ipu-scan-lib/res/values-v11/styles.xml

@ -0,0 +1,11 @@
1
<resources>
2
3
    <!--
4
        Base application theme for API 11+. This theme completely replaces
5
        AppBaseTheme from res/values/styles.xml on API 11+ devices.
6
    -->
7
    <style name="AppBaseTheme" parent="android:Theme.Light">
8
        <!-- API 11 theme customizations can go here. -->
9
    </style>
10
11
</resources>

+ 12 - 0
Ipu-scan-lib/res/values-v14/styles.xml

@ -0,0 +1,12 @@
1
<resources>
2
3
    <!--
4
        Base application theme for API 14+. This theme completely replaces
5
        AppBaseTheme from BOTH res/values/styles.xml and
6
        res/values-v11/styles.xml on API 14+ devices.
7
    -->
8
    <style name="AppBaseTheme" parent="android:Theme.Light">
9
        <!-- API 14 theme customizations can go here. -->
10
    </style>
11
12
</resources>

+ 7 - 0
Ipu-scan-lib/res/values/dimens.xml

@ -0,0 +1,7 @@
1
<resources>
2
3
    <!-- Default screen margins, per the Android Design guidelines. -->
4
    <dimen name="activity_horizontal_margin">16dp</dimen>
5
    <dimen name="activity_vertical_margin">16dp</dimen>
6
7
</resources>

+ 32 - 0
Ipu-scan-lib/res/values/scan_zxing_colors.xml

@ -0,0 +1,32 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<resources>
3
  
4
  <color name="bg_color">#EDEDED</color>
5
  <color name="contents_text">#ff000000</color>
6
  <color name="encode_view">#ffffffff</color>
7
  <color name="help_button_view">#ffcccccc</color>
8
  <color name="help_view">#ff404040</color>
9
  <color name="possible_result_points">#c0ffff00</color>  
10
  <color name="result_image_border">#ffffffff</color>
11
  <color name="result_minor_text">#ffc0c0c0</color>
12
  <color name="result_points">#c000ff00</color>
13
  <color name="result_text">#ffffffff</color>
14
  <color name="result_view">#b0000000</color>
15
  <color name="sbc_header_text">#ff808080</color>
16
  <color name="sbc_header_view">#ffffffff</color>
17
  <color name="sbc_list_item">#fffff0e0</color>
18
  <color name="sbc_layout_view">#ffffffff</color>
19
  <color name="sbc_page_number_text">#ff000000</color>
20
  <color name="sbc_snippet_text">#ff4b4b4b</color>
21
  <color name="share_text">#ff000000</color>
22
  <color name="share_view">#ffffffff</color>
23
  <color name="status_view">#50000000</color>
24
  <color name="status_text">#ffffffff</color>
25
  <color name="transparent">#00000000</color>
26
  <color name="viewfinder_frame">#ff000000</color>
27
  <color name="viewfinder_laser">#ffff0000</color>
28
  <color name="viewfinder_mask">#60000000</color>
29
  <color name="header">#58567D</color>
30
  <color name="grgray">#686868</color>
31
      
32
</resources>

+ 31 - 0
Ipu-scan-lib/res/values/scan_zxing_ids.xml

@ -0,0 +1,31 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
 Copyright (C) 2008 ZXing authors
4
5
 Licensed under the Apache License, Version 2.0 (the "License");
6
 you may not use this file except in compliance with the License.
7
 You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
 Unless required by applicable law or agreed to in writing, software
12
 distributed under the License is distributed on an "AS IS" BASIS,
13
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 See the License for the specific language governing permissions and
15
 limitations under the License.
16
 -->
17
<resources>
18
  <!-- Messages IDs -->
19
  <item type="id" name="auto_focus"/>
20
  <item type="id" name="decode"/>
21
  <item type="id" name="decode_failed"/>
22
  <item type="id" name="decode_succeeded"/>
23
  <item type="id" name="encode_failed"/>
24
  <item type="id" name="encode_succeeded"/>
25
  <item type="id" name="launch_product_query"/>
26
  <item type="id" name="quit"/>
27
  <item type="id" name="restart_preview"/>
28
  <item type="id" name="return_scan_result"/>
29
  <item type="id" name="search_book_contents_failed"/>
30
  <item type="id" name="search_book_contents_succeeded"/>
31
</resources>

+ 6 - 0
Ipu-scan-lib/res/values/strings.xml

@ -0,0 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<resources>
3
4
    <string name="app_name">Ipu-scan-lib</string>
5
6
</resources>