fix(food): 修复并发竞态、双重刷新及搜索态丢失问题

- FoodListFragment:添加 currentJob 取消机制,防止快速切换时旧请求覆盖新数据
- FoodListFragment:缓存 currentFoodName,返回二级页面后 onResume 复用搜索词
- CookingModeActivity:RadioGroup+RadioButton 替换为 LinearLayout+CheckedTextView
- CookingModeActivity:新增 selectTab() 统一管理选中态,内置幂等保护
- CookingModeActivity:重构 onNewIntent,消除切换餐次时 getDishList 被双重调用的问题
- VectorCollectionFragment:Error/Success 消费后重置 StateFlow,防止 replay 导致 toast 重复弹出

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 12:09:21 +08:00
co-authored by Claude Sonnet 4.6
parent d7f9fb05fb
commit ef6a29ffb0
3 changed files with 50 additions and 33 deletions
@@ -6,59 +6,62 @@
android:orientation="vertical"
tools:background="@drawable/bg_other_page">
<RadioGroup
android:id="@+id/dishRadioGroup"
<LinearLayout
android:id="@+id/llDishTabs"
android:layout_width="match_parent"
android:layout_height="88dp"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rbBreakfast"
<CheckedTextView
android:id="@+id/tvBreakfast"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="30dp"
android:layout_weight="1"
android:background="@drawable/breakfast_bg"
android:button="@null"
android:checkMark="@null"
android:checked="true"
android:gravity="center"
android:textAlignment="center"
android:text="@string/text_breakfast"
android:textColor="@color/breakfast_font"
android:textSize="30sp"
android:textStyle="bold" />
<RadioButton
android:id="@+id/rbLunch"
<CheckedTextView
android:id="@+id/tvLunch"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="9dp"
android:layout_weight="1"
android:background="@drawable/breakfast_bg"
android:button="@null"
android:checkMark="@null"
android:checked="false"
android:gravity="center"
android:textAlignment="center"
android:text="@string/text_lunch"
android:textColor="@color/breakfast_font"
android:textSize="30sp"
android:textStyle="bold" />
<RadioButton
android:id="@+id/rbDinner"
<CheckedTextView
android:id="@+id/tvDinner"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="9dp"
android:layout_marginEnd="30dp"
android:layout_weight="1"
android:background="@drawable/breakfast_bg"
android:button="@null"
android:checkMark="@null"
android:checked="false"
android:gravity="center"
android:textAlignment="center"
android:text="@string/text_dinner"
android:textColor="@color/breakfast_font"
android:textSize="30sp"
android:textStyle="bold" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/llSearchBar"