Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 0347f5a

Browse files
committed
Release 1.0.0
1 parent 42da2a4 commit 0347f5a

File tree

1 file changed

+75
-5
lines changed

1 file changed

+75
-5
lines changed

README.md

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# consumable-code-meal-api By AmirIsBack
22
- v1.0.0 - Development
3-
- Release Soon
3+
- Stable Version
44

55
# About This Project
66
Eliminates the method of retrieving json data using retrofit repeatedly. so this project has a set of functions to retrieve data without the need for fetching data using the retrofit of the API
@@ -19,6 +19,43 @@ https://www.themealdb.com/api.php
1919

2020
# Function Main From This Project
2121

22+
// Switch For Using Chuck Interceptor
23+
fun usingChuckInterceptor(context: Context)
24+
25+
// Search meal by name
26+
fun searchMeal(mealName: String, callback: MealResultCallback<MealResponse<Meal>>)
27+
28+
// List all meals by first letter
29+
fun listAllMeal(firstLetter: String, callback: MealResultCallback<MealResponse<Meal>>)
30+
31+
// Lookup full meal details by id
32+
fun lookupFullMeal(idMeal: String, callback: MealResultCallback<MealResponse<Meal>>)
33+
34+
// Lookup a single random meal
35+
fun lookupRandomMeal(callback: MealResultCallback<MealResponse<Meal>>)
36+
37+
// List all meal categories
38+
fun listMealCategories(callback: MealResultCallback<CategoryResponse>)
39+
40+
// List all Categories
41+
fun listAllCateories(callback: MealResultCallback<MealResponse<Category>>)
42+
43+
// List all Area
44+
fun listAllArea(callback: MealResultCallback<MealResponse<Area>>)
45+
46+
// List all Ingredients
47+
fun listAllIngredients(callback: MealResultCallback<MealResponse<Ingredient>>)
48+
49+
// Filter by main ingredient
50+
fun filterByIngredient(ingredient: String, callback: MealResultCallback<MealResponse<MealFilter>>)
51+
52+
// Filter by Category
53+
fun filterByCategory(category: String, callback: MealResultCallback<MealResponse<MealFilter>>)
54+
55+
// Filter by Area
56+
fun filterByArea(area: String, callback: MealResultCallback<MealResponse<MealFilter>>)
57+
58+
2259
# Android Library Version (build.gradle)
2360
- ext.kotlin_version = '1.3.70'
2461
- classpath 'com.android.tools.build:gradle:3.6.1'
@@ -29,15 +66,48 @@ https://www.themealdb.com/api.php
2966
# Version Release
3067
This Is Latest Release
3168

32-
$version_release = Still on development
69+
$version_release = 1.0.0
3370

3471
What's New??
3572

36-
* Development *
73+
* Stable Version *
3774

3875
# How To Use This Project
39-
- Release soon
40-
76+
<h3>Step 1. Add the JitPack repository to your build file</h3>
77+
78+
Add it in your root build.gradle at the end of repositories:
79+
80+
allprojects {
81+
repositories {
82+
...
83+
maven { url 'https://jitpack.io' }
84+
}
85+
}
86+
87+
88+
<h3>Step 2. Add the dependency</h3>
89+
90+
dependencies {
91+
// library consumable code the meal db api
92+
implementation 'com.github.amirisback:consumable-code-the-meal-db-api:$version_release'
93+
}
94+
95+
<h3>Step 3. Declaration ConsumeTheMealDbApi</h3>
96+
97+
val consumeMealApi = ConsumeTheMealDbApi("1") // 1 is API_KEY
98+
consumeMealApi.usingChuckInterceptor(this) // Using Chuck Interceptor
99+
consumeMealApi.listAllCateories(object : MealResultCallback<MealResponse<Category>> {
100+
override fun getResultData(data: MealResponse<Category>) {
101+
102+
// * PLACE YOUR CODE HERE FOR UI / ARRAYLIST *
103+
104+
}
105+
106+
override fun failedResult(statusCode: Int, errorMessage: String?) {
107+
Toast.makeText(this@MainActivity, errorMessage, Toast.LENGTH_SHORT).show()
108+
}
109+
})
110+
41111
# Colaborator
42112
Very open to anyone, I'll write your name under this, please contribute by sending an email to me
43113

0 commit comments

Comments
 (0)