diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f3207a6..0efa4cd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -50,4 +50,6 @@ dependencies { implementation(libs.androidx.constraintlayout) testImplementation(libs.junit) testImplementation(libs.kotlin.coroutines.test) + implementation (libs.glide) + annotationProcessor (libs.compiler) } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 063f4d1..1d21545 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ + (RecipeDiffutils()) { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { + + return when (viewType) { + ViewType.CATEGORY.id -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.vh_recipe_category, parent, false) + CategoryViewHolder(view) + } + + ViewType.RECIPE.id -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.vh_recipe_item, parent, false) + RecipeViewHolder(view) + } + + else -> throw IllegalArgumentException("wrong type of view") + } + } + + override fun getItemViewType(position: Int): Int { + return when (currentList[position]) { + is RecipeListItem.CategoryItem -> ViewType.CATEGORY.id + is RecipeListItem.RecipeItem -> ViewType.RECIPE.id + else -> -1 + } + } + + override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + + when (val item = currentList.getOrNull(position)) { + is RecipeListItem.CategoryItem -> { + (holder as CategoryViewHolder).bind(item) + } + + is RecipeListItem.RecipeItem -> { + (holder as RecipeViewHolder).bind(item) + } + + else -> + throw IllegalArgumentException("wrong type of holder") + } + } + + fun changeRecipeItems(newChatList: List) { + this.submitList(newChatList) + currentList + println() + } + + enum class ViewType(val id: Int) { + CATEGORY(0), + RECIPE(1) + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeDiffutils.kt b/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeDiffutils.kt new file mode 100644 index 0000000..25e2a78 --- /dev/null +++ b/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeDiffutils.kt @@ -0,0 +1,15 @@ +package ru.otus.cookbook.cook_recycler_view + +import androidx.recyclerview.widget.DiffUtil +import ru.otus.cookbook.data.RecipeListItem + +class RecipeDiffutils : DiffUtil.ItemCallback() { + + override fun areItemsTheSame(oldItem: RecipeListItem, newItem: RecipeListItem): Boolean { + return oldItem== newItem + } + + override fun areContentsTheSame(oldItem: RecipeListItem, newItem: RecipeListItem): Boolean { + return oldItem == newItem + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeViewHolder.kt b/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeViewHolder.kt new file mode 100644 index 0000000..9fd3c48 --- /dev/null +++ b/app/src/main/kotlin/ru/otus/cookbook/cook_recycler_view/RecipeViewHolder.kt @@ -0,0 +1,30 @@ +package ru.otus.cookbook.cook_recycler_view + +import android.view.View +import android.widget.ImageView +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import com.bumptech.glide.Glide +import ru.otus.cookbook.helpers.NavigateHelper + +import ru.otus.cookbook.R +import ru.otus.cookbook.data.RecipeListItem + +class RecipeViewHolder(private val recipeView: View) : RecyclerView.ViewHolder(recipeView) { + + private val title: TextView by lazy { recipeView.findViewById(R.id.titleRecipe) } + private val description: TextView by lazy { recipeView.findViewById(R.id.titleDescription) } + private val imageRecipe: ImageView by lazy { recipeView.findViewById(R.id.imageRecipe) } + + + fun bind(recipeData: RecipeListItem.RecipeItem) { + recipeView.setOnClickListener { NavigateHelper.showMoreAboutRecipe(recipeData.id) } + + title.text = recipeData.title + description.text = recipeData.description + + Glide.with(recipeView.context) + .load(recipeData.imageUrl) + .into(imageRecipe) + } +} diff --git a/app/src/main/kotlin/ru/otus/cookbook/data/Recipe.kt b/app/src/main/kotlin/ru/otus/cookbook/data/Recipe.kt index 33a05a8..3be9a62 100644 --- a/app/src/main/kotlin/ru/otus/cookbook/data/Recipe.kt +++ b/app/src/main/kotlin/ru/otus/cookbook/data/Recipe.kt @@ -21,7 +21,7 @@ val cookbook = listOf( title = "Pasta Carbonara", description = "Pasta Carbonara is a classic pasta dish from Rome with eggs, cheese and bacon.", category = RecipeCategory("Pasta"), - imageUrl = "https://en.wikipedia.org/wiki/Carbonara#/media/File:Espaguetis_carbonara.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Espaguetis_carbonara.jpg/1920px-Espaguetis_carbonara.jpg", steps = listOf( "Cook the pasta in a large pot of boiling salted water until al dente.", "Meanwhile, whisk the eggs and Parmesan together in a bowl.", @@ -40,7 +40,7 @@ val cookbook = listOf( title = "Fettuccine_Alfredo", description = "Fettuccine Alfredo is a classic pasta dish from Rome with butter, cream and Parmesan.", category = RecipeCategory("Pasta"), - imageUrl = "https://en.wikipedia.org/wiki/Fettuccine_Alfredo#/media/File:The_Only_Original_Alfredo_Sauce_with_Butter_and_Parmesano-Reggiano_Cheese.png", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/d/dc/The_Only_Original_Alfredo_Sauce_with_Butter_and_Parmesano-Reggiano_Cheese.png", steps = listOf( "Cook the fettuccine in a large pot of boiling salted water until al dente.", "Meanwhile, melt the butter in a large pan over medium heat.", @@ -57,7 +57,7 @@ val cookbook = listOf( title = "Cod in breadcrumbs", description = "Cod in breadcrumbs is a simple and delicious fish dish that is perfect for a quick and easy dinner.", category = RecipeCategory("Fish"), - imageUrl = "https://en.wikipedia.org/wiki/Fish_finger#/media/File:Fishfinger_classic_fried_2.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Fishfinger_classic_fried_2.jpg/1920px-Fishfinger_classic_fried_2.jpg", steps = listOf( "Preheat the oven to 200C/180C Fan/Gas 6.", "Place the cod fillets on a baking tray.", @@ -72,7 +72,7 @@ val cookbook = listOf( title = "Beef Stroganoff", description = "Beef Stroganoff is a classic Russian dish made with beef, mushrooms and sour cream.", category = RecipeCategory("Beef"), - imageUrl = "https://en.wikipedia.org/wiki/Beef_Stroganoff#/media/File:Moscow_(8351271825).jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Moscow_%288351271825%29.jpg/1920px-Moscow_%288351271825%29.jpg", steps = listOf( "Heat the oil in a large pan over medium heat.", "Add the beef and cook until browned.", @@ -89,7 +89,7 @@ val cookbook = listOf( title = "Chicken Tikka Masala", description = "Chicken Tikka Masala is a classic Indian dish made with marinated chicken cooked in a spicy tomato sauce.", category = RecipeCategory("Chicken"), - imageUrl = "https://en.wikipedia.org/wiki/Chicken_tikka_masala#/media/File:Chicken_tikka_masala.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Chicken_tikka_masala.jpg/800px-Chicken_tikka_masala.jpg", steps = listOf( "Marinate the chicken in the yogurt, lemon juice, garlic, ginger, garam masala, turmeric, cumin, coriander, paprika, salt and pepper for at least 1 hour.", "Heat the oil in a large pan over medium heat.", @@ -106,7 +106,7 @@ val cookbook = listOf( title = "Solyanka", description = "Solyanka is a traditional Russian soup made with meat, pickles, olives and capers.", category = RecipeCategory("Soup"), - imageUrl = "https://en.wikipedia.org/wiki/Solyanka#/media/File:Soljanka_food_05.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Soljanka_food_05.jpg/1280px-Soljanka_food_05.jpg", steps = listOf( "Heat the oil in a large pan over medium heat.", "Add the onion, garlic, carrots and celery and cook until softened.", @@ -122,7 +122,7 @@ val cookbook = listOf( title = "Surströmming", description = "Surströmming is a traditional Swedish dish made with fermented herring.", category = RecipeCategory("Fish"), - imageUrl = "https://en.wikipedia.org/wiki/Surstr%C3%B6mming#/media/File:Surstr%C3%B6mming.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Surströmming.jpg/1280px-Surströmming.jpg", steps = listOf( "Open the can of surströmming outdoors, as the smell is very strong", "Remove the herring from the can and rinse it under cold water", @@ -135,7 +135,7 @@ val cookbook = listOf( title = "Sichuang Hotpot", description = "Sichuang Hotpot is a traditional Chinese dish made with spicy broth, meat, vegetables and noodles.", category = RecipeCategory("Chinese"), - imageUrl = "https://en.wikipedia.org/wiki/Chongqing_hot_pot#/media/File:Chongqing_hotpot_2.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Chongqing_hotpot_2.jpg/1280px-Chongqing_hotpot_2.jpg", steps = listOf( "Prepare the broth by boiling water with Sichuang peppercorns, dried chilies, ginger, garlic, star anise, cinnamon and bay leaves", "Add the meat, vegetables and noodles to the broth and cook until tender", @@ -147,7 +147,7 @@ val cookbook = listOf( title = "Tiramisu", description = "Tiramisu is a classic Italian dessert made with coffee, mascarpone cheese, eggs, sugar and ladyfingers.", category = RecipeCategory("Dessert"), - imageUrl = "https://en.wikipedia.org/wiki/Tiramisu#/media/File:Tiramisu_-_Raffaele_Diomede.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Tiramisu_-_Raffaele_Diomede.jpg/1280px-Tiramisu_-_Raffaele_Diomede.jpg", steps = listOf( "Brew the coffee and let it cool", "Whisk the egg yolks and sugar together until pale and creamy", @@ -165,7 +165,7 @@ val cookbook = listOf( title = "Borscht", description = "Borscht is a traditional Russian soup made with beets, cabbage, potatoes and beef.", category = RecipeCategory("Soup"), - imageUrl = "https://en.wikipedia.org/wiki/Borscht#/media/File:Borscht_served.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Borscht_served.jpg/1920px-Borscht_served.jpg", steps = listOf( "Heat the oil in a large pan over medium heat.", "Add the onion, garlic, carrots and celery and cook until softened.", @@ -181,7 +181,7 @@ val cookbook = listOf( title = "Peking Duck", description = "Peking Duck is a traditional Chinese dish made with roasted duck, pancakes, hoisin sauce and cucumber.", category = RecipeCategory("Chinese"), - imageUrl = "https://en.wikipedia.org/wiki/Peking_duck#/media/File:Peking_Duck,_2014_(02).jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Peking_Duck%2C_2014_%2802%29.jpg/1280px-Peking_Duck%2C_2014_%2802%29.jpg", steps = listOf( "Prepare the duck by removing the giblets and excess fat", "Rub the duck with a mixture of honey, soy sauce, five-spice powder and salt", @@ -195,7 +195,7 @@ val cookbook = listOf( title = "Sushi", description = "Sushi is a traditional Japanese dish made with vinegared rice, fish, vegetables and seaweed.", category = RecipeCategory("Japanese"), - imageUrl = "https://en.wikipedia.org/wiki/Sushi#/media/File:Sushi_platter.jpg", + imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Sushi_platter.jpg/1024px-Sushi_platter.jpg", steps = listOf( "Cook the rice and season with rice vinegar, sugar and salt", "Prepare the fish and vegetables by slicing them into thin strips", diff --git a/app/src/main/kotlin/ru/otus/cookbook/data/RecipeListItem.kt b/app/src/main/kotlin/ru/otus/cookbook/data/RecipeListItem.kt index ba9bbe1..8a2ba4c 100644 --- a/app/src/main/kotlin/ru/otus/cookbook/data/RecipeListItem.kt +++ b/app/src/main/kotlin/ru/otus/cookbook/data/RecipeListItem.kt @@ -28,7 +28,7 @@ sealed class RecipeListItem : WithLayoutId { data class CategoryItem(val category: RecipeCategory) : RecipeListItem(), WithLayoutId by CategoryItem { companion object : WithLayoutId { @get:LayoutRes - override val layoutId: Int = R.layout.vh_recipe_category + override val layoutId: Int = R.layout.vh_recipe_item } val name: String get() = category.name diff --git a/app/src/main/kotlin/ru/otus/cookbook/helpers/NavigateHelper.kt b/app/src/main/kotlin/ru/otus/cookbook/helpers/NavigateHelper.kt new file mode 100644 index 0000000..c22875a --- /dev/null +++ b/app/src/main/kotlin/ru/otus/cookbook/helpers/NavigateHelper.kt @@ -0,0 +1,39 @@ +package ru.otus.cookbook.helpers + +import android.annotation.SuppressLint +import androidx.navigation.NavController +import ru.otus.cookbook.ui.CookbookFragmentDirections +import ru.otus.cookbook.ui.RecipeFragment +import ru.otus.cookbook.ui.RecipeFragmentDirections +import ru.otus.cookbook.R + +object NavigateHelper { + + @SuppressLint("StaticFieldLeak") + private var _navController: NavController? = null + private var _recipeFragment: RecipeFragment? = null + + fun setNavController(navController: NavController) { + _navController = navController + } + + fun showMoreAboutRecipe(id: Int) { + val action = + CookbookFragmentDirections.actionCookbookFragmentToRecipeFragment(recipeId = id) + _navController?.navigate(action) + } + + fun showAlertDialogOnRecipeFragment(recipeName: String, recipeFragment: RecipeFragment) { + _recipeFragment = recipeFragment + val action = + RecipeFragmentDirections.actionRecipeFragmentToAlertDialogDialogFragment(recipeName) + _navController?.navigate(action) + } + + fun onDelete() { + _recipeFragment?.onAlertDialogDelete() + _navController?.popBackStack(R.id.cookbookFragment, false) + _recipeFragment = null + } +} + diff --git a/app/src/main/kotlin/ru/otus/cookbook/ui/AlertDialogFragment.kt b/app/src/main/kotlin/ru/otus/cookbook/ui/AlertDialogFragment.kt new file mode 100644 index 0000000..b014310 --- /dev/null +++ b/app/src/main/kotlin/ru/otus/cookbook/ui/AlertDialogFragment.kt @@ -0,0 +1,32 @@ +package ru.otus.cookbook.ui + +import ru.otus.cookbook.R +import android.app.Dialog +import android.os.Bundle +import androidx.fragment.app.DialogFragment +import androidx.navigation.fragment.navArgs +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import ru.otus.cookbook.helpers.NavigateHelper + + +class AlertDialogFragment : DialogFragment() { + private val args: AlertDialogFragmentArgs by navArgs() + private val recipeName: String get() = args.recipeName + + override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { + + val builder = activity?.let { MaterialAlertDialogBuilder(it) } + + builder?.apply { + setTitle("Delete") + setMessage("Are you sure you want to delete $recipeName ?") + setNegativeButton("Cancel") { _, _ -> + return@setNegativeButton + } + setPositiveButton("OK") { _, _ -> + NavigateHelper.onDelete() + } + } + return builder?.create()!! + } +} \ No newline at end of file diff --git a/app/src/main/kotlin/ru/otus/cookbook/ui/CookbookFragment.kt b/app/src/main/kotlin/ru/otus/cookbook/ui/CookbookFragment.kt index efe6939..4d48ef6 100644 --- a/app/src/main/kotlin/ru/otus/cookbook/ui/CookbookFragment.kt +++ b/app/src/main/kotlin/ru/otus/cookbook/ui/CookbookFragment.kt @@ -4,11 +4,17 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope +import androidx.navigation.fragment.findNavController +import androidx.recyclerview.widget.DividerItemDecoration import kotlinx.coroutines.launch +import ru.otus.cookbook.R +import ru.otus.cookbook.cook_recycler_view.RecipeAdapter +import ru.otus.cookbook.helpers.NavigateHelper import ru.otus.cookbook.data.RecipeListItem import ru.otus.cookbook.databinding.FragmentCookbookBinding @@ -16,6 +22,7 @@ class CookbookFragment : Fragment() { private val binding = FragmentBindingDelegate(this) private val model: CookbookFragmentViewModel by viewModels { CookbookFragmentViewModel.Factory } + private val recipeAdapter by lazy { RecipeAdapter() } override fun onCreateView( inflater: LayoutInflater, @@ -37,10 +44,19 @@ class CookbookFragment : Fragment() { } private fun setupRecyclerView() = binding.withBinding { - // Setup RecyclerView + + val navController = findNavController() + NavigateHelper.setNavController(navController) + + cardRecipesRcView.adapter = recipeAdapter + + val divider = DividerItemDecoration(this@CookbookFragment.context,DividerItemDecoration.VERTICAL) + divider.setDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.divider_rv)!!) + + cardRecipesRcView.addItemDecoration(divider) } private fun onRecipeListUpdated(recipeList: List) { - // Handle recipe list + recipeAdapter.changeRecipeItems(recipeList) } } \ No newline at end of file diff --git a/app/src/main/kotlin/ru/otus/cookbook/ui/RecipeFragment.kt b/app/src/main/kotlin/ru/otus/cookbook/ui/RecipeFragment.kt index e4460c1..8072b8a 100644 --- a/app/src/main/kotlin/ru/otus/cookbook/ui/RecipeFragment.kt +++ b/app/src/main/kotlin/ru/otus/cookbook/ui/RecipeFragment.kt @@ -4,18 +4,26 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewmodel.MutableCreationExtras +import androidx.navigation.fragment.navArgs +import com.bumptech.glide.Glide +import com.google.android.material.appbar.MaterialToolbar import kotlinx.coroutines.launch +import ru.otus.cookbook.R import ru.otus.cookbook.data.Recipe import ru.otus.cookbook.databinding.FragmentRecipeBinding +import ru.otus.cookbook.helpers.NavigateHelper class RecipeFragment : Fragment() { - private val recipeId: Int get() = TODO("Use Safe Args to get the recipe ID: https://developer.android.com/guide/navigation/use-graph/pass-data#Safe-args") + private val args: RecipeFragmentArgs by navArgs() + private val recipeId: Int get() = args.recipeId private val binding = FragmentBindingDelegate(this) private val model: RecipeFragmentViewModel by viewModels( @@ -37,12 +45,19 @@ class RecipeFragment : Fragment() { ) override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) viewLifecycleOwner.lifecycleScope.launch { model.recipe .flowWithLifecycle(viewLifecycleOwner.lifecycle) .collect(::displayRecipe) } + + val materialToolbar = view.findViewById(R.id.titleToolbar) + materialToolbar.setOnMenuItemClickListener { + NavigateHelper.showAlertDialogOnRecipeFragment(getTitle(), this) + true + } } /** @@ -53,7 +68,24 @@ class RecipeFragment : Fragment() { } private fun displayRecipe(recipe: Recipe) { - // Display the recipe + view?.let { + val imageRecipe = it.findViewById(R.id.imageRecipeOnAbout) + Glide.with(this) + .load(recipe.imageUrl) + .into(imageRecipe) + + it.findViewById(R.id.nameRecipe).text = recipe.title + it.findViewById(R.id.typeRecipe).text = recipe.category.name + it.findViewById(R.id.descriptionRecipe).text = recipe.description + + Glide.with(this) + .load(recipe.imageUrl) + .into(imageRecipe) + } + } + + fun onAlertDialogDelete() { + deleteRecipe() } private fun deleteRecipe() { diff --git a/app/src/main/res/drawable-nodpi/border_card.xml b/app/src/main/res/drawable-nodpi/border_card.xml new file mode 100644 index 0000000..7d85c96 --- /dev/null +++ b/app/src/main/res/drawable-nodpi/border_card.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-nodpi/media.png b/app/src/main/res/drawable-nodpi/media.png new file mode 100644 index 0000000..a57e193 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/media.png differ diff --git a/app/src/main/res/drawable-nodpi/round_shape.xml b/app/src/main/res/drawable-nodpi/round_shape.xml new file mode 100644 index 0000000..ae01249 --- /dev/null +++ b/app/src/main/res/drawable-nodpi/round_shape.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/baseline_arrow_back_24.xml b/app/src/main/res/drawable/baseline_arrow_back_24.xml new file mode 100644 index 0000000..075e95d --- /dev/null +++ b/app/src/main/res/drawable/baseline_arrow_back_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/baseline_close_24.xml b/app/src/main/res/drawable/baseline_close_24.xml new file mode 100644 index 0000000..f8ca0c6 --- /dev/null +++ b/app/src/main/res/drawable/baseline_close_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/delete.xml b/app/src/main/res/drawable/delete.xml new file mode 100644 index 0000000..2bab095 --- /dev/null +++ b/app/src/main/res/drawable/delete.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/divider_rv.xml b/app/src/main/res/drawable/divider_rv.xml new file mode 100644 index 0000000..03cf7d5 --- /dev/null +++ b/app/src/main/res/drawable/divider_rv.xml @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 86a5d97..a4a9938 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -7,13 +7,12 @@ android:layout_height="match_parent" tools:context=".MainActivity"> - + \ No newline at end of file diff --git a/app/src/main/res/layout/category_recipe.xml b/app/src/main/res/layout/category_recipe.xml new file mode 100644 index 0000000..0427c29 --- /dev/null +++ b/app/src/main/res/layout/category_recipe.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_cookbook.xml b/app/src/main/res/layout/fragment_cookbook.xml index 77d9ef6..b9a9f74 100644 --- a/app/src/main/res/layout/fragment_cookbook.xml +++ b/app/src/main/res/layout/fragment_cookbook.xml @@ -1,6 +1,35 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_recipe.xml b/app/src/main/res/layout/fragment_recipe.xml index 77d9ef6..36d3400 100644 --- a/app/src/main/res/layout/fragment_recipe.xml +++ b/app/src/main/res/layout/fragment_recipe.xml @@ -1,6 +1,77 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/vh_recipe_category.xml b/app/src/main/res/layout/vh_recipe_category.xml index 006fd49..219ccf0 100644 --- a/app/src/main/res/layout/vh_recipe_category.xml +++ b/app/src/main/res/layout/vh_recipe_category.xml @@ -1,6 +1,15 @@ - + - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/main/res/layout/vh_recipe_item.xml b/app/src/main/res/layout/vh_recipe_item.xml index 006fd49..621978b 100644 --- a/app/src/main/res/layout/vh_recipe_item.xml +++ b/app/src/main/res/layout/vh_recipe_item.xml @@ -1,6 +1,74 @@ - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml new file mode 100644 index 0000000..ae891e1 --- /dev/null +++ b/app/src/main/res/menu/main_menu.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/main_graph.xml b/app/src/main/res/navigation/main_graph.xml new file mode 100644 index 0000000..ee488be --- /dev/null +++ b/app/src/main/res/navigation/main_graph.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c8524cd..c22dc8c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -2,4 +2,6 @@ #FF000000 #FFFFFFFF + #00FFFFFF + #525252 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8fce1d1..0b6b10e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,14 @@ Cookbook + media + description + Title + C + Fish + Roasted in breadcrumbs + Lorem ipsum Quisque blandit dolor vel ullamcorper fringilla. Etiam ut ultricies nibh. Maecenas sit amet ipsum at felis convallis luctus. Praesent at urna ac massa eleifend iaculis. Donec at venenatis metus. Donec malesuada sapien eget neque finibus, vel aliquam mi lacinia. Mauris a sem elementum, pretium diam nec, luctus neque. Praesent lacinia imperdiet erat, eget feugiat mi feugiat ut. Proin iaculis, massa eu lacinia tempor, dui lacus pellentesque dui, ut dapibus tellus purus at augue. Nam sagittis lobortis justo vel porta. Proin vel vulputate quam. Vivamus at vestibulum est. Phasellus a arcu lacus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nullam elit mauris, pharetra vitae libero sit amet, efficitur rhoncus mauris. + Cod + delete + + Hello blank fragment \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 515d8d1..e121150 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] -agp = "8.7.3" +agp = "8.8.0" +glide = "4.11.0" kotlin = "2.1.0" coreKtx = "1.15.0" fragmentKtx = "1.8.5" @@ -18,6 +19,8 @@ datastore = "1.1.1" [libraries] +compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" } +glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } kotlin-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c4701d6..aac126a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Nov 30 19:52:55 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists