|
@@ -141,10 +141,11 @@ class HomeViewModel : BaseViewModel() {
|
|
|
allList.addAll(recipesList)
|
|
|
allList.addAll(foodList)
|
|
|
result.add(CategoryModel(recipeCount + foodCount, recipeCount, foodCount))
|
|
|
+ val foodContentList = mutableListOf<FoodContentModel>()
|
|
|
when (categoryType) {
|
|
|
CategoryType.All -> {
|
|
|
allList.forEach {
|
|
|
- result.add(
|
|
|
+ foodContentList.add(
|
|
|
FoodContentModel(
|
|
|
it.photoPath ?: "",
|
|
|
it.name ?: "",
|
|
@@ -158,7 +159,7 @@ class HomeViewModel : BaseViewModel() {
|
|
|
}
|
|
|
CategoryType.Recipes -> {
|
|
|
recipesList.forEach {
|
|
|
- result.add(
|
|
|
+ foodContentList.add(
|
|
|
FoodContentModel(
|
|
|
it.photoPath ?: "",
|
|
|
it.name ?: "",
|
|
@@ -172,7 +173,7 @@ class HomeViewModel : BaseViewModel() {
|
|
|
}
|
|
|
CategoryType.Ingredients -> {
|
|
|
foodList.forEach {
|
|
|
- result.add(
|
|
|
+ foodContentList.add(
|
|
|
FoodContentModel(
|
|
|
it.photoPath ?: "",
|
|
|
it.name ?: "",
|
|
@@ -185,6 +186,7 @@ class HomeViewModel : BaseViewModel() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ result.add(FoodListModel(foodContentList,""))
|
|
|
hotWordSearchRecipesLiveData.postValue(result)
|
|
|
}
|
|
|
}
|