Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e3d4191
[Feat/#8] 베이직 필드
doyeon0307 Jan 10, 2026
bcf7af1
[Feat/#8] 롱/쇼트 텍스트 필드
doyeon0307 Jan 10, 2026
8d217df
[Feat/#8] 카운트 필드
doyeon0307 Jan 10, 2026
bc232a8
[Feat/#8] 커스텀 드롭다운메뉴
doyeon0307 Jan 10, 2026
b79d25e
[Feat/#8] 드롭다운 필드
doyeon0307 Jan 10, 2026
cd74801
[Fix/#8] 베이직 필드 포커스아웃 시 말줄임 텍스트 표시 로직 수정
doyeon0307 Jan 10, 2026
0904355
[Feat/#8] 서치 필드
doyeon0307 Jan 10, 2026
f8fe6be
[Chore/#8] kdoc 주석 추가 및 klint 적용
doyeon0307 Jan 10, 2026
d13dfa9
[Fix/#8] 롱 텍스트 필드 키보드 액션 디폴트를 기본값으로 변경
doyeon0307 Jan 10, 2026
3869aa3
[Fix/#8] 하드코딩 제거 및 파라미터값 전달
doyeon0307 Jan 11, 2026
48ba8af
[Fix/#8] disabled인 메뉴 아이템 터치 이벤트 차단
doyeon0307 Jan 11, 2026
898ff9d
[Fix/#8] 드롭다운 open 상태에 따른 arrow 아이콘 수정
doyeon0307 Jan 11, 2026
822c0d5
[Feat/#8] 드롭다운 메뉴 최대 높이 기본값 및 타입 설정
doyeon0307 Jan 11, 2026
00106e8
[Fix/#8] 서치 필드 포커스 보더 컬러 로직 수정
doyeon0307 Jan 11, 2026
853dd67
[Feat/#8] 에러 케이스 및 라벨 추가
doyeon0307 Jan 11, 2026
c32c57f
[Chore/#8] klint 적용
doyeon0307 Jan 11, 2026
eb17a11
[Fix/#8] 불필요한 딜레이 제거
doyeon0307 Jan 11, 2026
e20ccf7
[Chore/#8] 주석 수정
doyeon0307 Jan 11, 2026
ee16ef6
[Merge/#8] develop 병합
doyeon0307 Jan 13, 2026
54f1cb0
[Refactor/#19] modifier 익스텐션 적용
doyeon0307 Jan 13, 2026
77bc749
[Fix/#19] 오탈자 수정
doyeon0307 Jan 13, 2026
9c45c0b
[Refactor/#19] 드롭다운/서치 필드 리팩토링
doyeon0307 Jan 13, 2026
75a928c
[Refactor/#19] 필드 리팩토링
doyeon0307 Jan 13, 2026
d3779b9
[Refactor/#19] interactionSource 파라미터 추가
doyeon0307 Jan 13, 2026
09edfa6
[Chore/#19] klint 적용
doyeon0307 Jan 13, 2026
df427b0
[Chore/#19] 오탈자 수정
doyeon0307 Jan 13, 2026
c6c4f33
[Merge/#19] develop 병합
doyeon0307 Jan 13, 2026
0d641c0
[Merge/#8] develop 병합
doyeon0307 Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
package com.poti.android.core.designsystem.component.field

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider
import androidx.compose.ui.window.PopupProperties

@Composable
internal fun PotiDropdownMenu(
expandedState: MutableTransitionState<Boolean>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://github.com/team-poti/POTI-ANDROID/pull/14/changes#r2685028916

만약 PotiDropdownField 가 extand 를 Boolean 으로 관리한다면...
expanded: Boolean 으로 받고,
내부적으로 val expandedState = remember { MutableTransitionState(expanded) } 인 형태..?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

죄송하지만 의도를 잘 이해하지 못햇서용..
PotiDropdownFieldexpandedState 대신 expanded: Boolean 값을 관리하면 좋겠다는 의미인가요?

PotiDropdownField에서는 유저 액션에 따라 expandedState.target값을 조정합니다.
Expanded 상태 관리는 PotiDropdownField에서, 상태에 따른 애니메이션은 PotiDropdownMenu에서 처리하는 구조여서 그대로 파라미터로 전달해주도록 구현했어요.

onDismissRequest: () -> Unit,
parentWidth: Int,
offset: DpOffset,
scrollState: ScrollState,
shape: Shape,
border: BorderStroke,
maxHeight: Dp?,
popupProterties: PopupProperties = PopupProperties(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p3: PopupProperties 오타발견 크크

content: @Composable ColumnScope.() -> Unit,
) {
if (expandedState.currentState || expandedState.targetState) {
val density = LocalDensity.current
val popupPositionProvider = remember(offset, density) {
val offsetYPx = with(density) { offset.y.roundToPx() }
object : PopupPositionProvider {
override fun calculatePosition(
anchorBounds: IntRect,
windowSize: IntSize,
layoutDirection: LayoutDirection,
popupContentSize: IntSize,
): IntOffset {
return IntOffset(
x = anchorBounds.left,
y = anchorBounds.bottom + offsetYPx
)
}
}
}

Popup(
onDismissRequest = onDismissRequest,
popupPositionProvider = popupPositionProvider,
properties = popupProterties,
) {
PotiDropdownMenuContent(
expandedState = expandedState,
scrollState = scrollState,
shape = shape,
border = border,
parentWidth = parentWidth,
maxHeight = maxHeight,
content = content,
)
}
}
}

@Composable
private fun PotiDropdownMenuContent(
expandedState: MutableTransitionState<Boolean>,
scrollState: ScrollState,
shape: Shape,
border: BorderStroke?,
parentWidth: Int,
maxHeight: Dp?,
content: @Composable ColumnScope.() -> Unit,
) {
val density = LocalDensity.current

AnimatedVisibility(
visibleState = expandedState,
enter = slideInVertically(
initialOffsetY = { -it },
animationSpec = tween(120, easing = LinearOutSlowInEasing)
),
exit = slideOutVertically(
targetOffsetY = { -it },
animationSpec = tween(75, easing = LinearOutSlowInEasing)
)
) {
Surface(
modifier = Modifier
.width(with(density) { parentWidth.toDp() }),
shape = shape,
border = border,
) {
Column(
modifier =
Modifier
.then(
when (maxHeight) {
null -> Modifier
else -> Modifier.heightIn(max = maxHeight)
},
)
.verticalScroll(scrollState),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: LazyColumn 말고 Column을 쓴 이유가 있을까요?? 옵션 개수가 많은 경우가 있다면 LazyColumn이 더 좋을 것 같은데

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

드롭다운 메뉴의 경우 전반적으로 Compose의 DropdownMenu를 참고해서 구현했으며, Compose가 Column을 사용해 저도 자연스레 Column을 사용하게 되었어요.

다만 Compose는 아래와 같이 다양한 레이아웃을 열어두는 점에서 Column 사용에 의의가 있고
image

저희는 옵션 아이템만을 보여주는 구조기 때문에 LazyColumn 사용이 더 맞아보입니다 수정할게용!

content = content,
)
}
}
}