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

[Feature/album detail] bottomSheet와 사진 디테일 추가 #85

Closed
wants to merge 7 commits into from

Conversation

kez-lab
Copy link
Member

@kez-lab kez-lab commented Jul 6, 2023

@kez-lab kez-lab added 😼곽의진 곽의진이 했다 ✨ Feature 기능 개발 labels Jul 6, 2023
@kez-lab kez-lab requested a review from a team as a code owner July 6, 2023 16:10
@kez-lab kez-lab self-assigned this Jul 6, 2023
[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 세부내용 추가
Comment on lines 35 to 40
<style name="TextAppearance.Pophory.HeadLine02">
<item name="android:textFontWeight">600</item>
<item name="android:textSize">19sp</item>
<item name="lineHeight">17sp</item>
</style>

Copy link
Member

Choose a reason for hiding this comment

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

삭제

@@ -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>
Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
viewModel.albumSortType.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach {
viewModel.albumSortType.flowWithLifecycle(lifecycle).onEach {

그냥 이렇게 해도 되지 않나?

Copy link
Member Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

유틸에 stringOf라고 있지 않나?

Copy link
Member Author

Choose a reason for hiding this comment

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

오 처음봤슴다

Copy link
Contributor

@librarywon librarywon left a comment

Choose a reason for hiding this comment

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

LGTM... 의진아 넌 정말 체고다 ✨ ✨ ✨ ✨ ✨ ✨

Comment on lines 38 to 54
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)
)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 해보는건 어떤가요?

Suggested change
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)
)

Copy link
Member Author

Choose a reason for hiding this comment

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

개쩔어요 지렸다...

Copy link
Member Author

Choose a reason for hiding this comment

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

여기에 또 제가 간과한 부분이 == 일 경우에는 NONE으로 처리되게 해놓았네욥... 해당 부분도 수정해서 처리하도록 하겠습니다

}

companion object {
@JvmStatic
Copy link
Contributor

Choose a reason for hiding this comment

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

이 어노테이션은 어떤 역할을 하나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

자바에서도 static처럼 사용할 수 있게 해주는 친구입니당

Copy link
Contributor

Choose a reason for hiding this comment

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

오 또 배워가네요 감사합니다 ㅎㅎ

Comment on lines +59 to +62
Timber.tag(TAG).d("initObserver: %s", albumState.data)
}

is AlbumListState.Error -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 테그를 활용하는거군요 배웠습니다!

Copy link
Member Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

coil 실망할뻔 휴~~

Copy link
Member Author

Choose a reason for hiding this comment

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

coil 컨트리뷰트 한번 가시죠

@kez-lab kez-lab closed this Jul 7, 2023
@kez-lab kez-lab deleted the feature/album_detail branch July 7, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발 😼곽의진 곽의진이 했다
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Album Detail 화면 생성
3 participants