Skip to content

Conversation

@jusang3057
Copy link
Owner

검색어로 리포지토리 불러오기(30개)
아래로 스크롤시 로딩바 생성 및 추가 리포지토리(30개) 불러오기
리포지토리 클릭시 git url로 이동

2024 11 19
실습5
2024-12-02
202024-12-02
2024 12 23
2024 12 23
2025 02 10
Git api 사용하여 30개씩 받아오기. 밑으로 스크롤하면 로딩바 생성 후 추가 30개 불러오기. 클릭시 git url로 이동
Copy link

@skdud0629 skdud0629 left a comment

Choose a reason for hiding this comment

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

수고하셨어요!

private fun loadMoreResults() {
if (pQuery.isNullOrEmpty()) return
Loading = true // 로딩 시작
runOnUiThread { binding.progressBar.visibility = View.VISIBLE }

Choose a reason for hiding this comment

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

코루틴 사용해주세요!

}
} catch (e: Exception) {
// 오류나면 모두 멈춤
e.printStackTrace()

Choose a reason for hiding this comment

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

ui 스레드에서 예외 처리를 하면 앱이 터질 가능성이 있지 않을까요?


fun updateData(newList: List<GithubData>) {
repoList = newList
notifyDataSetChanged()

Choose a reason for hiding this comment

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

diffutill을 사용하신다면 notifyDataSetChanged 을 호출할 필요가 없어서 효율적이에요! notifyDataSetChanged는 비용이 많이 드는 작업입니당

val description = item.optString("description", "No description")
val stars = item.getInt("stargazers_count")
val forks = item.getInt("forks_count")
val url = item.getString("html_url")

Choose a reason for hiding this comment

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

JSON을 직접 파싱하지 말고 Retrofit + Gson을 써주세요!

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