接口调试、增加人脸识别后主副屏支付金额逻辑、其它优化

This commit is contained in:
2025-12-03 18:40:47 +08:00
parent 29188c5944
commit 8899cae323
34 changed files with 1202 additions and 402 deletions
+14 -5
View File
@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#80FF3232"/>
<corners android:radius="6dp"/>
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="#80FF3232"/>
<corners android:radius="6dp"/>
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="rectangle">
<solid android:color="#FFFF3232"/>
<corners android:radius="6dp"/>
</shape>
</item>
</selector>
@@ -44,33 +44,39 @@
</FrameLayout>
<!-- <com.scwang.smart.refresh.layout.SmartRefreshLayout-->
<!-- android:id="@+id/refreshLayout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_marginHorizontal="130dp"-->
<!-- android:layout_marginTop="40dp"-->
<!-- android:layout_marginBottom="58dp"-->
<!-- app:layout_constraintBottom_toTopOf="@id/dividerLine"-->
<!-- app:layout_constraintTop_toBottomOf="@id/flSearchBlock">-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- <com.scwang.smart.refresh.header.ClassicsHeader-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content" />-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFoodList"
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:layout_margin="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="8"
tools:listitem="@layout/list_item_collected_food" />
android:layout_margin="10dp">
<!-- <com.scwang.smart.refresh.footer.ClassicsFooter-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content" />-->
<!-- </com.scwang.smart.refresh.layout.SmartRefreshLayout>-->
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFoodList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="8"
tools:listitem="@layout/list_item_collected_food" />
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<include
android:id="@+id/emptyInclude"
layout="@layout/layout_empty_search"
android:visibility="gone"/>
</FrameLayout>
</LinearLayout>
+2 -1
View File
@@ -77,12 +77,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="食物图预览"
android:scaleType="centerCrop"
app:shapeAppearance="@style/round10dpCornerStyle"
android:visibility="gone" />
<View
+3 -2
View File
@@ -111,7 +111,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFoodList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="400dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
@@ -119,7 +119,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/flPreview"
app:spanCount="3"
tools:itemCount="5"
tools:itemCount="12"
android:overScrollMode="never"
tools:listitem="@layout/list_item_food_collection" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -126,15 +126,10 @@
android:id="@+id/ivPayQrCode"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_marginTop="56dp"
android:layout_marginVertical="50dp"
android:src="@drawable/ic_qrcode"
android:visibility="visible" />
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tvAccountInfo"
android:layout_width="wrap_content"
@@ -143,20 +138,26 @@
android:textColor="#ff889ac2"
android:textSize="30sp" />
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnConfirmPay"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="50dp"
android:layout_marginBottom="32dp"
android:background="@drawable/bg_btn_save2"
android:text="确认支付"
android:enabled="true"
android:textColor="@color/white"
android:textSize="40sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layoutPaySuccess"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:orientation="vertical"
tools:ignore="HardcodedText">
@@ -18,17 +19,17 @@
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="39dp"
android:text="暂无该物品"
android:text="暂无采集记录"
android:textColor="#ff000000"
android:textSize="30sp"
android:textSize="36sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请检查物品名称,或稍后重新搜索"
android:text="请确认菜品名称,或稍后重"
android:textColor="#ff999999"
android:gravity="center"
android:textSize="26sp" />
android:textSize="30sp" />
</LinearLayout>
+16 -11
View File
@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_gravity="center"
android:orientation="vertical">
@@ -12,15 +12,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="热量"
android:layout_marginTop="65dp"
android:layout_marginTop="50dp"
android:textColor="#ff5e7585"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvCalorie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="15dp"
android:layout_marginVertical="13dp"
android:textColor="#ff0a1428"
android:textSize="40sp"
android:textStyle="bold"
@@ -32,12 +33,12 @@
android:textColor="#ff5e7585"
android:textSize="20sp"
android:textStyle="bold"
tools:text="kcal/100g" />
android:text="kcal/100g" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginVertical="28dp"
android:layout_marginVertical="22dp"
android:layout_marginHorizontal="28dp"
android:background="#FFDBE5FB" />
@@ -51,6 +52,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
app:layout_constraintEnd_toStartOf="@+id/llProtein"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent">
@@ -59,7 +61,7 @@
android:id="@+id/tvFatRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13%"
tools:text="13%"
android:textColor="#ff5e7585"
android:textSize="16sp" />
@@ -91,6 +93,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
app:layout_constraintEnd_toStartOf="@+id/llCarbohydrate"
app:layout_constraintStart_toEndOf="@id/llFat">
@@ -98,7 +101,7 @@
android:id="@+id/tvProteinRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="47%"
tools:text="47%"
android:textColor="#ff5e7585"
android:textSize="16sp" />
@@ -130,6 +133,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/llProtein">
@@ -137,7 +141,7 @@
android:id="@+id/tvCarbohydrateRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="40%"
tools:text="40%"
android:textColor="#ff5e7585"
android:textSize="16sp" />
@@ -168,11 +172,12 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="(所示营养数据为每百克含量)"
android:textColor="#ff889ac2"
android:layout_marginTop="56dp"
android:layout_marginBottom="27dp"
android:paddingBottom="20dp"
android:gravity="bottom"
android:textSize="16sp" />
</LinearLayout>
@@ -2,7 +2,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -18,14 +17,14 @@
android:layout_height="wrap_content"
android:background="@drawable/setting_border"
android:orientation="vertical"
android:paddingBottom="28dp">
android:paddingBottom="26dp">
<TextView
android:id="@+id/tvFoodName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginVertical="60dp"
android:layout_marginVertical="50dp"
android:text="餐品识别中..."
android:textColor="#ff0a1428"
android:textSize="40sp"
@@ -76,17 +75,20 @@
</FrameLayout>
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivPreviewImage"
android:layout_width="match_parent"
android:layout_height="456dp"
app:shapeAppearance="@style/round10dpCornerStyle"
tools:background="@mipmap/ic_launcher"/>
<!-- <ImageView-->
<!-- android:id="@+id/ivRecImage"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="456dp"-->
<!-- tools:background="@mipmap/ic_launcher"/>-->
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/ivRecImage"
android:layout_width="match_parent"
android:layout_height="456dp"
tools:background="@mipmap/ic_launcher_round"
app:shapeAppearance="@style/round10dpCornerStyle"
android:visibility="gone"/>
<ImageView
android:layout_width="match_parent"
@@ -100,13 +102,13 @@
android:id="@+id/llPriceInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginTop="26dp"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:visibility="gone">
<TextView
android:id="@+id/tvOldPrice"
android:id="@+id/tvNormalPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff0a1428"
+4
View File
@@ -172,4 +172,8 @@
<item name="cornerSize">50%</item>
</style>
<style name="round10dpCornerStyle">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">10dp</item>
</style>
</resources>