-
Notifications
You must be signed in to change notification settings - Fork 33
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 이혜원 step2 코드 #95
base: main
Are you sure you want to change the base?
Conversation
super.onCreate() | ||
KakaoMapSdk.init(this, "bfa0e5ab308b39ef7e373921d5a5e697") | ||
Log.d("KakaoSDK", "Kakao SDK initialized") |
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.
여기에서 DI 처리가 이뤄져야할거같아요
class HorRecycleAdapter(private val onClick : (String, String, String, String) -> Unit, private val onDeleteClick: (String) -> Unit ) : RecyclerView.Adapter<HorRecycleAdapter.Holder>() { | ||
|
||
|
||
private var cursor:Cursor? = null |
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.
Adapter에 DB의 데이터를 쿼리해오는 Cursor가 직접 들어오는건 좋은구조가 아니라고 생각해요.
val retrofit = Retrofit.Builder() | ||
.baseUrl(BASE_URL) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
val api = retrofit.create(KakaoAPI::class.java) | ||
val call = api.getSearchKeyword("KakaoAK ${BuildConfig.KAKAO_REST_API_KEY}", keyword) | ||
|
||
call.enqueue(object: Callback<ResultSearch> { | ||
override fun onResponse( | ||
call: Call<ResultSearch>, | ||
response: Response<ResultSearch> | ||
) { | ||
if (response.isSuccessful) { | ||
searchPlaceAPI(response.body()) | ||
adapter.submitList(listItems) | ||
} | ||
} | ||
|
||
override fun onFailure(call: Call<ResultSearch>, t: Throwable) { | ||
} | ||
}) |
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.
View에서 API를 콜하는것은 좋은 책임분리가 아닌것으로 생각됩니다!
이번에는 전반적으로 시간이 부족해서 과제에서 요구하는 사항을 잘 만족하지 못한것으로 보입니다 ㅠㅠ |
어려웠던점
깃에 미숙해서 conflict를 해결하는 과정에서 오류가 크게나서 싹다 코드가 삭제되어버리는 바람에...
step2에 시간을 거의 쓰지못하였습니다..
아직 test코드에 대한 이해가 많이 적어서 main activity만 테스트 코드를 구현을 했습니다 ㅜ
카카오맵 API 심화
step1
과제 진행 요구 사항
프로그래밍 요구 사항