-
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
[Feature/album detail] bottomSheet와 사진 디테일 추가 #85
Conversation
kez-lab
commented
Jul 6, 2023
- close Album Detail 화면 생성 #59
7a5f89f
to
8027845
Compare
[feat/album_detail]: Add Album Detail [feat/album_detail]: Add Bottom Sheet [feat/album_detail]: bottomSheet 이슈 발생 [feat/album_detail]: AlbumDetailActivity 이동 추가 [feat/album_detail]: AlbumDetail Delete Dialog 추가 [feat/album_detail]: AlbumList refactor and PhotoId Int To Long [feat/album_detail]: AlbumList, Album Detail 세부내용 추가
8027845
to
c68dbd4
Compare
app/src/main/res/values/type.xml
Outdated
<style name="TextAppearance.Pophory.HeadLine02"> | ||
<item name="android:textFontWeight">600</item> | ||
<item name="android:textSize">19sp</item> | ||
<item name="lineHeight">17sp</item> | ||
</style> | ||
|
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.
삭제
app/src/main/res/values/themes.xml
Outdated
@@ -33,6 +33,7 @@ | |||
<item name="textAppearanceHeadlineMedium">@style/TextAppearance.Pophory.HeadLineMedium | |||
</item> | |||
<item name="textAppearanceHeadlineSmall">@style/TextAppearance.Pophory.HeadLineSmall</item> | |||
<item name="textAppearanceHeadline2">@style/TextAppearance.Pophory.HeadLine02</item> |
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.
textAppearanceHeadlineLarge로 사용하시면 될듯
android:paddingStart="20dp" | ||
android:paddingEnd="0dp" | ||
android:text="@string/sort_oldest" | ||
android:textAppearance="@style/TextAppearance.Pophory.ModalText2" |
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.
android:textAppearance="@style/TextAppearance.Pophory.ModalText2" | |
android:textAppearance="?textAppearanceHeadlineMedium" |
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:text="@string/select_sort" | ||
android:textAppearance="@style/TextAppearance.Pophory.ModalText1" |
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.
android:textAppearance="@style/TextAppearance.Pophory.ModalText1" | |
android:textAppearance="?textAppearanceModalText1" |
@@ -76,6 +83,17 @@ class AlbumListActivity : AppCompatActivity() { | |||
} | |||
|
|||
private fun initSortViews() { | |||
viewModel.albumSortType.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach { |
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.
viewModel.albumSortType.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach { | |
viewModel.albumSortType.flowWithLifecycle(lifecycle).onEach { |
그냥 이렇게 해도 되지 않나?
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.
@l2hyunwoo
기본값이 있군요 확인!!
@OptIn(ExperimentalCoroutinesApi::class)
public fun <T> Flow<T>.flowWithLifecycle(
lifecycle: Lifecycle,
minActiveState: Lifecycle.State = Lifecycle.State.STARTED
): Flow<T> = callbackFlow {
lifecycle.repeatOnLifecycle(minActiveState) {
[email protected] {
send(it)
}
}
close()
}
viewModel.albumSortType.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach { | ||
binding.tvSort.text = when(it) { | ||
AlbumSortType.NEWEST -> { | ||
getString(R.string.sort_newest) |
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.
유틸에 stringOf라고 있지 않나?
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.
LGTM... 의진아 넌 정말 체고다 ✨ ✨ ✨ ✨ ✨ ✨
when { | ||
(width > height) -> { | ||
photoDetails.add( | ||
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.HORIZONTAL) | ||
) | ||
} | ||
(width < height) -> { | ||
photoDetails.add( | ||
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.VERTICAL) | ||
) | ||
} | ||
else -> { | ||
photoDetails.add( | ||
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.NONE) | ||
) | ||
} | ||
} |
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.
이렇게 해보는건 어떤가요?
when { | |
(width > height) -> { | |
photoDetails.add( | |
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.HORIZONTAL) | |
) | |
} | |
(width < height) -> { | |
photoDetails.add( | |
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.VERTICAL) | |
) | |
} | |
else -> { | |
photoDetails.add( | |
PhotoDetail(id, studio, takenAt, imageUrl, width, height, OrientType.NONE) | |
) | |
} | |
} | |
val orientationType = when { | |
width > height -> OrientType.HORIZONTAL | |
width < height -> OrientType.VERTICAL | |
else -> OrientType.NONE | |
} | |
photoDetails.add( | |
PhotoDetail(id, studio, takenAt, imageUrl, width, height, orientationType) | |
) | |
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.
여기에 또 제가 간과한 부분이 == 일 경우에는 NONE으로 처리되게 해놓았네욥... 해당 부분도 수정해서 처리하도록 하겠습니다
} | ||
|
||
companion object { | ||
@JvmStatic |
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.
자바에서도 static처럼 사용할 수 있게 해주는 친구입니당
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.
오 또 배워가네요 감사합니다 ㅎㅎ
Timber.tag(TAG).d("initObserver: %s", albumState.data) | ||
} | ||
|
||
is AlbumListState.Error -> { |
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.
저도... 잘 모르는데 코파일럿이 추천해주었어요 ㅋㅎㅋㅎㅎㅋㅎㅋㅎ
} | ||
private fun ImageView.loadAndDisplayHorizontalImage(photoDetail: PhotoDetail) = | ||
load(photoDetail.imageUrl) { | ||
crossfade(true) |
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.
coil 실망할뻔 휴~~
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.
coil 컨트리뷰트 한번 가시죠