11# consumable-code-pixabay-api By AmirIsBack
2- - v1.0.0 - Development
2+ - v1.0.1 - Development
33- Stable Version
44
55# About This Project
@@ -22,10 +22,40 @@ https://pixabay.com/api/docs/
2222 fun usingChuckInterceptor(context: Context)
2323
2424 // Search for Image
25- fun searchImage(query: String, callback: PixabayResultCallback<ResponseImage>)
25+ fun searchImage(
26+ q: String,
27+ lang: String?,
28+ id: String?,
29+ imageType: String?,
30+ orientation: String?,
31+ category: String?,
32+ minWidth: Int?,
33+ minHeight: Int?,
34+ colors: String?,
35+ editorsChoice: Boolean?,
36+ safeSearch: Boolean?,
37+ order: String?,
38+ page: Int?,
39+ perPage: Int?,
40+ callback: PixabayResultCallback<Response<Image>>
41+ )
2642
2743 // Search for Video
28- fun searchVideo(query: String, callback: PixabayResultCallback<ResponseVideo>)
44+ fun searchVideo(
45+ q: String,
46+ lang: String?,
47+ id: String?,
48+ videoType: String?,
49+ category: String?,
50+ minWidth: Int?,
51+ minHeight: Int?,
52+ editorsChoice: Boolean?,
53+ safeSearch: Boolean?,
54+ order: String?,
55+ page: Int?,
56+ perPage: Int?,
57+ callback: PixabayResultCallback<Response<Video>>
58+ )
2959
3060# Android Library Version (build.gradle)
3161- ext.kotlin_version = '1.3.70'
@@ -37,11 +67,11 @@ https://pixabay.com/api/docs/
3767# Version Release
3868This Is Latest Release
3969
40- $version_release = 1.0.0
70+ $version_release = 1.0.1
4171
4272What's New??
4373
44- * New Release searchImage() and searchVideo() *
74+ * add handing progress view and fully parameter *
4575
4676# How To Use This Project
4777<h3 >Step 1. Add the JitPack repository to your build file</h3 >
@@ -65,20 +95,43 @@ Add it in your root build.gradle at the end of repositories:
6595
6696<h3 >Step 3. Declaration ConsumePixabayApi</h3 >
6797
68- val query = "One Piece"
69- val consumePixabayApi = ConsumePixabayApi(PixabayConstant.SAMPLE_API_KEY)
70- consumePixabayApi.usingChuckInterceptor(this)
71- consumePixabayApi.searchImage(query, object : PixabayResultCallback<ResponseImage>{
72- override fun getResultData(data: ResponseImage) {
73-
74- // * PLACE YOUR CODE HERE FOR UI / ARRAYLIST
75-
76- }
77-
78- override fun failedResult(statusCode: Int, errorMessage: String?) {
79- }
80- })
81-
98+ val consumePixabayApi = ConsumePixabayApi(PixabayConstant.SAMPLE_API_KEY) // Your API Key
99+ consumePixabayApi.usingChuckInterceptor(this) // Using Chuck Interceptor
100+
101+ val query = "Nature"
102+
103+ consumePixabayApi.searchImage(
104+ query,
105+ null,
106+ null,
107+ null,
108+ null,
109+ null,
110+ null,
111+ null,
112+ null,
113+ null,
114+ null,
115+ null,
116+ null,
117+ null,
118+ object : PixabayResultCallback<Response<Image>> {
119+ override fun getResultData(data: Response<Image>) {
120+ // Place your UI / Data
121+ }
122+
123+ override fun failedResult(statusCode: Int, errorMessage: String?) {
124+ // failed to do
125+ }
126+
127+ override fun onShowProgress() {
128+ // showing your progress view
129+ }
130+
131+ override fun onHideProgress() {
132+ // hide your progress view
133+ }
134+ })
82135
83136
84137# Colaborator
0 commit comments