refactor(collect): 重构食材采集功能界面和适配器
- 将按钮组件替换为TextView以支持更好的交互效果 - 添加selectableItemBackground实现点击反馈效果 - 重命名食材采样为食材采集保持术语一致性 - 替换FoodCollectionAdapter为VectorCollectionAdapter适配器 - 更新列表项布局从list_item_food_collection到list_item_vector_collection - 添加FoodSearchAdapter适配器用于食材搜索功能 - 重构CollectFragment中的数据绑定和UI逻辑 - 修改相机容器布局位置优化界面结构 - 更新资源文件名和颜色定义提升代码可读性 - 调整保存按钮样式增强视觉效果 - 修改提示对话框内容精确表达功能意图
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
package com.shuwei.dish.match.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import com.chad.library.adapter4.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||||
|
import com.shuwei.dish.match.R
|
||||||
|
import com.shuwei.dish.match.databinding.ListItemSearchFoodBinding
|
||||||
|
import com.shuwei.dish.match.databinding.ListItemSearchGoodsInfoBinding
|
||||||
|
import com.shuwei.dish.match.entity.CookFoodGoodsEntity
|
||||||
|
import com.shuwei.dish.match.utils.ext.gone
|
||||||
|
import com.shuwei.dish.match.utils.ext.roundedDecimalPlace
|
||||||
|
import com.shuwei.dish.match.utils.ext.visible
|
||||||
|
|
||||||
|
class FoodSearchAdapter(private var list: MutableList<CookFoodGoodsEntity>) :
|
||||||
|
BaseQuickAdapter<CookFoodGoodsEntity, FoodSearchAdapter.VH>(list) {
|
||||||
|
|
||||||
|
override fun onBindViewHolder(
|
||||||
|
holder: VH,
|
||||||
|
position: Int,
|
||||||
|
item: CookFoodGoodsEntity?
|
||||||
|
) {
|
||||||
|
item ?: return
|
||||||
|
holder.binding.tvFoodName.run {
|
||||||
|
text = item.goodsName
|
||||||
|
isChecked = item.isClicked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(
|
||||||
|
context: Context,
|
||||||
|
parent: ViewGroup,
|
||||||
|
viewType: Int
|
||||||
|
): VH {
|
||||||
|
val binding = ListItemSearchFoodBinding.inflate(LayoutInflater.from(context), parent, false)
|
||||||
|
return VH(binding)
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class VH(var binding: ListItemSearchFoodBinding) : QuickViewHolder(binding.root)
|
||||||
|
|
||||||
|
}
|
||||||
+5
-5
@@ -8,18 +8,18 @@ import android.widget.ImageView
|
|||||||
import com.chad.library.adapter4.BaseQuickAdapter
|
import com.chad.library.adapter4.BaseQuickAdapter
|
||||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||||
import com.shuwei.dish.match.R
|
import com.shuwei.dish.match.R
|
||||||
import com.shuwei.dish.match.databinding.ListItemFoodCollectionBinding
|
import com.shuwei.dish.match.databinding.ListItemVectorCollectionBinding
|
||||||
import com.shuwei.dish.match.objbox.FoodCollectionBean
|
import com.shuwei.dish.match.objbox.FoodCollectionBean
|
||||||
import com.shuwei.dish.match.utils.ext.load
|
import com.shuwei.dish.match.utils.ext.load
|
||||||
|
|
||||||
class FoodCollectionAdapter (var list: MutableList<FoodCollectionBean>) :
|
class VectorCollectionAdapter (var list: MutableList<FoodCollectionBean>) :
|
||||||
BaseQuickAdapter<FoodCollectionBean, FoodCollectionAdapter.VH>(list) {
|
BaseQuickAdapter<FoodCollectionBean, VectorCollectionAdapter.VH>(list) {
|
||||||
|
|
||||||
inner class VH(var binding: ListItemFoodCollectionBinding) : QuickViewHolder(binding.root)
|
inner class VH(var binding: ListItemVectorCollectionBinding) : QuickViewHolder(binding.root)
|
||||||
|
|
||||||
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): VH {
|
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): VH {
|
||||||
val inflater = LayoutInflater.from(context)
|
val inflater = LayoutInflater.from(context)
|
||||||
val binding = ListItemFoodCollectionBinding.inflate(inflater, parent, false)
|
val binding = ListItemVectorCollectionBinding.inflate(inflater, parent, false)
|
||||||
return VH(binding)
|
return VH(binding)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,8 +265,8 @@ class PrepareCookActivity : BaseActivity() {
|
|||||||
|
|
||||||
private fun showRemindDialog() {
|
private fun showRemindDialog() {
|
||||||
CommonDialog(this)
|
CommonDialog(this)
|
||||||
.setTitle("制作提示")
|
.setTitle(getString(R.string.food_remind_01))
|
||||||
.setContent(getString(R.string.food_remind_01))
|
.setContent(getString(R.string.food_remind_02))
|
||||||
.setNegativeButton("返回调整")
|
.setNegativeButton("返回调整")
|
||||||
.setPositiveButton("确认无误") { openSubmitPage() }
|
.setPositiveButton("确认无误") { openSubmitPage() }
|
||||||
.setOnDismissCallback { hideStatusBar() }
|
.setOnDismissCallback { hideStatusBar() }
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class SettingActivity : BaseActivity() {
|
|||||||
private fun showNotGrantedCameraPermissionDialog() {
|
private fun showNotGrantedCameraPermissionDialog() {
|
||||||
CommonDialog(this)
|
CommonDialog(this)
|
||||||
.setTitle("温馨提示")
|
.setTitle("温馨提示")
|
||||||
.setContent("暂无相机权限,无法使用菜品采集功能,请确认是否同意开始权限?")
|
.setContent("暂无相机权限,无法使用食材采集功能,请确认是否同意开始权限?")
|
||||||
.setNegativeButton("不同意")
|
.setNegativeButton("不同意")
|
||||||
.setPositiveButton("同意") {
|
.setPositiveButton("同意") {
|
||||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class SingleFragmentActivity : BaseActivity() {
|
|||||||
* 根据页面类型返回对应标题文本
|
* 根据页面类型返回对应标题文本
|
||||||
*/
|
*/
|
||||||
private fun getTitleForPage(pageType: PageType): String = when (pageType) {
|
private fun getTitleForPage(pageType: PageType): String = when (pageType) {
|
||||||
PageType.FOOD_COLLECT -> "食材采样"
|
PageType.FOOD_COLLECT -> "食材采集"
|
||||||
PageType.COOK_MODE -> "餐品模式"
|
PageType.COOK_MODE -> "餐品模式"
|
||||||
PageType.SEASONING_CONFIG -> "调料区设置"
|
PageType.SEASONING_CONFIG -> "调料区设置"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,13 @@ import androidx.core.view.doOnLayout
|
|||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import com.shuwei.dish.match.R
|
import com.shuwei.dish.match.R
|
||||||
import com.shuwei.dish.match.adapter.FoodCollectionAdapter
|
import com.shuwei.dish.match.adapter.VectorCollectionAdapter
|
||||||
|
import com.shuwei.dish.match.adapter.FoodSearchAdapter
|
||||||
import com.shuwei.dish.match.base.BaseFragment
|
import com.shuwei.dish.match.base.BaseFragment
|
||||||
import com.shuwei.dish.match.databinding.FragmentCollectBinding
|
import com.shuwei.dish.match.databinding.FragmentCollectBinding
|
||||||
import com.shuwei.dish.match.databinding.LayoutCameraPreviewBinding
|
import com.shuwei.dish.match.databinding.LayoutCameraPreviewBinding
|
||||||
import com.shuwei.dish.match.dialog.Loading
|
import com.shuwei.dish.match.dialog.Loading
|
||||||
|
import com.shuwei.dish.match.entity.CookFoodGoodsEntity
|
||||||
import com.shuwei.dish.match.objbox.FoodCollectionBean
|
import com.shuwei.dish.match.objbox.FoodCollectionBean
|
||||||
import com.shuwei.dish.match.objbox.FoodModule
|
import com.shuwei.dish.match.objbox.FoodModule
|
||||||
import com.shuwei.dish.match.ui.CollectedFoodActivity
|
import com.shuwei.dish.match.ui.CollectedFoodActivity
|
||||||
@@ -45,34 +47,47 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
private var selectedFoodId: String? = ""
|
private var selectedFoodId: String? = ""
|
||||||
private var selectedFoodName: String? = ""
|
private var selectedFoodName: String? = ""
|
||||||
|
|
||||||
private val foodCollectionList = mutableListOf<FoodCollectionBean>().apply {
|
private val vectorList = mutableListOf<FoodCollectionBean>().apply {
|
||||||
repeat(MAX_COUNT) {
|
repeat(MAX_COUNT) {
|
||||||
add(FoodCollectionBean(isShowCamera = true))
|
add(FoodCollectionBean(isShowCamera = true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private val searchFoodList = mutableListOf<FoodInfo>()
|
private val searchList = mutableListOf<CookFoodGoodsEntity>().apply {
|
||||||
// private var settingActivity: SettingActivity? = null
|
add(CookFoodGoodsEntity(goodsId = "200001", goodsName = "土豆丝"))
|
||||||
// private var checkedItem: FoodInfo? = null
|
add(CookFoodGoodsEntity(goodsId = "200002", goodsName = "土豆片"))
|
||||||
// private val searchFoodAdapter by lazy {
|
add(CookFoodGoodsEntity(goodsId = "200003", goodsName = "土豆丁"))
|
||||||
// CollectFoodListAdapter(searchFoodList).apply {
|
add(CookFoodGoodsEntity(goodsId = "200004", goodsName = "胡萝卜丝"))
|
||||||
// setOnItemClickListener { adapter, view, position ->
|
add(CookFoodGoodsEntity(goodsId = "200005", goodsName = "胡萝卜片"))
|
||||||
// searchFoodList.forEachIndexed { index, item -> item.isChecked = index == position }
|
add(CookFoodGoodsEntity(goodsId = "200006", goodsName = "胡萝卜丁"))
|
||||||
// checkedItem = searchFoodList[position]
|
add(CookFoodGoodsEntity(goodsId = "200007", goodsName = "黄瓜丝"))
|
||||||
// notifyDataSetChanged()
|
add(CookFoodGoodsEntity(goodsId = "200008", goodsName = "黄瓜片"))
|
||||||
// selectedFoodId = checkedItem!!.foodId
|
add(CookFoodGoodsEntity(goodsId = "200009", goodsName = "黄瓜丁"))
|
||||||
// selectedFoodName = checkedItem!!.foodName
|
add(CookFoodGoodsEntity(goodsId = "200010", goodsName = "洋葱丝"))
|
||||||
// }
|
add(CookFoodGoodsEntity(goodsId = "200011", goodsName = "洋葱丁"))
|
||||||
// }
|
}
|
||||||
// }
|
private var checkedItem: CookFoodGoodsEntity? = null
|
||||||
|
private val searchAdapter by lazy {
|
||||||
|
FoodSearchAdapter(searchList).apply {
|
||||||
|
setOnItemClickListener { adapter, view, position ->
|
||||||
|
searchList.forEachIndexed { index, item -> item.isClicked = index == position }
|
||||||
|
checkedItem = searchList[position]
|
||||||
|
notifyDataSetChanged()
|
||||||
|
checkedItem?.let {
|
||||||
|
selectedFoodId = it.foodId
|
||||||
|
selectedFoodName = it.goodsName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
private val debouncer = Debouncer(2000)
|
private val debouncer = Debouncer(2000)
|
||||||
// private lateinit var settingActivity: SettingActivity
|
|
||||||
private lateinit var currentActivity: SingleFragmentActivity
|
private lateinit var currentActivity: SingleFragmentActivity
|
||||||
|
|
||||||
private val collectionAdapter: FoodCollectionAdapter by lazy {
|
private val vectorAdapter: VectorCollectionAdapter by lazy {
|
||||||
FoodCollectionAdapter(foodCollectionList).apply {
|
VectorCollectionAdapter(vectorList).apply {
|
||||||
addOnItemChildClickListener(R.id.ivDelete) { _, _, position ->
|
addOnItemChildClickListener(R.id.ivDelete) { _, _, position ->
|
||||||
foodCollectionList[position].let {
|
vectorList[position].let {
|
||||||
it.bitmap = null
|
it.bitmap = null
|
||||||
it.imageVector = null
|
it.imageVector = null
|
||||||
it.imageFile = null
|
it.imageFile = null
|
||||||
@@ -96,23 +111,23 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
|
|
||||||
//typealias CameraCallback = (Uri) -> Unit
|
//typealias CameraCallback = (Uri) -> Unit
|
||||||
|
|
||||||
private val cameraCallback: (Uri) -> Unit = { uri ->
|
private val cameraCallback: (Uri) -> Unit = cameraCallback@{ uri ->
|
||||||
try {
|
try {
|
||||||
val index = foodCollectionList.indexOfFirst { it.imageFile == null }
|
val index = vectorList.indexOfFirst { it.imageFile == null }
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
toast("每次只允许保存${MAX_COUNT}条数据")
|
toast("每次只允许保存${MAX_COUNT}条数据")
|
||||||
hideWaitingDialog()
|
hideWaitingDialog()
|
||||||
rerurn@ cameraCallback
|
return@cameraCallback
|
||||||
}
|
}
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
foodCollectionList[index].let {
|
vectorList[index].let {
|
||||||
it.imageVector = null
|
it.imageVector = null
|
||||||
it.bitmap = null
|
it.bitmap = null
|
||||||
it.isShowCamera = false
|
it.isShowCamera = false
|
||||||
it.imageFile = null
|
it.imageFile = null
|
||||||
it.imageUri = uri
|
it.imageUri = uri
|
||||||
}
|
}
|
||||||
collectionAdapter.notifyItemChanged(index)
|
vectorAdapter.notifyItemChanged(index)
|
||||||
}
|
}
|
||||||
// hideWaitingDialog()
|
// hideWaitingDialog()
|
||||||
Thread {
|
Thread {
|
||||||
@@ -149,13 +164,13 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
log("${this.javaClass.simpleName}-cameraCallback-裁剪bitmap保存文件路径:${file?.absolutePath}")
|
log("${this.javaClass.simpleName}-cameraCallback-裁剪bitmap保存文件路径:${file?.absolutePath}")
|
||||||
|
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
foodCollectionList[index].let {
|
vectorList[index].let {
|
||||||
it.imageVector = imageVector
|
it.imageVector = imageVector
|
||||||
it.bitmap = null
|
it.bitmap = null
|
||||||
it.isShowCamera = false
|
it.isShowCamera = false
|
||||||
it.imageFile = file
|
it.imageFile = file
|
||||||
}
|
}
|
||||||
collectionAdapter.notifyItemChanged(index)
|
vectorAdapter.notifyItemChanged(index)
|
||||||
}
|
}
|
||||||
if (bitmap.isRecycled.not()) {
|
if (bitmap.isRecycled.not()) {
|
||||||
bitmap.recycle()
|
bitmap.recycle()
|
||||||
@@ -165,12 +180,12 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private fun takePhoto() {
|
private fun takePhoto() {
|
||||||
val count = foodCollectionList.count { it.bitmap != null }
|
val count = vectorList.count { it.bitmap != null }
|
||||||
if (count >= MAX_COUNT) {
|
if (count >= MAX_COUNT) {
|
||||||
toast("每次只允许保存${MAX_COUNT}条数据")
|
toast("每次只允许保存${MAX_COUNT}条数据")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val index = foodCollectionList.indexOfFirst { it.imageFile == null }
|
val index = vectorList.indexOfFirst { it.imageFile == null }
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
toast("每次只允许保存${MAX_COUNT}条数据")
|
toast("每次只允许保存${MAX_COUNT}条数据")
|
||||||
hideWaitingDialog()
|
hideWaitingDialog()
|
||||||
@@ -212,7 +227,7 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
binding.rvFoodList.let {
|
binding.rvFoodList.let {
|
||||||
it.layoutManager =
|
it.layoutManager =
|
||||||
GridLayoutManager(requireActivity(), 3, GridLayoutManager.VERTICAL, false)
|
GridLayoutManager(requireActivity(), 3, GridLayoutManager.VERTICAL, false)
|
||||||
it.adapter = collectionAdapter
|
it.adapter = vectorAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnFoodSearch.setOnClickListener {
|
binding.btnFoodSearch.setOnClickListener {
|
||||||
@@ -248,7 +263,7 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
startActivity(Intent(requireActivity(), CollectedFoodActivity::class.java))
|
startActivity(Intent(requireActivity(), CollectedFoodActivity::class.java))
|
||||||
}
|
}
|
||||||
binding.btnTakePhoto.clickWithDebounce {
|
binding.btnTakePhoto.clickWithDebounce {
|
||||||
val count = foodCollectionList.count { it.bitmap != null }
|
val count = vectorList.count { it.bitmap != null }
|
||||||
if (count >= MAX_COUNT) {
|
if (count >= MAX_COUNT) {
|
||||||
toast("每次只允许保存${MAX_COUNT}条数据")
|
toast("每次只允许保存${MAX_COUNT}条数据")
|
||||||
return@clickWithDebounce
|
return@clickWithDebounce
|
||||||
@@ -256,10 +271,10 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
takePhoto()
|
takePhoto()
|
||||||
}
|
}
|
||||||
binding.btnClearData.setOnClickListener { clearData() }
|
binding.btnClearData.setOnClickListener { clearData() }
|
||||||
// binding.rvSearchFood.let {
|
binding.rvSearchFood.let {
|
||||||
// it.layoutManager = GridLayoutManager(context, 2)
|
it.layoutManager = GridLayoutManager(context, 2)
|
||||||
// it.adapter = searchFoodAdapter
|
it.adapter = searchAdapter
|
||||||
// }
|
}
|
||||||
|
|
||||||
searchFood()
|
searchFood()
|
||||||
}
|
}
|
||||||
@@ -342,7 +357,7 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun clearData() {
|
fun clearData() {
|
||||||
foodCollectionList.forEach {
|
vectorList.forEach {
|
||||||
it.bitmap = null
|
it.bitmap = null
|
||||||
it.imageVector = null
|
it.imageVector = null
|
||||||
it.imageFile = null
|
it.imageFile = null
|
||||||
@@ -351,7 +366,7 @@ class CollectFragment : BaseFragment<FragmentCollectBinding>(){
|
|||||||
it.isFinish = false
|
it.isFinish = false
|
||||||
it.uploadSuccess = false
|
it.uploadSuccess = false
|
||||||
}
|
}
|
||||||
collectionAdapter.notifyDataSetChanged()
|
vectorAdapter.notifyDataSetChanged()
|
||||||
|
|
||||||
clickIndex = -1
|
clickIndex = -1
|
||||||
binding.editFoodName.setText("")
|
binding.editFoodName.setText("")
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="@color/dish_green" android:state_checked="true" />
|
||||||
|
<item android:color="#5E7585" android:state_checked="false" />
|
||||||
|
</selector>
|
||||||
+3
-3
@@ -4,14 +4,14 @@
|
|||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="50dp"/>
|
<corners android:radius="50dp"/>
|
||||||
<solid android:color="@color/white"/>
|
<solid android:color="@color/white"/>
|
||||||
<!-- <stroke android:color="#FFC4CFDA" android:width="2dp"/>-->
|
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item android:state_checked="true">
|
<item android:state_checked="true">
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<corners android:radius="50dp"/>
|
<corners android:radius="50dp"/>
|
||||||
<solid android:color="#FFFFF0F0"/>
|
<!-- <solid android:color="#FFFFF0F0"/>-->
|
||||||
<stroke android:color="#FFFF3232" android:width="2dp"/>
|
<solid android:color="#F0FFF0"/>
|
||||||
|
<stroke android:color="@color/dish_green" android:width="2dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
</selector>
|
</selector>
|
||||||
@@ -271,7 +271,7 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<TextView
|
||||||
android:id="@+id/btnCook"
|
android:id="@+id/btnCook"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
@@ -282,6 +282,7 @@
|
|||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:background="@drawable/shape_green_bg"
|
android:background="@drawable/shape_green_bg"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:clickable="true" />
|
android:clickable="true" />
|
||||||
|
|
||||||
<!-- android:background="@drawable/ripple_effect_green"-->
|
<!-- android:background="@drawable/ripple_effect_green"-->
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
android:layout_marginTop="30dp"
|
android:layout_marginTop="30dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/shape_green_bg"
|
android:background="@drawable/shape_green_bg"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:text="更换食材"
|
android:text="更换食材"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
@@ -79,6 +80,7 @@
|
|||||||
android:layout_marginBottom="30dp"
|
android:layout_marginBottom="30dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/shape_white_12_corners"
|
android:background="@drawable/shape_white_12_corners"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:text="取消"
|
android:text="取消"
|
||||||
android:textColor="@color/black333"
|
android:textColor="@color/black333"
|
||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
|
|||||||
@@ -75,6 +75,11 @@
|
|||||||
android:textColor="@color/black666"
|
android:textColor="@color/black666"
|
||||||
android:textSize="28sp" />
|
android:textSize="28sp" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/flCameraContainer"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="1dp" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
@@ -89,17 +94,13 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<TextView
|
||||||
android:id="@+id/flCameraContainer"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="1dp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
|
||||||
android:id="@+id/btnCook"
|
android:id="@+id/btnCook"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
android:layout_margin="30dp"
|
android:layout_margin="30dp"
|
||||||
android:background="@drawable/shape_green_bg"
|
android:background="@drawable/shape_green_bg"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/goCooking"
|
android:text="@string/goCooking"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="食材采样"
|
android:text="食材采集"
|
||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<TextView
|
||||||
android:id="@+id/btnCook"
|
android:id="@+id/btnCook"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
@@ -121,6 +121,7 @@
|
|||||||
android:layout_marginBottom="30dp"
|
android:layout_marginBottom="30dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/shape_green_stroke"
|
android:background="@drawable/shape_green_stroke"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="制作"
|
android:text="制作"
|
||||||
android:textColor="@color/dish_green"
|
android:textColor="@color/dish_green"
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
<!-- android:background="@drawable/ripple_effect_light"-->
|
<!-- android:background="@drawable/ripple_effect_light"-->
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<TextView
|
||||||
android:id="@+id/btnSubmit"
|
android:id="@+id/btnSubmit"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="90dp"
|
android:layout_height="90dp"
|
||||||
@@ -138,6 +139,7 @@
|
|||||||
android:layout_marginBottom="30dp"
|
android:layout_marginBottom="30dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/shape_green_bg"
|
android:background="@drawable/shape_green_bg"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="提交"
|
android:text="提交"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
app:spanCount="3"
|
app:spanCount="3"
|
||||||
tools:itemCount="12"
|
tools:itemCount="12"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
tools:listitem="@layout/list_item_food_collection" />
|
tools:listitem="@layout/list_item_vector_collection" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
@@ -157,9 +157,9 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/setting_border_gray3"
|
android:background="@drawable/setting_border_gray3"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:hint="输入菜品名称"
|
android:hint="输入食材名称"
|
||||||
android:inputType="text"
|
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
|
android:inputType="text"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="47dp"
|
android:paddingStart="47dp"
|
||||||
android:paddingEnd="80dp"
|
android:paddingEnd="80dp"
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
tools:listitem="@layout/list_item_search_food"/>
|
tools:listitem="@layout/list_item_search_food"/>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<TextView
|
||||||
android:id="@+id/btnSave"
|
android:id="@+id/btnSave"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
@@ -199,8 +199,12 @@
|
|||||||
android:layout_marginBottom="32dp"
|
android:layout_marginBottom="32dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:text="保存"
|
android:text="保存"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:foreground="?android:attr/selectableItemBackground"
|
||||||
android:background="@drawable/bg_btn_save"
|
android:background="@drawable/bg_btn_save"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="40sp" />
|
android:textSize="40sp"
|
||||||
|
android:clipToOutline="true"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
android:id="@+id/tvFoodName"
|
android:id="@+id/tvFoodName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
tools:background="@drawable/bg_text_main"
|
android:background="@drawable/bg_item_search"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
android:layout_marginVertical="14dp"
|
android:layout_marginVertical="14dp"
|
||||||
android:paddingHorizontal="15dp"
|
android:paddingHorizontal="15dp"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
tools:textColor="@color/black"
|
android:textColor="@color/color_item_search"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="肉沫干拌面" />
|
tools:text="土豆丝" />
|
||||||
Reference in New Issue
Block a user