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

week3 commit 이승철 #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

week3 commit 이승철 #13

wants to merge 1 commit into from

Conversation

tmdcheol
Copy link
Collaborator

데이터를 가져오는 방식으로 해보고 싶어서 하다가 어려워서 구현을 많이 못했습니다.
이해도 잘 안가서 다시 공부해 봐야 할 것 같습니다.

그리고 사실 시간을 많이 투자하지 못했습니다. 죄송합니다.
다음주에 도전, 심화 부분까지 노력해 보겠습니다.

diffUtil 이 뭔지 간단하게 공부해보았고,
인터파크 book open api를 통해 json으로 받아왔습니다.
glide를 이용하여 사진 데이터 로드,
retrofit library를 사용하는 법을 하긴 했는데 솔직히 너무 어지럽습니다.

@tmdcheol tmdcheol requested review from JJJoonngg and ckgod August 11, 2022 11:35
@tmdcheol tmdcheol self-assigned this Aug 11, 2022
# For customization when using a Version Control System, please read the
# header note.
#Thu Aug 11 16:45:35 KST 2022
sdk.dir=/Users/leeseungcheol/Library/Android/sdk
Copy link
Member

Choose a reason for hiding this comment

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

해당 파일도 git ignore 에 추가시켜도 됩니다~

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kr.co.landvibe.summer_coding_android">

<!-- 승철 -->
<uses-permission android:name="android.permission.INTERNET"/>
Copy link
Member

Choose a reason for hiding this comment

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

퍼미션 관련 부분에는 굳이 주석을 넣지 않아도 되요~!



val retrofit = Retrofit.Builder()
.baseUrl("https://book.interpark.com") // http 는 x , https 는 허용
Copy link
Member

Choose a reason for hiding this comment

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

요런 상수들은 따로 상수화를 진행합니다.

companion object 에
const val BASE_URL = "https://book.interpark.com"
요런식으로들 써요~

import kr.co.landvibe.summer_coding_android.leesc0893.model.Book


class BookAdapter : ListAdapter<Book, BookAdapter.BookItemViewHolder>(diffUtil) {
Copy link
Member

Choose a reason for hiding this comment

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

app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/bookImageView"
app:layout_constraintTop_toTopOf="parent"
tools:text="제목 예시" />
Copy link
Member

Choose a reason for hiding this comment

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

tools:text = "내용"
요런식도 좋지만, 좀 긴 평문들이 필요하거나, 랜덤한 부분들 까지 xml 에서 확인하고 싶다면
tools:text=@tools:sample/lorem/random
요렇게도 사용합니다, android lorem 찾아보면 재미있는 것들이 많아요~!

tools:background="@color/black" />

<TextView
android:id="@+id/titleTextView"
Copy link
Member

Choose a reason for hiding this comment

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

titleTextView 라는 id들은 평이 하게 쓰일 수 있으니
itemBookTitleText 와 같이, 해당 xml 의 파일명을 접두사 혹은 접미사로 넣어주는걸 추천드립니다.

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