-
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.
Merge pull request #10 from u-barnwal/LIB-6
Update README
- Loading branch information
Showing
4 changed files
with
233 additions
and
21 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
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/isolpro/library/connection/helpers/CHelper.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,48 @@ | ||
package com.isolpro.library.connection.helpers | ||
|
||
import android.content.Context | ||
import com.isolpro.library.connection.Connection | ||
|
||
class CHelper<T>(private val ctx: Context, private val classType: Class<T>) : Connection<T>() { | ||
override var config: Config = Config("API_BASE_ENDPOINT") | ||
|
||
override fun getContext(): Context { | ||
return ctx; | ||
} | ||
|
||
override fun showLoader() { | ||
TODO("Write your function for showing loader") | ||
} | ||
|
||
override fun hideLoader() { | ||
TODO("Write your function for hiding loader") | ||
} | ||
|
||
override fun handleOnRequestCreated(endpoint: String, data: Any?) { | ||
TODO("Access the request endpoint and data") | ||
} | ||
|
||
override fun handleOnResponseReceived(data: String?) { | ||
TODO("This is triggered everytime your receive a response, implement your logger") | ||
} | ||
|
||
override fun handleOnNoResponseError() { | ||
TODO("Handle when nothing is received as response") | ||
} | ||
|
||
override fun handleOnOfflineDataUnsupported() { | ||
TODO("Handle when the request made, doesn't store offline data") | ||
} | ||
|
||
override fun handleOnOfflineDataUnavailable() { | ||
TODO("Handle when the request made, store offline data but doesn't have anything cache yet") | ||
} | ||
|
||
override fun handleOnError(e: Exception) { | ||
TODO("Handle all other errors") | ||
} | ||
|
||
override fun getClassType(): Class<T> { | ||
return classType; | ||
} | ||
} |
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