|
@@ -382,16 +382,11 @@ class HomeViewModel : BaseViewModel() {
|
|
val newFoods = searchLocalFood.subList(startFoodSearchSize, endFoodSearchSize)
|
|
val newFoods = searchLocalFood.subList(startFoodSearchSize, endFoodSearchSize)
|
|
lastLocalSearchFoodList.addAll(newFoods)
|
|
lastLocalSearchFoodList.addAll(newFoods)
|
|
}
|
|
}
|
|
- val result = mutableListOf<Any>()
|
|
|
|
- val homeHeader = HomeHeader()
|
|
|
|
- homeHeader.filterSortModel = FilterSortModel("")
|
|
|
|
- homeHeader.categoryModel = CategoryModel(recipeCount + foodCount, recipeCount, foodCount)
|
|
|
|
val foodContentList = mutableListOf<FoodContentModel>()
|
|
val foodContentList = mutableListOf<FoodContentModel>()
|
|
- result.add(homeHeader)
|
|
|
|
when (lastSearchCategoryType) {
|
|
when (lastSearchCategoryType) {
|
|
CategoryType.All -> {
|
|
CategoryType.All -> {
|
|
lastTotalLocalSearchRecipeList.forEach {
|
|
lastTotalLocalSearchRecipeList.forEach {
|
|
- result.add(
|
|
|
|
|
|
+ foodContentList.add(
|
|
FoodContentModel(
|
|
FoodContentModel(
|
|
it.photoPath ?: "",
|
|
it.photoPath ?: "",
|
|
it.name ?: "",
|
|
it.name ?: "",
|
|
@@ -406,7 +401,7 @@ class HomeViewModel : BaseViewModel() {
|
|
|
|
|
|
CategoryType.Recipes -> {
|
|
CategoryType.Recipes -> {
|
|
lastLocalRecipeList.forEach {
|
|
lastLocalRecipeList.forEach {
|
|
- result.add(
|
|
|
|
|
|
+ foodContentList.add(
|
|
FoodContentModel(
|
|
FoodContentModel(
|
|
it.photoPath ?: "",
|
|
it.photoPath ?: "",
|
|
it.name ?: "",
|
|
it.name ?: "",
|
|
@@ -421,7 +416,7 @@ class HomeViewModel : BaseViewModel() {
|
|
|
|
|
|
CategoryType.Ingredients -> {
|
|
CategoryType.Ingredients -> {
|
|
lastLocalSearchFoodList.forEach {
|
|
lastLocalSearchFoodList.forEach {
|
|
- result.add(
|
|
|
|
|
|
+ foodContentList.add(
|
|
FoodContentModel(
|
|
FoodContentModel(
|
|
it.photoPath ?: "",
|
|
it.photoPath ?: "",
|
|
it.name ?: "",
|
|
it.name ?: "",
|