更新CameraX至v1.2.1

This commit is contained in:
Jenly
2023-03-04 20:54:37 +08:00
parent b2fa6aaec0
commit a85d793149
53 changed files with 1566 additions and 884 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FFFFFF"
android:pathData="m755.2,209.9c-17.2,-17.4 -40.2,-26.9 -64.5,-26.9l-357.2,0c-50.3,0 -91.3,40.9 -91.3,91.3l0,105.1c0,77.3 36.3,149.7 97.7,196.1l0,300.3c0,50.3 40.9,91.3 91.3,91.3l161.5,0c50.3,0 91.3,-40.9 91.3,-91.3l0,-300.3c61.4,-46.4 97.7,-118.7 97.7,-196.1l0,-104.9c0.2,-24.4 -9.3,-47.3 -26.5,-64.6zM333.5,230.8l357.1,0c11.6,0 22.5,4.5 30.7,12.8c8.2,8.2 12.7,19.1 12.6,30.8l0,42.9l-443.9,0l0,-43c0,-24 19.5,-43.5 43.5,-43.5zM646.7,543.3c-6.6,4.4 -10.5,11.9 -10.5,19.8l0,312.6c0,24 -19.5,43.5 -43.5,43.5l-161.4,0c-24,0 -43.5,-19.5 -43.5,-43.5l0,-312.6c0,-7.9 -3.9,-15.4 -10.5,-19.8c-54,-36.5 -86.3,-96.8 -87.1,-161.7l443.7,0c-0.8,64.9 -33.2,125.2 -87.2,161.7z" />
<path
android:fillColor="#FFFFFF"
android:pathData="m543,690.4l-62,0c-0.7,0 -1.2,-0.5 -1.2,-1.2l0,-169.4c0,-0.7 0.5,-1.2 1.2,-1.2l62,0c0.7,0 1.2,0.5 1.2,1.2l0,169.4c0,0.7 -0.5,1.2 -1.2,1.2z" />
</vector>

View File

@@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FFFFFF"
android:pathData="m755.2,209.9c-17.2,-17.4 -40.2,-26.9 -64.5,-26.9l-357.2,0c-50.3,0 -91.3,40.9 -91.3,91.3l0,105.1c0,77.3 36.3,149.7 97.7,196.1l0,300.3c0,50.3 40.9,91.3 91.3,91.3l161.5,0c50.3,0 91.3,-40.9 91.3,-91.3l0,-300.3c61.4,-46.4 97.7,-118.7 97.7,-196.1l0,-104.9c0.2,-24.4 -9.3,-47.3 -26.5,-64.6zM333.5,230.8l357.1,0c11.6,0 22.5,4.5 30.7,12.8c8.2,8.2 12.7,19.1 12.6,30.8l0,42.9l-443.9,0l0,-43c0,-24 19.5,-43.5 43.5,-43.5zM646.7,543.3c-6.6,4.4 -10.5,11.9 -10.5,19.8l0,312.6c0,24 -19.5,43.5 -43.5,43.5l-161.4,0c-24,0 -43.5,-19.5 -43.5,-43.5l0,-312.6c0,-7.9 -3.9,-15.4 -10.5,-19.8c-54,-36.5 -86.3,-96.8 -87.1,-161.7l443.7,0c-0.8,64.9 -33.2,125.2 -87.2,161.7z" />
<path
android:fillColor="#FFFFFF"
android:pathData="m543,690.4l-62,0c-0.7,0 -1.2,-0.5 -1.2,-1.2l0,-169.4c0,-0.7 0.5,-1.2 1.2,-1.2l62,0c0.7,0 1.2,0.5 1.2,1.2l0,169.4c0,0.7 -0.5,1.2 -1.2,1.2z" />
<path
android:fillColor="#FFFFFF"
android:pathData="M682.5,77.5a53.5,26.5 116.5,1 0,45 28.4a53.5,26.5 116.5,1 0,-45 -28.4z"
android:strokeWidth="1"
android:strokeColor="#FFFFFF" />
<path
android:fillColor="#FFFFFF"
android:pathData="M482,80a30,68 0,1 0,60 0a30,68 0,1 0,-60 0z"
android:strokeWidth="1"
android:strokeColor="#FFFFFF" />
<path
android:fillColor="#FFFFFF"
android:pathData="M296.5,105.6a53.5,26.5 63.5,1 0,45 -28.4a53.5,26.5 63.5,1 0,-45 28.4z"
android:strokeWidth="1"
android:strokeColor="#FFFFFF" />
</vector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/zxl_flashlight_on"/>
<item android:drawable="@drawable/zxl_flashlight_off"/>
<item android:drawable="@drawable/zxl_flashlight_on" android:state_selected="true" />
<item android:drawable="@drawable/zxl_flashlight_off" />
</selector>

View File

@@ -6,16 +6,19 @@
<androidx.camera.view.PreviewView
android:id="@+id/previewView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<com.king.zxing.ViewfinderView
android:id="@+id/viewfinderView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<ImageView
android:id="@+id/ivFlashlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/zxl_flashlight_selector"
android:layout_marginTop="@dimen/zxl_flashlight_margin_top" />
android:layout_marginTop="@dimen/zxl_flashlight_margin_top"
android:contentDescription="@null"
android:src="@drawable/zxl_flashlight_selector" />
</FrameLayout>

View File

@@ -40,6 +40,17 @@
<enum name="right" value="3"/>
<enum name="bottom" value="4"/>
</attr>
<attr name="pointColor" format="color"/>
<attr name="pointStrokeColor" format="color"/>
<attr name="pointRadius" format="dimension"/>
<attr name="pointStrokeRatio" format="float"/>
<attr name="pointDrawable" format="reference"/>
<attr name="showPointAnim" format="boolean"/>
<attr name="laserDrawable" format="reference"/>
<attr name="viewfinderStyle" format="enum">
<enum name="classic" value="0"/>
<enum name="popular" value="1"/>
</attr>
</declare-styleable>

View File

@@ -5,6 +5,7 @@
<color name="viewfinder_frame">#7F1FB3E2</color>
<color name="viewfinder_corner">#FF1FB3E2</color>
<color name="viewfinder_laser">#FF1FB3E2</color>
<color name="viewfinder_point">#FF1FB3E2</color>
<color name="viewfinder_text_color">#FFC0C0C0</color>
<color name="zxl_capture_status_bar_color">#00000000</color>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="zxl_flashlight_margin_top">80dp</dimen>
<dimen name="zxl_flashlight_margin_top">90dp</dimen>
</resources>