-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android sample #149
Android sample #149
Conversation
Codecov Report
@@ Coverage Diff @@
## master #149 +/- ##
=========================================
Coverage 91.08% 91.08%
Complexity 129 129
=========================================
Files 43 43
Lines 370 370
Branches 43 43
=========================================
Hits 337 337
Misses 10 10
Partials 23 23 Continue to review full report at Codecov.
|
samples/android/.gitignore
Outdated
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to trek such files in personal global gitignore
samples/android/app/build.gradle
Outdated
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" | ||
|
||
implementation "io.github.rybalkinsd:kohttp:0.10.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about passing impl dep to latest current project version?
|
||
private lateinit var mainViewModel: MainViewModel | ||
|
||
lateinit var adapter: RepositoryAdapter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why mainViewModel
and adapter
visibility differs?
withContext(Dispatchers.IO) { | ||
val response = httpGet { | ||
url("https://api.github.com/users/rybalkinsd/repos") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do .use { }
and process response inside to handle closing
|
||
class RepositoryAdapter : RecyclerView.Adapter<RepositoryAdapter.ViewHolder>() { | ||
|
||
private val list = mutableListOf<Repository>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private val list = mutableListOf<Repository>() | |
private val repositories = mutableListOf<Repository>() |
holder.bind(list[position]) | ||
} | ||
|
||
fun update(newList: List<Repository>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fun update(newList: List<Repository>) { | |
fun update(repositories: List<Repository>) { |
|
||
data class ViewResponse( | ||
val status: String, | ||
val list: List<Repository> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val list: List<Repository> | |
val repositories: List<Repository> |
@@ -0,0 +1,22 @@ | |||
package io.github.ivsivak.android_kohttp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if it's a good idea to have a different package root.
#128 will move everything to io.github.rybalkinsd.kohttp.<subproject-name>
path
Let's merge it right after #128 applying comments above |
No description provided.