Skip to content

Commit 58029c8

Browse files
author
eshc123
committed
feat: 미션보드화면 스크롤 시 하단 뷰 히든처리
1 parent acf19bf commit 58029c8

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

feature/board/src/main/java/com/goalpanzi/mission_mate/feature/board/component/Board.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import kotlin.math.min
6363
fun Board(
6464
scrollState: ScrollState,
6565
pullRefreshState: PullRefreshState,
66-
isRefreshLoading : Boolean,
66+
isRefreshLoading: Boolean,
6767
missionBoards: MissionBoardsUiModel,
6868
missionDetail: MissionDetail,
6969
numberOfColumns: Int,
@@ -81,7 +81,7 @@ fun Board(
8181
val statusBarHeight =
8282
remember(statusBarPaddingValue) { statusBarPaddingValue }
8383
val bottomViewHeight = remember(navigationPaddingValue) {
84-
142.dp + navigationPaddingValue
84+
120.dp + navigationPaddingValue
8585
}
8686
val navigationBarHeight =
8787
remember(navigationPaddingValue) {
@@ -102,7 +102,7 @@ fun Board(
102102
LaunchedEffect(myIndex) {
103103
scrollState.animateScrollTo(
104104
getPositionScrollToMyIndex(
105-
myIndex = if(myIndex in 3 .. 5) myIndex - 3 else myIndex,
105+
myIndex = if (myIndex in 3..5) myIndex - 3 else myIndex,
106106
numberOfColumns = numberOfColumns,
107107
blockSize = (configuration.screenWidthDp - 48) / numberOfColumns,
108108
localDensity = localDensity
@@ -151,10 +151,10 @@ fun Board(
151151
.drawWithContent {
152152
clipRect(
153153
top = statusBarHeight.toPx() + 178.dp.toPx() - 1,
154-
bottom = if (!isVisiblePieces) {
154+
bottom = if (!isVisiblePieces || scrollState.isScrollInProgress) {
155155
size.height
156156
} else {
157-
size.height + navigationBarHeight.toPx() - bottomViewHeight.toPx() + 1.dp.toPx()
157+
size.height + navigationBarHeight.toPx() - bottomViewHeight.toPx()
158158
}
159159
) {
160160
this@drawWithContent.drawContent()
@@ -187,7 +187,8 @@ fun Board(
187187
isVisiblePieces = isVisiblePieces,
188188
innerModifier = Modifier
189189
.drawWithContent {
190-
clipRect(top = (size.height + navigationBarHeight.toPx() - bottomViewHeight.toPx() + 1.dp.toPx())) {
190+
clipRect(top = if (scrollState.isScrollInProgress ) size.height
191+
else (size.height + navigationBarHeight.toPx() - bottomViewHeight.toPx())) {
191192
this@drawWithContent.drawContent()
192193
}
193194
}
@@ -213,7 +214,10 @@ fun Board(
213214
PullRefreshIndicator(
214215
refreshing = isRefreshLoading,
215216
state = pullRefreshState,
216-
modifier = Modifier.align(TopCenter).statusBarsPadding().padding(top = 178.dp)
217+
modifier = Modifier
218+
.align(TopCenter)
219+
.statusBarsPadding()
220+
.padding(top = 178.dp)
217221
)
218222
}
219223
}
@@ -291,7 +295,7 @@ fun ColumnScope.BoardContent(
291295
}
292296
if (isVisiblePieces) {
293297
boardPieces.forEach { piece ->
294-
key(piece.memberId,piece.needToDraw) {
298+
key(piece.memberId, piece.needToDraw) {
295299
Piece(
296300
boardPiece = piece,
297301
sizePerBlock = width / numberOfColumns,

feature/board/src/main/java/com/goalpanzi/mission_mate/feature/board/screen/BoardScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ fun BoardScreen(
335335
)
336336
}
337337

338-
} else {
338+
} else if(!scrollState.isScrollInProgress || !scrollState.canScrollForward) {
339339
BoardBottomView(
340340
modifier = Modifier.align(Alignment.BottomCenter),
341341
missionState = missionState,

0 commit comments

Comments
 (0)