-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 작품 피드 장르별 색상 반영 #800
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: release/1.6.0
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| import androidx.databinding.BindingAdapter | ||
|
|
||
| @BindingAdapter("app:imageTint") | ||
| fun ImageView.setImageTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:parameter-list-wrapping reported by reviewdog 🐶
Parameter should start on a newline
| import androidx.databinding.BindingAdapter | ||
|
|
||
| @BindingAdapter("app:imageTint") | ||
| fun ImageView.setImageTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:function-signature reported by reviewdog 🐶
Newline expected after opening parenthesis
| import androidx.databinding.BindingAdapter | ||
|
|
||
| @BindingAdapter("app:imageTint") | ||
| fun ImageView.setImageTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:parameter-list-wrapping reported by reviewdog 🐶
Missing newline before ")"
| import androidx.databinding.BindingAdapter | ||
|
|
||
| @BindingAdapter("app:imageTint") | ||
| fun ImageView.setImageTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:function-signature reported by reviewdog 🐶
Newline expected before closing parenthesis
| } | ||
|
|
||
| @BindingAdapter("app:backgroundTint") | ||
| fun View.setBackgroundTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:parameter-list-wrapping reported by reviewdog 🐶
Parameter should start on a newline
| } | ||
|
|
||
| @BindingAdapter("app:backgroundTint") | ||
| fun View.setBackgroundTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:function-signature reported by reviewdog 🐶
Newline expected after opening parenthesis
| } | ||
|
|
||
| @BindingAdapter("app:backgroundTint") | ||
| fun View.setBackgroundTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:parameter-list-wrapping reported by reviewdog 🐶
Missing newline before ")"
| } | ||
|
|
||
| @BindingAdapter("app:backgroundTint") | ||
| fun View.setBackgroundTint(@ColorRes colorRes: Int?) { |
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.
🚫 [ktlint] standard:function-signature reported by reviewdog 🐶
Newline expected before closing parenthesis
| ) | ||
|
|
||
| // 1. 첫번쨰 카테고리를 가져온다 | ||
| val firstCategory = feed.relevantCategories.first() |
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.
r: null 처리가 번거로우시겠지만, 가급적이면 firstOrNull과 같은 safe api를 사용해주세요!
생각보다 non-null api들에서 익셉션이 빈번히 발생합니다!
| // 2. 카테고리가 기타인지 확인한다 | ||
| val genre = if (firstCategory != "기타") { | ||
| firstCategory | ||
| // 3. 기타가 아니면 해당하는 장르에 맞는 색상을 반환한다. | ||
| } else { | ||
| // 두번째 값이 있는지를 확인 | ||
| if (feed.relevantCategories.size >= 2) { | ||
| // 두번째 값이 있으면 해당하는 장르에 맞는 색상을 반환한다. | ||
| feed.relevantCategories[1] | ||
| } else { | ||
| "기타" | ||
| } | ||
| } |
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.
c: 간단하게도 쓸 수 있을 것 같습니다!
| // 2. 카테고리가 기타인지 확인한다 | |
| val genre = if (firstCategory != "기타") { | |
| firstCategory | |
| // 3. 기타가 아니면 해당하는 장르에 맞는 색상을 반환한다. | |
| } else { | |
| // 두번째 값이 있는지를 확인 | |
| if (feed.relevantCategories.size >= 2) { | |
| // 두번째 값이 있으면 해당하는 장르에 맞는 색상을 반환한다. | |
| feed.relevantCategories[1] | |
| } else { | |
| "기타" | |
| } | |
| } | |
| // "기타"가 아닌 첫 번째 장르를 찾고, 없으면(리스트가 비었거나 "기타"뿐이면) "기타"를 반환 | |
| val genre = feed.relevantCategories.firstOrNull { it != "기타" } ?: "기타" |
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
Screen_recording_20260128_001553.mp4
Screen_recording_20260128_002659.mp4
로그도 함께 첨부합니다 !

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
현재 relevantCategories에서 값을 가져오고 있는데, 한 장르로 고정된 값이 아니라 장르가 계속 바뀌어서 색상이 다 다르게 나오는 중입니다..
하지만 보시는 바와 같이 두번째 영상은 의도한대로 같은 색상으로 나오고 있습니다 🥲
이해하시기 편하도록 주석을 달아뒀는데 추후에 제거하겠습니다 !