forked from Pinaki93/Desipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataGen.kt
188 lines (175 loc) · 8.23 KB
/
DataGen.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/*
* MIT License
*
* Copyright (c) 2020 Pinaki Acharya
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package dev.pinaki.desipe.data.source
import dev.pinaki.desipe.data.model.Ingredient
import dev.pinaki.desipe.data.model.Recipe
import dev.pinaki.desipe.helper.moshi.DesipeMoshiHelper
private fun getIngredients(): List<Ingredient> {
return ArrayList<Ingredient>().apply {
add(Ingredient("Rice", 500, "gms"))
add(Ingredient("Oil", 4, "tsp"))
add(Ingredient("Cinnamon", 20, "gms"))
add(Ingredient("Cloves", 6, "pieces"))
add(Ingredient("Garlic", 4, "cloves"))
add(Ingredient("Onion", 5, "Medium Sized"))
add(Ingredient("Wheat Dough", 100, "grams"))
}
}
private fun getSteps(): List<String> {
return ArrayList<String>().apply {
add("At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum")
add("Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore")
add("At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum")
add("Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore")
add("At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum")
add("Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore")
add("At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum")
add("At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum")
add("Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore")
}
}
fun getSampleData(): List<Recipe> {
return ArrayList<Recipe>().apply {
add(
Recipe(
1,
"Desi Lamb Tikka Burger",
"A burger containing a juicy fat patty made of lamb served with tomatoes and lettue",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900066/food-1081707_640_ezrubj.jpg",
ArrayList<Ingredient>().apply {
add(Ingredient("Bun", 2, "Units"))
add(Ingredient("Lettuce", 4, "leaves"))
add(Ingredient("Onion", 1, "small bowl"))
add(Ingredient("Minced Meat", 250, "grams"))
add(Ingredient("Turmeric", 1, "tsp"))
add(Ingredient("Chilly Powder", 1, "tsp"))
},
ArrayList<String>().apply {
add("Mix the dry spices, chopped onions with minced meat")
add("Make patties from the mixture ")
add("Dry the patties until both sides are well cooked")
add("Cut tomatoes into circles")
add("Take a bun, put lettuce leaves on it")
add("Put two of the sliced tomatoes")
add("Put the patty on the top of the tomatoes, repeat two layers above it")
add("Put another bun on top")
add("Your Desi Lamb Tikka burger is now ready!")
}
)
)
add(
Recipe(
2,
"Chicken Dum Biriyani",
"A delicacy prepared in different parts of India with tender chicken pieces and aromatic long grain rice",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900068/biryani-1141444_640_przhfd.jpg",
ArrayList<Ingredient>().apply {
add(Ingredient("Rice", 500, "gms"))
add(Ingredient("Oil", 4, "tsp"))
add(Ingredient("Cinnamon", 20, "gms"))
add(Ingredient("Cloves", 6, "pieces"))
add(Ingredient("Garlic", 4, "cloves"))
add(Ingredient("Chicken", 250, "grams"))
add(Ingredient("Onion", 5, "Medium Sized"))
add(Ingredient("Wheat Dough", 100, "grams"))
},
ArrayList<String>().apply {
add("Fry the onions until they turn golden")
add("Add the dry spices mentioned in the ingredients")
add("Add chicken to the pan and fry for about 15 minutes")
add("Keep the preparation aside")
add("Boil the rice in a separate vessel for 30 minutes")
add("Now take the vessel away from flame")
add("Prepare layers of rice and chicken masala stacked on each other.Prepare layers of rice and chicken masala stacked on each other.Prepare layers of rice and chicken masala stacked on each other.Prepare layers of rice and chicken masala stacked on each other")
add("Now seal the vessel with dough and cook for 20 mins")
add("Your biriyani is now ready")
}
)
)
add(
Recipe(
3,
"Bhel",
"An evening snack popular all across India, knows by many different regional names",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900066/jhal-muri-827292_640_btx94u.jpg",
getIngredients(),
getSteps()
)
)
add(
Recipe(
4,
"Rasgulla",
"An east Indian delicacy with a controversial origin but that doesn't stop anyone from loving it!",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900066/sweets-577230_640_cekunj.jpg",
getIngredients(),
getSteps()
)
)
add(
Recipe(
5,
"Omlette",
"A quick to prepare meal for any time of the day, savoured all over the world",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900066/food-4046229_640_ub6i4e.jpg",
getIngredients(),
getSteps()
)
)
add(
Recipe(
6,
"Plain Dosa",
"Choice of drug for sober people all across India hailing from the South.",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900067/indian-1768906_640_j6olcu.jpg",
getIngredients(),
getSteps()
)
)
add(
Recipe(
7,
"Khaman",
"A savoury steamed dish from Gujarat that can make it's way to any meal you can ever have.",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900067/indian-1969797_640_qaibyr.jpg",
getIngredients(),
getSteps()
)
)
add(
Recipe(
8,
"Samosa",
"Crunchy on the outside, hot and soft on the inside. If Samosa is a question, yes is the answer",
"https://res.cloudinary.com/pinaki93/image/upload/v1593900067/food-143622_640_zlg7yv.jpg",
getIngredients(),
getSteps()
)
)
}
}
fun main() {
println(DesipeMoshiHelper.recipeListAdapter.toJson(getSampleData()))
}