generated from frogobox/frogo-android-sdk
-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
dda44d7
commit 6c93529
Showing
27 changed files
with
193 additions
and
159 deletions.
There are no files selected for viewing
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...in/java/com/frogobox/sdk/FrogoApiModel.kt → ...ava/com/frogobox/coresdk/FrogoApiModel.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,4 +1,4 @@ | ||
package com.frogobox.sdk | ||
package com.frogobox.coresdk | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
|
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
55 changes: 55 additions & 0 deletions
55
frogocoresdk/src/main/java/com/frogobox/coresdk/FrogoCoreApiClient.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,55 @@ | ||
package com.frogobox.coresdk | ||
|
||
import okhttp3.Interceptor | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Retrofit | ||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import java.util.concurrent.TimeUnit | ||
|
||
/* | ||
* Created by faisalamir on 26/07/21 | ||
* FrogoSDK | ||
* ----------------------------------------- | ||
* Name : Muhammad Faisal Amir | ||
* E-mail : [email protected] | ||
* Github : github.com/amirisback | ||
* ----------------------------------------- | ||
* Copyright (C) 2021 FrogoBox Inc. | ||
* All rights reserved | ||
* | ||
*/ | ||
|
||
object FrogoCoreApiClient { | ||
|
||
val TAG: String = FrogoCoreApiClient::class.java.simpleName | ||
|
||
inline fun <reified T> create(url: String): T { | ||
return Retrofit.Builder() | ||
.baseUrl(url) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | ||
.build().create(T::class.java) | ||
} | ||
|
||
inline fun <reified T> create(url: String, chuckInterceptor: Interceptor): T { | ||
val mLoggingInterceptor = HttpLoggingInterceptor() | ||
mLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | ||
|
||
val mClient = OkHttpClient.Builder() | ||
.addInterceptor(mLoggingInterceptor) | ||
.addInterceptor(chuckInterceptor) | ||
.readTimeout(30, TimeUnit.SECONDS) | ||
.connectTimeout(30, TimeUnit.SECONDS) | ||
.build() | ||
|
||
return Retrofit.Builder() | ||
.baseUrl(url) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | ||
.client(mClient) | ||
.build().create(T::class.java) | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
frogocoresdk/src/main/java/com/frogobox/coresdk/FrogoDataResponse.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,23 @@ | ||
package com.frogobox.coresdk | ||
|
||
/* | ||
* Created by faisalamir on 26/07/21 | ||
* FrogoSDK | ||
* ----------------------------------------- | ||
* Name : Muhammad Faisal Amir | ||
* E-mail : [email protected] | ||
* Github : github.com/amirisback | ||
* ----------------------------------------- | ||
* Copyright (C) 2021 FrogoBox Inc. | ||
* All rights reserved | ||
* | ||
*/ | ||
|
||
interface FrogoDataResponse<T> { | ||
|
||
fun onSuccess(data: T) | ||
fun onFailed(statusCode: Int, errorMessage: String? = "") | ||
fun onShowProgress() | ||
fun onHideProgress() | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
frogocoresdk/src/main/java/com/frogobox/coresdk/FrogoStateResponse.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,22 @@ | ||
package com.frogobox.coresdk | ||
|
||
|
||
/* | ||
* Created by faisalamir on 27/02/22 | ||
* FrogoSDK | ||
* ----------------------------------------- | ||
* Name : Muhammad Faisal Amir | ||
* E-mail : [email protected] | ||
* Github : github.com/amirisback | ||
* ----------------------------------------- | ||
* Copyright (C) 2022 Frogobox Media Inc. | ||
* All rights reserved | ||
* | ||
*/ | ||
|
||
interface FrogoStateResponse { | ||
fun onSuccess() | ||
fun onFailed(statusCode: Int, errorMessage: String? = "") | ||
fun onShowProgress() | ||
fun onHideProgress() | ||
} |
This file was deleted.
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
Oops, something went wrong.