-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from YAPP-Github/feature/sksowk156/PC-217
[PC-217] 매칭 상세 value pick ui 구현
- Loading branch information
Showing
13 changed files
with
491 additions
and
129 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
core/common-ui/src/main/java/com/puzzle/common/ui/CollapsingHeaderNestedScrollConnection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.puzzle.common.ui | ||
|
||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableIntStateOf | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.geometry.Offset | ||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection | ||
import androidx.compose.ui.input.nestedscroll.NestedScrollSource | ||
|
||
class CollapsingHeaderNestedScrollConnection( | ||
val headerHeight: Int | ||
) : NestedScrollConnection { | ||
|
||
// 헤더 offset(픽셀 단위), 0이면 펼침, -headerHeight이면 완전 접힘 | ||
var headerOffset: Int by mutableIntStateOf(0) | ||
private set | ||
|
||
// 스크롤 이벤트가 오기 전, 먼저 얼마나 소모할지 계산 | ||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset { | ||
// y축 델타(수직 스크롤 양) | ||
val delta = available.y.toInt() | ||
|
||
// 새 offset = 기존 offset + 스크롤 델타 | ||
val newOffset = headerOffset + delta | ||
val previousOffset = headerOffset | ||
|
||
// -headerHeight ~ 0 사이로 제한 | ||
// -> 최소 -105: 완전히 접힘, 최대 0: 완전히 펼침 | ||
headerOffset = newOffset.coerceIn(-headerHeight, 0) | ||
|
||
// 소비(consumed)된 스크롤 양 = (바뀐 offset - 기존 offset) | ||
val consumed = headerOffset - previousOffset | ||
|
||
// x축은 소비 안 함(0f), y축은 consumed만큼 소비했다고 반환 | ||
return Offset(0f, consumed.toFloat()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,4 +209,4 @@ fun PreviewPieceSubCloseTopBar() { | |
.padding(vertical = 20.dp), | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
core/designsystem/src/main/res/drawable/ic_profile_image.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="52dp" | ||
android:height="52dp" | ||
android:viewportWidth="52" | ||
android:viewportHeight="52"> | ||
<group> | ||
<clip-path android:pathData="M0,0h52v52h-52z" /> | ||
<path | ||
android:pathData="M26,26m-25.409,0a25.409,25.409 0,1 1,50.818 0a25.409,25.409 0,1 1,-50.818 0" | ||
android:strokeWidth="1.18182" | ||
android:fillColor="#ffffff" | ||
android:strokeColor="#6F00FB" /> | ||
<path | ||
android:pathData="M16,26.5V26.5C21.486,27.791 26.331,30.997 29.664,35.542L30,36" | ||
android:strokeWidth="1.6" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#6F00FB" /> | ||
<path | ||
android:pathData="M36,26L35.103,26.141C31.332,26.736 27.819,28.425 25,31V31" | ||
android:strokeWidth="1.6" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#6F00FB" /> | ||
<path | ||
android:pathData="M17,16L35,16A1,1 0,0 1,36 17L36,35A1,1 0,0 1,35 36L17,36A1,1 0,0 1,16 35L16,17A1,1 0,0 1,17 16z" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="1.6" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#6F00FB" /> | ||
<path | ||
android:pathData="M31,23C32.105,23 33,22.105 33,21C33,19.895 32.105,19 31,19C29.895,19 29,19.895 29,21C29,22.105 29.895,23 31,23Z" | ||
android:strokeWidth="1.6" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#6F00FB" /> | ||
</group> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M9.732,9.732m-6.545,0a6.545,6.545 0,1 1,13.089 0a6.545,6.545 0,1 1,-13.089 0" | ||
android:strokeWidth="2.37572" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#6F00FB" /> | ||
<path | ||
android:pathData="M15.63,14.112L17.16,15.642A1.188,1.188 90,0 1,17.16 17.322L17.16,17.322A1.188,1.188 90,0 1,15.48 17.322L13.951,15.792A1.188,1.188 0,0 1,13.951 14.112L13.951,14.112A1.188,1.188 90,0 1,15.63 14.112z" | ||
android:fillColor="#6F00FB" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.