diff --git a/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning18GridAdapter.kt b/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning18GridAdapter.kt index 7f2256c..46e5223 100644 --- a/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning18GridAdapter.kt +++ b/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning18GridAdapter.kt @@ -93,7 +93,7 @@ class Seasoning18GridAdapter( holder.b.tvState.text = stateStr(item.state) } if (position == highlightedPosition) { - holder.b.root.setBackgroundColor(ContextCompat.getColor(holder.b.root.context, R.color.red_ff4444)) + holder.b.root.setBackgroundResource(R.drawable.shape_scale_cell_highlight) val white = ContextCompat.getColor(holder.b.root.context, R.color.white) holder.b.tvAddress.setTextColor(white) holder.b.tvName.setTextColor(white) diff --git a/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning22GridAdapter.kt b/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning22GridAdapter.kt index 0ea05a6..46cba74 100644 --- a/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning22GridAdapter.kt +++ b/app/src/main/java/com/shuwei/dish/match/adapter/Seasoning22GridAdapter.kt @@ -95,7 +95,7 @@ class Seasoning22GridAdapter( } // 高亮格子:红底白字;其余恢复默认 if (position == highlightedPosition) { - holder.b.root.setBackgroundColor(ContextCompat.getColor(holder.b.root.context, R.color.red_ff4444)) + holder.b.root.setBackgroundResource(R.drawable.shape_scale_cell_highlight) val white = ContextCompat.getColor(holder.b.root.context, R.color.white) holder.b.tvAddress.setTextColor(white) holder.b.tvName.setTextColor(white) diff --git a/app/src/main/res/drawable/shape_scale_cell_highlight.xml b/app/src/main/res/drawable/shape_scale_cell_highlight.xml new file mode 100644 index 0000000..ec5cb62 --- /dev/null +++ b/app/src/main/res/drawable/shape_scale_cell_highlight.xml @@ -0,0 +1,7 @@ + + + + + +