Skip to content
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

Merged
merged 6 commits into from
Aug 14, 2019
Merged

Android sample #149

merged 6 commits into from
Aug 14, 2019

Conversation

IVSivak
Copy link
Collaborator

@IVSivak IVSivak commented Aug 6, 2019

No description provided.

@codecov
Copy link

codecov bot commented Aug 6, 2019

Codecov Report

Merging #149 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6e2434...7d8b638. Read the comment docs.

/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
Copy link
Owner

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

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"
Copy link
Owner

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
Copy link
Owner

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")
}
Copy link
Owner

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>()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private val list = mutableListOf<Repository>()
private val repositories = mutableListOf<Repository>()

holder.bind(list[position])
}

fun update(newList: List<Repository>) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fun update(newList: List<Repository>) {
fun update(repositories: List<Repository>) {


data class ViewResponse(
val status: String,
val list: List<Repository>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val list: List<Repository>
val repositories: List<Repository>

@@ -0,0 +1,22 @@
package io.github.ivsivak.android_kohttp
Copy link
Owner

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

@rybalkinsd
Copy link
Owner

Let's merge it right after #128 applying comments above

@rybalkinsd rybalkinsd merged commit 77d0664 into rybalkinsd:master Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants