init
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
|
||||
package="io.dcloud.uni_modules.xwq_mlkit_scan_code">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<!-- Don't require camera, as this requires a rear camera. This allows it to work on the Nexus 7 -->
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
|
||||
<!-- TODO replace above two with next line after Android 4.2 -->
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.wifi" android:required="false" />
|
||||
|
||||
<application>
|
||||
<!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" -->
|
||||
<activity android:name="uts.sdk.modules.xwqMlkitScanCode.MyMlkitScanActivity"></activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"minSdkVersion": "21",
|
||||
"dependencies": [
|
||||
"com.google.mlkit:barcode-scanning:17.3.0",
|
||||
"androidx.camera:camera-core:1.4.0",
|
||||
"androidx.camera:camera-camera2:1.4.0",
|
||||
"androidx.camera:camera-lifecycle:1.4.0",
|
||||
"androidx.camera:camera-view:1.4.0",
|
||||
"androidx.appcompat:appcompat:1.4.1"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<!-- <SurfaceView android:id="@+id/camera_wrap" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:layout_gravity="center_vertical">
|
||||
</SurfaceView> -->
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="0dp" android:layout_weight="1" >
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:orientation="vertical" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="30dp" android:layout_height="30dp" android:src="@drawable/close"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="100dp"
|
||||
android:orientation="horizontal" android:background="#80000000" android:gravity="center_horizontal|top"
|
||||
android:id="@+id/bottom_content">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="15dp" android:layout_marginLeft="28dp"
|
||||
android:id="@+id/asml_wrap">
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/photo_open"></ImageView>
|
||||
<TextView android:paddingTop="20px" android:id="@+id/text_asml" android:layout_width="wrap_content" android:textAlignment="center" android:layout_height="wrap_content" android:gravity="center"
|
||||
android:textColor="#ffffff" android:text="相册" android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="wrap_content"
|
||||
android:paddingTop="60px" android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" />
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="15dp" android:layout_marginRight="28dp"
|
||||
android:id="@+id/flashlight_wrap">
|
||||
<ImageView android:id="@+id/flashlight" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/light_close"></ImageView>
|
||||
<TextView android:paddingTop="20px" android:id="@+id/text_flashlight" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center"
|
||||
android:textColor="#ffffff" android:text="灯光" android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.ScanOverlay android:id="@+id/overlay" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.ScanOverlay>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="0dp" android:layout_weight="1" >
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal" android:layout_marginTop="20dp">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:orientation="horizontal" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/close"></ImageView>
|
||||
<View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" />
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/photo_open"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal" android:layout_centerHorizontal="true">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="50dp"
|
||||
android:orientation="vertical" android:background="#80000000" android:gravity="center"
|
||||
android:id="@+id/bottom_content">
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/flashlight_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="150dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/flashlight"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/flashlight_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20px"
|
||||
android:text="轻触点亮"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.ScanOverlay android:id="@+id/overlay" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.ScanOverlay>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical"
|
||||
android:background="#50000000" android:id="@+id/senter_box_bg">
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal" android:layout_marginTop="20dp">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:orientation="horizontal" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/close"></ImageView>
|
||||
<View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" />
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/photo_open"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal" android:layout_centerHorizontal="true">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="50dp"
|
||||
android:orientation="vertical" android:background="#80000000" android:gravity="center"
|
||||
android:id="@+id/bottom_content">
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/flashlight_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="150dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/flashlight"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/flashlight_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20px"
|
||||
android:text="轻触点亮"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.BoxView android:id="@+id/scan_box_wrap" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.BoxView>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#6200EE</color>
|
||||
<color name="colorPrimaryDark">#3700B3</color>
|
||||
<color name="colorAccent">#03DAC5</color>
|
||||
<color name="colorHeader">#83818D</color>
|
||||
<color name="colorWhite">#ffffff</color>
|
||||
<color name="colorBlack">#000000</color>
|
||||
</resources>
|
||||