优化
This commit is contained in:
@@ -93,11 +93,18 @@ class FoodCollectionActivity : ComponentActivity() {
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
cameraUtils.bind()
|
||||
binding.llCameraFlag.run {
|
||||
visible()
|
||||
postDelayed({
|
||||
gone()
|
||||
}, 3000)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
cameraUtils.unbind()
|
||||
binding.llCameraFlag.visible()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@@ -377,6 +384,7 @@ class FoodCollectionActivity : ComponentActivity() {
|
||||
if (emptyBinding == null) {
|
||||
emptyBinding = LayoutEmptySearchBinding.inflate(layoutInflater, binding.rvSearch, false)
|
||||
}
|
||||
emptyBinding?.tvContent?.text = "请检查物品名称,或稍后重新搜索"
|
||||
emptyBinding?.root?.let { layout ->
|
||||
layout.setOnClickListener { layout.hideKeyboard() }
|
||||
searchAdapter.stateView = layout
|
||||
|
||||
@@ -76,11 +76,48 @@
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/flCameraPreview"
|
||||
android:id="@+id/flPreview"
|
||||
android:layout_width="420dp"
|
||||
android:layout_height="420dp"
|
||||
app:layout_constraintStart_toStartOf="@id/layoutTop"
|
||||
app:layout_constraintTop_toBottomOf="@id/layoutTop" />
|
||||
app:layout_constraintTop_toBottomOf="@id/layoutTop">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/flCameraPreview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="2dp"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llCameraFlag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bg_white_radius10_stroke2_dash"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/ic_camera_gray"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="图片采集"
|
||||
android:textColor="#ffb4b4c8"
|
||||
android:textSize="24sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnTakePhoto"
|
||||
@@ -94,9 +131,9 @@
|
||||
android:textColor="#FF0032C8"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@id/flCameraPreview"
|
||||
app:layout_constraintStart_toStartOf="@id/flCameraPreview"
|
||||
app:layout_constraintTop_toBottomOf="@id/flCameraPreview" />
|
||||
app:layout_constraintEnd_toEndOf="@id/flPreview"
|
||||
app:layout_constraintStart_toStartOf="@id/flPreview"
|
||||
app:layout_constraintTop_toBottomOf="@id/flPreview" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnClearData"
|
||||
@@ -121,8 +158,8 @@
|
||||
android:layout_marginStart="20dp"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintStart_toEndOf="@id/flCameraPreview"
|
||||
app:layout_constraintTop_toTopOf="@id/flCameraPreview"
|
||||
app:layout_constraintStart_toEndOf="@id/flPreview"
|
||||
app:layout_constraintTop_toTopOf="@id/flPreview"
|
||||
app:spanCount="3"
|
||||
tools:itemCount="6"
|
||||
tools:listitem="@layout/list_item_food_collection" />
|
||||
@@ -137,7 +174,7 @@
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/rvFoodCollection"
|
||||
app:layout_constraintTop_toTopOf="@id/flCameraPreview">
|
||||
app:layout_constraintTop_toTopOf="@id/flPreview">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -157,7 +194,7 @@
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/rvFoodCollection"
|
||||
app:layout_constraintTop_toTopOf="@id/flCameraPreview">
|
||||
app:layout_constraintTop_toTopOf="@id/flPreview">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbCollected"
|
||||
@@ -199,10 +236,10 @@
|
||||
android:background="@drawable/bg_gray"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/rvFoodCollection"
|
||||
app:layout_constraintTop_toBottomOf="@id/layoutTab"
|
||||
android:visibility="gone">
|
||||
app:layout_constraintTop_toBottomOf="@id/layoutTab">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etGoodsInput"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="请检查物品名称,或点击“添加物品”按钮新增物品信息"
|
||||
|
||||
Reference in New Issue
Block a user