-
Notifications
You must be signed in to change notification settings - Fork 0
Assignment 13 #10
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
base: 실습4
Are you sure you want to change the base?
Assignment 13 #10
Conversation
skdud0629
left a comment
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 fun loadMoreResults() { | ||
| if (pQuery.isNullOrEmpty()) return | ||
| Loading = true // 로딩 시작 | ||
| runOnUiThread { binding.progressBar.visibility = View.VISIBLE } |
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.
코루틴 사용해주세요!
| } | ||
| } catch (e: Exception) { | ||
| // 오류나면 모두 멈춤 | ||
| e.printStackTrace() |
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.
ui 스레드에서 예외 처리를 하면 앱이 터질 가능성이 있지 않을까요?
|
|
||
| fun updateData(newList: List<GithubData>) { | ||
| repoList = newList | ||
| notifyDataSetChanged() |
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.
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") |
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.
JSON을 직접 파싱하지 말고 Retrofit + Gson을 써주세요!
검색어로 리포지토리 불러오기(30개)
아래로 스크롤시 로딩바 생성 및 추가 리포지토리(30개) 불러오기
리포지토리 클릭시 git url로 이동