-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f91c58
commit d6f2c6a
Showing
21 changed files
with
172 additions
and
154 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/AnalyzedInstruction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class AnalyzedInstruction( | ||
@SerializedName("name" ) var name : String? = null, | ||
@SerializedName("steps") var steps : ArrayList<Step> = arrayListOf() | ||
) | ||
val name: String, | ||
val steps: List<Step> | ||
) |
13 changes: 6 additions & 7 deletions
13
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Equipment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Equipment( | ||
@SerializedName("id" ) val id : Int, | ||
@SerializedName("name" ) val name : String, | ||
@SerializedName("localizedName") val localizedName : String, | ||
@SerializedName("image" ) val image : String | ||
) | ||
val id: Int, | ||
val image: String, | ||
val localizedName: String, | ||
val name: String, | ||
val temperature: Temperature | ||
) |
28 changes: 13 additions & 15 deletions
28
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/ExtendedIngredient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ExtendedIngredient( | ||
@SerializedName("id" ) var id : Int? = null, | ||
@SerializedName("aisle" ) var aisle : String? = null, | ||
@SerializedName("image" ) var image : String? = null, | ||
@SerializedName("consistency" ) var consistency : String? = null, | ||
@SerializedName("name" ) var name : String? = null, | ||
@SerializedName("nameClean" ) var nameClean : String? = null, | ||
@SerializedName("original" ) var original : String? = null, | ||
@SerializedName("originalName") var originalName : Int? = null, | ||
@SerializedName("amount" ) var amount : Double? = null, | ||
@SerializedName("unit" ) var unit : String? = null, | ||
@SerializedName("meta" ) var meta : ArrayList<String>? = null, | ||
@SerializedName("measures" ) var measures : Measures? = null | ||
) | ||
val aisle: String, | ||
val amount: Double, | ||
val consistency: String, | ||
val id: Int, | ||
val image: String, | ||
val measures: Measures, | ||
val meta: List<String>, | ||
val name: String, | ||
val nameClean: String, | ||
val original: String, | ||
val originalName: String, | ||
val unit: String | ||
) |
12 changes: 5 additions & 7 deletions
12
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Ingredient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Ingredient( | ||
@SerializedName("id" ) var id : Int? = null, | ||
@SerializedName("name" ) var name : String? = null, | ||
@SerializedName("localizedName") var localizedName : String? = null, | ||
@SerializedName("image" ) var image : String? = null, | ||
) | ||
val id: Int, | ||
val image: String, | ||
val localizedName: String, | ||
val name: String | ||
) |
8 changes: 3 additions & 5 deletions
8
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Length.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Length( | ||
@SerializedName("number") val number: Int, | ||
@SerializedName("unit" ) val unit : String | ||
) | ||
val number: Int, | ||
val unit: String | ||
) |
9 changes: 0 additions & 9 deletions
9
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Measure.kt
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Measures.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Measures( | ||
@SerializedName("us" ) var us : Us, | ||
@SerializedName("metric") var metric : Measure | ||
) | ||
val metric: Metric, | ||
val us: Us | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Metric.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
data class Metric( | ||
val amount: Double, | ||
val unitLong: String, | ||
val unitShort: String | ||
) |
6 changes: 2 additions & 4 deletions
6
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/RandomRecipeResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class RandomRecipeResponse( | ||
@SerializedName("recipes") var recipes: ArrayList<Recipe> = arrayListOf() | ||
) | ||
val recipes: List<Recipe> | ||
) |
76 changes: 37 additions & 39 deletions
76
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Recipe.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,41 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Recipe( | ||
@SerializedName("vegetarian" ) var vegetarian : Boolean? = null, | ||
@SerializedName("vegan" ) var vegan : Boolean? = null, | ||
@SerializedName("glutenFree" ) var glutenFree : Boolean? = null, | ||
@SerializedName("dairyFree" ) var dairyFree : Boolean? = null, | ||
@SerializedName("veryHealthy" ) var veryHealthy : Boolean? = null, | ||
@SerializedName("cheap" ) var cheap : Boolean? = null, | ||
@SerializedName("veryPopular" ) var veryPopular : Boolean? = null, | ||
@SerializedName("sustainable" ) var sustainable : Boolean? = null, | ||
@SerializedName("lowFodmap" ) var lowFodmap : Boolean? = null, | ||
@SerializedName("weightWatcherSmartPoints" ) var weightWatcherSmartPoints : Int? = null, | ||
@SerializedName("gaps" ) var gaps : String? = null, | ||
@SerializedName("preparationMinutes" ) var preparationMinutes : Int? = null, | ||
@SerializedName("cookingMinutes" ) var cookingMinutes : Int? = null, | ||
@SerializedName("aggregateLikes" ) var aggregateLikes : Int? = null, | ||
@SerializedName("healthScore" ) var healthScore : Int? = null, | ||
@SerializedName("creditsText" ) var creditsText : String? = null, | ||
@SerializedName("sourceName" ) var sourceName : String? = null, | ||
@SerializedName("pricePerServing" ) var pricePerServing : Double? = null, | ||
@SerializedName("extendedIngredients" ) var extendedIngredients : ArrayList<ExtendedIngredient> = arrayListOf(), | ||
@SerializedName("id" ) var id : Int? = null, | ||
@SerializedName("title" ) var title : String? = null, | ||
@SerializedName("readyInMinutes" ) var readyInMinutes : Int? = null, | ||
@SerializedName("servings" ) var servings : Int? = null, | ||
@SerializedName("sourceUrl" ) var sourceUrl : String? = null, | ||
@SerializedName("image" ) var image : String? = null, | ||
@SerializedName("imageType" ) var imageType : String? = null, | ||
@SerializedName("summary" ) var summary : String? = null, | ||
@SerializedName("cuisines" ) var cuisines : ArrayList<String> = arrayListOf(), | ||
@SerializedName("dishTypes" ) var dishTypes : ArrayList<String> = arrayListOf(), | ||
@SerializedName("diets" ) var diets : ArrayList<String> = arrayListOf(), | ||
@SerializedName("occasions" ) var occasions : ArrayList<String> = arrayListOf(), | ||
@SerializedName("instructions" ) var instructions : String? = null, | ||
@SerializedName("analyzedInstructions" ) var analyzedInstructions : ArrayList<AnalyzedInstruction> = arrayListOf(), | ||
@SerializedName("originalId" ) var originalId : String? = null, | ||
@SerializedName("spoonacularScore" ) var spoonacularScore : Double? = null, | ||
@SerializedName("spoonacularSourceUrl" ) var spoonacularSourceUrl : String? = null | ||
|
||
val aggregateLikes: Int, | ||
val analyzedInstructions: List<AnalyzedInstruction>, | ||
val cheap: Boolean, | ||
val cookingMinutes: Int, | ||
val creditsText: String, | ||
val cuisines: List<String>, | ||
val dairyFree: Boolean, | ||
val diets: List<String>, | ||
val dishTypes: List<String>, | ||
val extendedIngredients: List<ExtendedIngredient>, | ||
val gaps: String, | ||
val glutenFree: Boolean, | ||
val healthScore: Int, | ||
val id: Int, | ||
val image: String, | ||
val imageType: String, | ||
val instructions: String, | ||
val license: String, | ||
val lowFodmap: Boolean, | ||
val occasions: List<Any>, | ||
val originalId: Any, | ||
val preparationMinutes: Int, | ||
val pricePerServing: Double, | ||
val readyInMinutes: Int, | ||
val servings: Int, | ||
val sourceName: String, | ||
val sourceUrl: String, | ||
val spoonacularScore: Double, | ||
val spoonacularSourceUrl: String, | ||
val summary: String, | ||
val sustainable: Boolean, | ||
val title: String, | ||
val vegan: Boolean, | ||
val vegetarian: Boolean, | ||
val veryHealthy: Boolean, | ||
val veryPopular: Boolean, | ||
val weightWatcherSmartPoints: Int | ||
) |
14 changes: 6 additions & 8 deletions
14
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Step.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Step( | ||
@SerializedName("number" ) var number : Int? = null, | ||
@SerializedName("step" ) var step : String? = null, | ||
@SerializedName("ingredients") var ingredients : ArrayList<String>? = arrayListOf(), | ||
@SerializedName("equipment" ) var equipment : ArrayList<Ingredient>? = arrayListOf(), | ||
@SerializedName("length" ) var length : Length? | ||
) | ||
val equipment: List<Equipment>, | ||
val ingredients: List<Ingredient>, | ||
val length: Length, | ||
val number: Int, | ||
val step: String | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Temperature.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
data class Temperature( | ||
val number: Double, | ||
val unit: String | ||
) |
10 changes: 4 additions & 6 deletions
10
app/src/main/java/com/example/cookbook/data/models/randomrecipemodel/Us.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
package com.example.cookbook.data.models.randomrecipemodel | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Us( | ||
@SerializedName("amount" ) var amount : Double? = null, | ||
@SerializedName("unitShort") var unitShort : String? = null, | ||
@SerializedName("unitLong" ) var unitLong : String? = null | ||
) | ||
val amount: Double, | ||
val unitLong: String, | ||
val unitShort: String | ||
) |
3 changes: 1 addition & 2 deletions
3
app/src/main/java/com/example/cookbook/data/reposiitory/RandomRecipeRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package com.example.cookbook.data.reposiitory | ||
|
||
import com.example.cookbook.data.models.randomrecipemodel.RandomRecipeResponse | ||
import retrofit2.Callback | ||
|
||
interface RandomRecipeRepository { | ||
suspend fun getRandomRecipe(apiKey: String, number: Int) : Result<RandomRecipeResponse> | ||
suspend fun getRandomRecipe(apiKey: String) : Result<RandomRecipeResponse> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.