From a6e8014a8c65acc8e8934c237e79d9cd6524442e Mon Sep 17 00:00:00 2001 From: zbbxzak Date: Sat, 17 Jun 2023 13:10:39 +0500 Subject: [PATCH] update the icons in the food page --- .../com/example/trackit/ui/food/FoodPage.kt | 8 +++--- .../res/drawable/breakfast_icon_green.xml | 27 +++++++++++++++++++ .../main/res/drawable/dinner_icon_green.xml | 13 +++++++++ .../main/res/drawable/lunch_icon_green.xml | 13 +++++++++ .../main/res/drawable/snack_icon_green.xml | 13 +++++++++ 5 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/breakfast_icon_green.xml create mode 100644 app/src/main/res/drawable/dinner_icon_green.xml create mode 100644 app/src/main/res/drawable/lunch_icon_green.xml create mode 100644 app/src/main/res/drawable/snack_icon_green.xml diff --git a/app/src/main/java/com/example/trackit/ui/food/FoodPage.kt b/app/src/main/java/com/example/trackit/ui/food/FoodPage.kt index 32a5dfa..7eaea8a 100644 --- a/app/src/main/java/com/example/trackit/ui/food/FoodPage.kt +++ b/app/src/main/java/com/example/trackit/ui/food/FoodPage.kt @@ -208,7 +208,7 @@ fun FoodPage( Spacer(modifier = Modifier.padding(20.dp)) MealPanel( mealType = "Завтрак", - mealIcon = R.drawable.breakfast_icon, + mealIcon = if (breakfastUiState.breakfastList.isNotEmpty()) R.drawable.breakfast_icon_green else R.drawable.breakfast_icon, foods = breakfastUiState.breakfastList, isExpanded = breakfastExpanded, onPanelClicked = { breakfastExpanded = !breakfastExpanded }, @@ -237,7 +237,7 @@ fun FoodPage( item { MealPanel( mealType = "Обед", - mealIcon = R.drawable.lunch_icon, + mealIcon = if (lunchUiState.lunchList.isNotEmpty()) R.drawable.lunch_icon_green else R.drawable.lunch_icon, foods = lunchUiState.lunchList, isExpanded = lunchExpanded, onPanelClicked = { lunchExpanded = !lunchExpanded }, @@ -266,7 +266,7 @@ fun FoodPage( item { MealPanel( mealType = "Ужин", - mealIcon = R.drawable.dinner_icon, + mealIcon = if (dinnerUiState.dinnerList.isNotEmpty()) R.drawable.dinner_icon_green else R.drawable.dinner_icon, foods = dinnerUiState.dinnerList, isExpanded = dinnerExpanded, onPanelClicked = { dinnerExpanded = !dinnerExpanded }, @@ -295,7 +295,7 @@ fun FoodPage( item { MealPanel( mealType = "Перекус", - mealIcon = R.drawable.snack_icon, + mealIcon = if (snackUiState.snackList.isNotEmpty()) R.drawable.snack_icon_green else R.drawable.snack_icon, foods = snackUiState.snackList, isExpanded = snackExpanded, onPanelClicked = { snackExpanded = !snackExpanded }, diff --git a/app/src/main/res/drawable/breakfast_icon_green.xml b/app/src/main/res/drawable/breakfast_icon_green.xml new file mode 100644 index 0000000..5758a20 --- /dev/null +++ b/app/src/main/res/drawable/breakfast_icon_green.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/dinner_icon_green.xml b/app/src/main/res/drawable/dinner_icon_green.xml new file mode 100644 index 0000000..014523f --- /dev/null +++ b/app/src/main/res/drawable/dinner_icon_green.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/lunch_icon_green.xml b/app/src/main/res/drawable/lunch_icon_green.xml new file mode 100644 index 0000000..10b40ff --- /dev/null +++ b/app/src/main/res/drawable/lunch_icon_green.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/snack_icon_green.xml b/app/src/main/res/drawable/snack_icon_green.xml new file mode 100644 index 0000000..95c2312 --- /dev/null +++ b/app/src/main/res/drawable/snack_icon_green.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file