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

[ADD/#32] 공고 정렬 바텀시트 구현 #45

Merged
merged 13 commits into from
Jul 11, 2024

Conversation

Hyobeen-Park
Copy link
Member

@Hyobeen-Park Hyobeen-Park commented Jul 10, 2024

⛳️ Work Description

  • SortingButton 구현
  • SortingBottomSheet 구현

📸 Screenshot

Screen_Recording_20240711_032836_Terning-Android.mp4

📢 To Reviewers

  • 사용 방법은 노션 참고해주세요😎

@Hyobeen-Park Hyobeen-Park added ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 효빈💚 효빈 labels Jul 10, 2024
@Hyobeen-Park Hyobeen-Park self-assigned this Jul 10, 2024
Copy link
Contributor

@arinming arinming left a comment

Choose a reason for hiding this comment

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

고생했더용 ㅜㅜ!!!

import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.terning.core.designsystem.theme.White

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TerningBasicBottomSheet(
modifier: Modifier = Modifier,
Copy link
Contributor

Choose a reason for hiding this comment

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

modifier 어디서 사용하나용?

Copy link
Member Author

@Hyobeen-Park Hyobeen-Park Jul 11, 2024

Choose a reason for hiding this comment

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

이거 사용 안해서 삭제할게욤!!

Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

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

바텀시트 너무 멋져요!! 완벽합니다!!!!!!

.padding(horizontal = 24.dp),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
items(5) { sortIndex ->
Copy link
Member

Choose a reason for hiding this comment

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

전 이런 부분에 const val, companion object 등을 사용하여 하드코딩을 피하는 편입니다!!
그러는 편이 코드 보기에 직관적일 것 같아요!!

Copy link
Member Author

Choose a reason for hiding this comment

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

오호 그게 훨씬 더 좋아보이네요!! 감사합니다:)

Comment on lines +6 to +12
enum class SortBy(@StringRes val type: Int) {
EARLIEST(R.string.sort_by_earliest),
SHORTEST(R.string.sort_by_shortest),
LONGEST(R.string.sort_by_longest),
SCRAP(R.string.sort_by_scrap),
VIEW_COUNT(R.string.sort_by_view_count),
}
Copy link
Member

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.

넵!! 바텀시트랑 버튼에서 사용합니다!

Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

터닝안드는 효빈언니 보유파트라 행복해요

Comment on lines +1 to +6
package com.terning.core.designsystem.component.bottomsheet

import androidx.annotation.StringRes
import com.terning.core.R

enum class SortBy(@StringRes val type: Int) {
Copy link
Member

Choose a reason for hiding this comment

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

홈에서 쓰이는 부분을 core 모듈에서 관리하는 이유가 있나용?
이 부분은 TerningBasicBottomSheet를 재사용하는 부분이 아니라, 홈의 바텀시트에 들어갈 구성이라면 feature 모듈에서 관리해줘도 될 것 같아서요!

Copy link
Member Author

Choose a reason for hiding this comment

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

이게 탐색 뷰에서도 동일한 바텀시트가 사용돼서 홈, 탐색 뷰에서 같이 사용하려고 이렇게 구현했는데 저도 이 enum class 위치가 여기가 맞는지 고민이네요...🥹 이건 좀 더 고민해볼게요..!!

Comment on lines +30 to +31

@OptIn(ExperimentalMaterial3Api::class)
Copy link
Member

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.

근데 그게 추가를 해도 없애면 오류가 생기더라구요🥹 이것도 다른 방법 찾게 되면 한번 해볼게요!!

Comment on lines 34 to 37
modifier: Modifier = Modifier,
onDismiss: () -> Unit,
currentSortBy: Int,
newSortBy: MutableState<Int> = mutableStateOf(currentSortBy),
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
modifier: Modifier = Modifier,
onDismiss: () -> Unit,
currentSortBy: Int,
newSortBy: MutableState<Int> = mutableStateOf(currentSortBy),
onDismiss: () -> Unit,
currentSortBy: Int,
modifier: Modifier = Modifier,
newSortBy: MutableState<Int> = mutableStateOf(currentSortBy),

이렇게 순서 맞춰주면 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

와우 인정합니다 감사해요!!

Comment on lines +75 to +82
.noRippleClickable {
newSortBy.value = sortIndex
scope
.launch { sheetState.hide() }
.invokeOnCompletion {
if (!sheetState.isVisible) {
onDismiss()
}
Copy link
Member

Choose a reason for hiding this comment

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

바텀시트 내려가는 부분 구현해준 효빈언니 최고!!!!!! 참고하겠습니당

Comment on lines 22 to +24
},
sheetState = sheetState,
modifier = modifier.navigationBarsPadding()
containerColor = White,
Copy link
Member

Choose a reason for hiding this comment

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

요것두 반영해준 거 최고!!

@Hyobeen-Park Hyobeen-Park merged commit 5163ce3 into develop Jul 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 효빈💚 효빈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADD] SortingBottomSheet 컴포넌트 구현
4 participants