-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat/#61] 홈화면 API 연결, 배경 적용 #64
Conversation
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.
확인 완료했습니다~
배경 이미지는 우리가 조정할 수 있는게 아니기 때문에 사이즈별로 받아야 할 것 같고, 서버 통신은 기기 상의 와이파이 이슈이지 않을까 싶습니다... (oncreate 말고는 넣을 생명주기가 딱히 없기 때문)
파이팅 파이팅!!
@SuppressLint("StringFormatMatches") | ||
private fun setData(data: HomeResponseDto.HomeData) { | ||
with(binding) { | ||
ivBackground.load("https://i.ibb.co/sRV9Vr4/iv-maru.jpg") | ||
tvTitle.text = getString(R.string.main_topic, data.index, data.topic) | ||
} | ||
} |
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.
요건 왜 들어간걸까요?
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.
이 부분이 배경 위에있는 #1 나의 어린시절을 작성하는 부분이에요! 근데 "#$data.index ... " 이런식으로 텍스트 대응하니까 ide에서 getString 방식을 추천해줘서 바꿨더니 들어갔어요
interface HomeService { | ||
@Headers("Content-Type: application/json") |
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.
이 부분 없으면 통신이 안되나요?
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.
사실 이것도 한번 확인해봐야겠어요 테스트 가능한대로 해보고 바로 지우던가 하겠습니다
fun getHomeData() { | ||
viewModelScope.launch { | ||
homeRepositoryImpl.getHomeData() | ||
.onSuccess { response -> | ||
Log.e("hyeon", "getHomeData 성공") | ||
_homeData.value = response.data | ||
}.onFailure { error -> | ||
Log.e("hyeon", "getHomeData 실패 " + error.message) | ||
} | ||
} | ||
} |
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.
굿굿 코드 완전 깔끔합니다!!!!
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.
꺄하
🎀 Related Issues
close #61
🤔 What Did You Do
이미지 비율은 디자이너님 측에 말해서 사이즈 조정할 예정입니다.
지금 토큰이 유효하지않아서 스크린샷을 못찍어요호
근데 data get을 fragment 생명주기 중 언제 해야하는지.. 의문이 생깁니다.
현재 작성한 코드로 하니까 view가 생성되고 1초정도 이전 화면이 보이고 get 한 데이터들로 설정 되는거같아요. 이 부분 피드백 부탁드립니다 !!!