This repository has been archived by the owner on May 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #28 from MarcDonald/feature/githubVersionChecking
GitHub Version Checking
- Loading branch information
Showing
34 changed files
with
552 additions
and
34 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
5 changes: 0 additions & 5 deletions
5
app/src/main/java/app/marcdev/hibi/data/network/apiresponse/SearchResponse.kt
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
app/src/main/java/app/marcdev/hibi/data/network/github/GithubAPIService.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,29 @@ | ||
package app.marcdev.hibi.data.network.github | ||
|
||
import app.marcdev.hibi.data.network.ConnectivityInterceptor | ||
import app.marcdev.hibi.data.network.github.apiresponse.GithubVersionResponse | ||
import okhttp3.OkHttpClient | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import retrofit2.http.GET | ||
|
||
interface GithubAPIService { | ||
|
||
@GET("repos/MarcDonald/Hibi/releases/latest") | ||
suspend fun getNewestVersion(): GithubVersionResponse | ||
|
||
companion object { | ||
operator fun invoke(connectivityInterceptor: ConnectivityInterceptor): GithubAPIService { | ||
val okHttpClient = OkHttpClient.Builder() | ||
.addInterceptor(connectivityInterceptor) | ||
.build() | ||
|
||
return Retrofit.Builder() | ||
.client(okHttpClient) | ||
.baseUrl("https://api.github.com/") | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
.create(GithubAPIService::class.java) | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/app/marcdev/hibi/data/network/github/apiresponse/Asset.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,17 @@ | ||
package app.marcdev.hibi.data.network.github.apiresponse | ||
|
||
data class Asset( | ||
val browser_download_url: String, | ||
val content_type: String, | ||
val created_at: String, | ||
val download_count: Int, | ||
val id: Int, | ||
val label: Any, | ||
val name: String, | ||
val node_id: String, | ||
val size: Int, | ||
val state: String, | ||
val updated_at: String, | ||
val uploader: Uploader, | ||
val url: String | ||
) |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/app/marcdev/hibi/data/network/github/apiresponse/Author.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 app.marcdev.hibi.data.network.github.apiresponse | ||
|
||
data class Author( | ||
val avatar_url: String, | ||
val events_url: String, | ||
val followers_url: String, | ||
val following_url: String, | ||
val gists_url: String, | ||
val gravatar_id: String, | ||
val html_url: String, | ||
val id: Int, | ||
val login: String, | ||
val node_id: String, | ||
val organizations_url: String, | ||
val received_events_url: String, | ||
val repos_url: String, | ||
val site_admin: Boolean, | ||
val starred_url: String, | ||
val subscriptions_url: String, | ||
val type: String, | ||
val url: String | ||
) |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/app/marcdev/hibi/data/network/github/apiresponse/GithubVersionResponse.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 app.marcdev.hibi.data.network.github.apiresponse | ||
|
||
data class GithubVersionResponse( | ||
val assets: List<Asset>, | ||
val assets_url: String, | ||
val author: Author, | ||
val body: String, | ||
val created_at: String, | ||
val draft: Boolean, | ||
val html_url: String, | ||
val id: Int, | ||
val name: String, | ||
val node_id: String, | ||
val prerelease: Boolean, | ||
val published_at: String, | ||
val tag_name: String, | ||
val tarball_url: String, | ||
val target_commitish: String, | ||
val upload_url: String, | ||
val url: String, | ||
val zipball_url: String | ||
) |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/app/marcdev/hibi/data/network/github/apiresponse/Uploader.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 app.marcdev.hibi.data.network.github.apiresponse | ||
|
||
data class Uploader( | ||
val avatar_url: String, | ||
val events_url: String, | ||
val followers_url: String, | ||
val following_url: String, | ||
val gists_url: String, | ||
val gravatar_id: String, | ||
val html_url: String, | ||
val id: Int, | ||
val login: String, | ||
val node_id: String, | ||
val organizations_url: String, | ||
val received_events_url: String, | ||
val repos_url: String, | ||
val site_admin: Boolean, | ||
val starred_url: String, | ||
val subscriptions_url: String, | ||
val type: String, | ||
val url: String | ||
) |
5 changes: 3 additions & 2 deletions
5
...cdev/hibi/data/network/JishoAPIService.kt → ...ibi/data/network/jisho/JishoAPIService.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
2 changes: 1 addition & 1 deletion
2
...i/data/network/apiresponse/Attribution.kt → .../network/jisho/apiresponse/Attribution.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
2 changes: 1 addition & 1 deletion
2
...dev/hibi/data/network/apiresponse/Data.kt → ...bi/data/network/jisho/apiresponse/Data.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
2 changes: 1 addition & 1 deletion
2
...hibi/data/network/apiresponse/Japanese.kt → ...ata/network/jisho/apiresponse/Japanese.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
5 changes: 5 additions & 0 deletions
5
app/src/main/java/app/marcdev/hibi/data/network/jisho/apiresponse/SearchResponse.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,5 @@ | ||
package app.marcdev.hibi.data.network.jisho.apiresponse | ||
|
||
data class SearchResponse( | ||
val `data`: List<Data> | ||
) |
2 changes: 1 addition & 1 deletion
2
...ev/hibi/data/network/apiresponse/Sense.kt → ...i/data/network/jisho/apiresponse/Sense.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
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
Oops, something went wrong.