Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0d5025b
[refactor]: group vote button 데이터 구조에 맞게 수정 (#33)
Nico1eKim Jul 8, 2025
0231fc7
[refactor]: data 구조 수정에 따른 컴포넌트 수정 (#33)
Nico1eKim Jul 8, 2025
d887ae5
[ui]: vote comment card 컴포넌트 제작 (#33)
Nico1eKim Jul 8, 2025
8f22566
[ui]: profilebar 디자인 수정 (#33)
Nico1eKim Jul 8, 2025
d4d71cd
[ui]: floating button 위치 수정 (#33)
Nico1eKim Jul 8, 2025
a61981a
[ui]: 기록장 페이지 제작 (#33)
Nico1eKim Jul 8, 2025
b3bc9a0
[ui]: 진행도 블러효과 추가 (#33)
Nico1eKim Jul 8, 2025
0273fbf
[refactor]: 필터버튼 눌렀을 때 위치 고정 (#33)
Nico1eKim Jul 8, 2025
976ceec
[refactor]: 페이지 필터 zindex 수정 (#33)
Nico1eKim Jul 8, 2025
4ca99fb
[chore]: misc gitignore에 추가 (#33)
Nico1eKim Jul 9, 2025
fa4fae8
[ui]: profile bar feed 컴포넌트 제작 (#33)
Nico1eKim Jul 9, 2025
b1895f2
[ui]: comment item 컴포넌트 제작 (#33)
Nico1eKim Jul 9, 2025
3ea1cc4
[ui]: reply item 컴포넌트 제작 (#33)
Nico1eKim Jul 9, 2025
97707fe
[ui]: comment section 컴포넌트 제작 (#33)
Nico1eKim Jul 9, 2025
89c360d
[refactor]: bottom sheet data class 분리 (#33)
Nico1eKim Jul 9, 2025
b7fb973
[refactor]: page text field에 숫자만 입력 가능하도록 수정 (#33)
Nico1eKim Jul 9, 2025
fd7e5c5
[refactor]: 필터 버튼 바깥 영역 클리했을 때 드롭다운 닫히도록 수정 (#33)
Nico1eKim Jul 9, 2025
39c0e60
[chore]: 필요없는 주석 삭제 (#33)
Nico1eKim Jul 9, 2025
8cc2471
[refactor]: 바텀시트 값들 상수화하기 (#33)
Nico1eKim Jul 9, 2025
a7f305e
[ui]: 기존의 알람 컴포넌트 수정 (#36)
Nico1eKim Jul 10, 2025
3eba2b4
[ui]: 알람 아이템 추가 및 필터 추가 (#36)
rbqks529 Jul 8, 2025
a61416b
[ui]: 알람 화면(공통) 구현 완료 (#36)
rbqks529 Jul 8, 2025
1d158d9
[ui]: AlarmScreen 수정 및 CardAlarm 배경색, 빨간 점 수정 (#36)
rbqks529 Jul 9, 2025
9ce1fae
[ui]: 내 모임방 Pager 디자인 수정 완료 (#35)
rbqks529 Jul 3, 2025
e5f0f03
[ui]: GroupMakeRoomScreen 책 선택 구현( (#35)
rbqks529 Jul 4, 2025
7e9463b
[ui]: 커스텀 BottomSheet 추가, 책 추가 요청 화면 추가 (#35)
rbqks529 Jul 4, 2025
b4e8503
[ui]: 책 선택 화면 수정 및 구현 완료 (#35)
rbqks529 Jul 4, 2025
4e6c0fd
[ui]: 파일 이름 및 위치 변경 (#35)
rbqks529 Jul 6, 2025
9461d7c
[ui]: String 추가 및 책 선택 컴포넌트 수정(#35)
rbqks529 Jul 6, 2025
466a267
[ui]: Picker Component 개발 (#35)
rbqks529 Jul 6, 2025
6f37216
[ui]: Picker Component 개발 (#35)
rbqks529 Jul 6, 2025
ae3e0ac
[ui]: 전체 방 만들기 화면 개발 완료 (#35)
rbqks529 Jul 6, 2025
f1fe801
[ui]: 독서 모임방 pager Indicator 삭제 (#35)
rbqks529 Jul 7, 2025
0e2ea50
[ui]: String Resource 추출 (#35)
rbqks529 Jul 7, 2025
7c51c3d
[chore]: 불 필요한 주석 제거 (#35)
rbqks529 Jul 7, 2025
d073aeb
[ui]: 바텀시트 스크롤바 수정 및 파라미터 수정 (#36)
rbqks529 Jul 9, 2025
9238100
[ui]: Picker 및 방 생성 화면 추가 사항 수정 (#36)
rbqks529 Jul 9, 2025
ef875f2
[ui]: Image를 Icon으로 수정 (#36)
rbqks529 Jul 9, 2025
54d6ad8
[ui]: String, util 함수 추출 (#36)
rbqks529 Jul 9, 2025
fce6f4e
[ui]: section dp 수정 및 세로 정렬 수정 (#36)
rbqks529 Jul 9, 2025
dfab35f
[refactor]: string 수정 및 기타 수정 (#36)
rbqks529 Jul 9, 2025
f59542a
[refactor]: GroupMakeRoomScreen의 상태 및 데이터 클래스 분리 및 뷰모델 예시 작성 (#36)
rbqks529 Jul 9, 2025
5a916eb
[refactor]: 장르를 viewModel의 장르를 사용하도록 수정 (#35)
rbqks529 Jul 9, 2025
d223a12
[fix]: conflict 해결 (#33)
Nico1eKim Jul 8, 2025
0e5f685
[fix]: conflict 해결 (#33)
Nico1eKim Jul 9, 2025
7d2e195
[refactor]: menu bottom sheet custom bottom sheet 사용하도록 수정 (#33)
Nico1eKim Jul 10, 2025
ab680d9
[ui]: comment bottom sheet 제작 (#33)
Nico1eKim Jul 10, 2025
99edf48
[refactor]: 답글작성 눌렀을 때 언급창 안뜨는거 수정 (#33)
Nico1eKim Jul 10, 2025
d1d53fb
[ui]: 댓글 누르면 바텀시트 뜨게 하기 (#33)
Nico1eKim Jul 10, 2025
40d9ea1
[fix]: conflict 해결 (#33)
Nico1eKim Jul 10, 2025
144bd28
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim Jul 10, 2025
1f96018
Merge branch 'develop' into ui/#33-group_note_page
rbqks529 Jul 10, 2025
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
.externalNativeBuild
.cxx
local.properties
.idea/deploymentTargetSelector.xml
.idea/deploymentTargetSelector.xml
.idea/misc.xml
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.detectVerticalDragGestures
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand All @@ -23,21 +36,26 @@ import com.texthip.thip.ui.theme.ThipTheme
import com.texthip.thip.ui.theme.ThipTheme.colors
import kotlinx.coroutines.launch

private const val BOTTOM_SHEET_HIDDEN_OFFSET = 300f
private const val BOTTOM_SHEET_VISIBLE_OFFSET = 0f
private const val BOTTOM_SHEET_DISMISS_THRESHOLD = 100f
private const val ANIMATION_DURATION = 300

@Composable
fun CustomBottomSheet(
onDismiss: () -> Unit,
content: @Composable ColumnScope.() -> Unit
) {
val scope = rememberCoroutineScope()
val animatableOffset = remember { Animatable(300f) }
var offsetY by remember { mutableFloatStateOf(0f) }
val animatableOffset = remember { Animatable(BOTTOM_SHEET_HIDDEN_OFFSET) } // 시작 위치 아래
var offsetY by remember { mutableFloatStateOf(BOTTOM_SHEET_VISIBLE_OFFSET) }
var isDismissing by remember { mutableStateOf(false) }

// 등장 애니메이션
LaunchedEffect(Unit) {
animatableOffset.animateTo(
targetValue = 0f,
animationSpec = tween(durationMillis = 300)
targetValue = BOTTOM_SHEET_VISIBLE_OFFSET,
animationSpec = tween(durationMillis = ANIMATION_DURATION)
)
}

Expand All @@ -52,7 +70,10 @@ fun CustomBottomSheet(
if (!isDismissing) {
isDismissing = true
scope.launch {
animatableOffset.animateTo(300f, tween(300))
animatableOffset.animateTo(
BOTTOM_SHEET_HIDDEN_OFFSET,
tween(ANIMATION_DURATION)
)
onDismiss()
}
}
Expand All @@ -79,23 +100,26 @@ fun CustomBottomSheet(
detectVerticalDragGestures(
onVerticalDrag = { _, dragAmount ->
if (dragAmount > 0) {
offsetY += dragAmount / 2
offsetY += dragAmount / 2 // 아래로 드래그할 때만 적용
}
},
onDragEnd = {
if (offsetY > 100f && !isDismissing) {
if (offsetY > BOTTOM_SHEET_DISMISS_THRESHOLD && !isDismissing) {
isDismissing = true
scope.launch {
animatableOffset.animateTo(300f, tween(300))
animatableOffset.animateTo(
BOTTOM_SHEET_HIDDEN_OFFSET,
tween(ANIMATION_DURATION)
)
onDismiss()
}
} else {
offsetY = 0f
offsetY = BOTTOM_SHEET_VISIBLE_OFFSET
}
}
)
}
.clickable(enabled = true) {}
.clickable(enabled = true) {} // 내부 클릭 무시되지 않도록
) {
Column(modifier = Modifier.fillMaxWidth()) {
content()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,153 +1,56 @@
package com.texthip.thip.ui.common.bottomsheet

import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.detectVerticalDragGestures
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import com.texthip.thip.R
import com.texthip.thip.ui.group.room.mock.MenuBottomSheetItem
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography
import kotlinx.coroutines.launch

data class MenuBottomSheetItem(
val text: String,
val color: Color = Color.White,
val onClick: () -> Unit,
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

CustomBottomSheet 으로 기존 것도 수정해주셨네요 확인했습니다!

@Composable
fun MenuBottomSheet(
items: List<MenuBottomSheetItem>,
onDismiss: () -> Unit
) {
val scope = rememberCoroutineScope()
val animatableOffset = remember { Animatable(300f) } // 시작 위치 아래
var offsetY by remember { mutableFloatStateOf(0f) }
var isDismissing by remember { mutableStateOf(false) }

// 등장 애니메이션
LaunchedEffect(Unit) {
animatableOffset.animateTo(
targetValue = 0f,
animationSpec = tween(durationMillis = 300)
)
}

// 바깥 클릭 감지
Box(
modifier = Modifier
.fillMaxSize()
.clickable(
indication = null,
interactionSource = remember { MutableInteractionSource() }
) {
if (!isDismissing) {
isDismissing = true
scope.launch {
animatableOffset.animateTo(300f, tween(300))
onDismiss()
}
}
CustomBottomSheet(
onDismiss = onDismiss,
) {
items.forEachIndexed { index, item ->
if (index > 0) {
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(modifier = Modifier.height(1.dp), color = colors.Grey03)
Spacer(modifier = Modifier.height(8.dp))
}
.zIndex(1f) // 다른 컴포넌트 위에 뜨도록
)


// BottomSheet 본체
Box(
modifier = Modifier
.fillMaxSize()
.zIndex(2f), // 시트가 배경보다 위에 뜨도록
contentAlignment = Alignment.BottomCenter
) {
Box(
modifier = Modifier
.fillMaxWidth()
.offset(y = (offsetY + animatableOffset.value).dp)
.background(
color = colors.DarkGrey,
shape = RoundedCornerShape(topEnd = 12.dp, topStart = 12.dp)
)
.padding(20.dp)
.pointerInput(Unit) {
detectVerticalDragGestures(
onVerticalDrag = { _, dragAmount ->
if (dragAmount > 0) {
offsetY += dragAmount / 2 // 아래로 드래그할 때만 적용
}
},
onDragEnd = {
if (offsetY > 100f && !isDismissing) {
isDismissing = true
scope.launch {
animatableOffset.animateTo(300f, tween(300))
onDismiss()
}
} else {
offsetY = 0f
}
Column(
modifier = Modifier
.height(50.dp)
.padding(horizontal = 12.dp, vertical = 8.dp),
verticalArrangement = Arrangement.Center
) {
Text(
text = item.text,
style = typography.menu_m500_s16_h24,
color = item.color,
modifier = Modifier
.fillMaxWidth()
.clickable {
item.onClick()
onDismiss()
}
)
}
.clickable(enabled = true) {} // 내부 클릭 무시되지 않도록
) {
Column(modifier = Modifier.fillMaxWidth()) {
items.forEachIndexed { index, item ->
if (index > 0) {
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(modifier = Modifier.height(1.dp), color = colors.Grey03)
Spacer(modifier = Modifier.height(8.dp))
}

Column(
modifier = Modifier
.height(50.dp)
.padding(horizontal = 12.dp, vertical = 8.dp),
verticalArrangement = Arrangement.Center
) {
Text(
text = item.text,
style = typography.menu_m500_s16_h24,
color = item.color,
modifier = Modifier
.fillMaxWidth()
.clickable {
item.onClick()
onDismiss()
}
)
}
}
)
}
}
}
Comment on lines +27 to 56
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

CustomBottomSheet 위임은 좋지만 UI/UX 개선이 필요합니다

CustomBottomSheet로 리팩토링한 것은 복잡한 상태 관리를 제거하고 코드를 단순화하는 좋은 접근입니다. 하지만 몇 가지 개선사항이 있습니다:

  1. 클릭 영역 확대: 현재 Text에만 clickable이 적용되어 있어 사용자 경험이 제한적입니다.
  2. 고정 높이 제거: 50.dp 고정 높이는 텍스트 길이에 따라 유연하지 않을 수 있습니다.

다음과 같이 개선하는 것을 제안합니다:

-            Column(
-                modifier = Modifier
-                    .height(50.dp)
-                    .padding(horizontal = 12.dp, vertical = 8.dp),
-                verticalArrangement = Arrangement.Center
-            ) {
-                Text(
-                    text = item.text,
-                    style = typography.menu_m500_s16_h24,
-                    color = item.color,
-                    modifier = Modifier
-                        .fillMaxWidth()
-                        .clickable {
-                            item.onClick()
-                            onDismiss()
-                        }
-                )
-            }
+            Text(
+                text = item.text,
+                style = typography.menu_m500_s16_h24,
+                color = item.color,
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .clickable {
+                        item.onClick()
+                        onDismiss()
+                    }
+                    .padding(horizontal = 12.dp, vertical = 16.dp)
+            )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CustomBottomSheet(
onDismiss = onDismiss,
) {
items.forEachIndexed { index, item ->
if (index > 0) {
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(modifier = Modifier.height(1.dp), color = colors.Grey03)
Spacer(modifier = Modifier.height(8.dp))
}
.zIndex(1f) // 다른 컴포넌트 위에 뜨도록
)
// BottomSheet 본체
Box(
modifier = Modifier
.fillMaxSize()
.zIndex(2f), // 시트가 배경보다 위에 뜨도록
contentAlignment = Alignment.BottomCenter
) {
Box(
modifier = Modifier
.fillMaxWidth()
.offset(y = (offsetY + animatableOffset.value).dp)
.background(
color = colors.DarkGrey,
shape = RoundedCornerShape(topEnd = 12.dp, topStart = 12.dp)
)
.padding(20.dp)
.pointerInput(Unit) {
detectVerticalDragGestures(
onVerticalDrag = { _, dragAmount ->
if (dragAmount > 0) {
offsetY += dragAmount / 2 // 아래로 드래그할 때만 적용
}
},
onDragEnd = {
if (offsetY > 100f && !isDismissing) {
isDismissing = true
scope.launch {
animatableOffset.animateTo(300f, tween(300))
onDismiss()
}
} else {
offsetY = 0f
}
Column(
modifier = Modifier
.height(50.dp)
.padding(horizontal = 12.dp, vertical = 8.dp),
verticalArrangement = Arrangement.Center
) {
Text(
text = item.text,
style = typography.menu_m500_s16_h24,
color = item.color,
modifier = Modifier
.fillMaxWidth()
.clickable {
item.onClick()
onDismiss()
}
)
}
.clickable(enabled = true) {} // 내부 클릭 무시되지 않도록
) {
Column(modifier = Modifier.fillMaxWidth()) {
items.forEachIndexed { index, item ->
if (index > 0) {
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(modifier = Modifier.height(1.dp), color = colors.Grey03)
Spacer(modifier = Modifier.height(8.dp))
}
Column(
modifier = Modifier
.height(50.dp)
.padding(horizontal = 12.dp, vertical = 8.dp),
verticalArrangement = Arrangement.Center
) {
Text(
text = item.text,
style = typography.menu_m500_s16_h24,
color = item.color,
modifier = Modifier
.fillMaxWidth()
.clickable {
item.onClick()
onDismiss()
}
)
}
}
)
}
}
}
CustomBottomSheet(
onDismiss = onDismiss,
) {
items.forEachIndexed { index, item ->
if (index > 0) {
Spacer(modifier = Modifier.height(8.dp))
HorizontalDivider(modifier = Modifier.height(1.dp), color = colors.Grey03)
Spacer(modifier = Modifier.height(8.dp))
}
Text(
text = item.text,
style = typography.menu_m500_s16_h24,
color = item.color,
modifier = Modifier
.fillMaxWidth()
.clickable {
item.onClick()
onDismiss()
}
.padding(horizontal = 12.dp, vertical = 16.dp)
)
}
}
🤖 Prompt for AI Agents
In app/src/main/java/com/texthip/thip/ui/common/bottomsheet/MenuBottomSheet.kt
between lines 27 and 56, improve the UI/UX by expanding the clickable area from
just the Text to the entire Column to make it easier for users to tap. Also,
remove the fixed height of 50.dp on the Column to allow the height to adjust
dynamically based on the text content. Apply the clickable modifier to the
Column and eliminate the height modifier to achieve these improvements.

Expand Down
Loading