-
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.
Browse files
Browse the repository at this point in the history
#223 : 하단 버튼이 붙어 있는 페이지 리팩토링해요
- Loading branch information
Showing
14 changed files
with
493 additions
and
509 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
core/ui/src/main/kotlin/com/bff/wespot/ui/component/BottomButtonLayout.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,38 @@ | ||
package com.bff.wespot.ui.component | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.SubcomposeLayout | ||
|
||
@Composable | ||
fun BottomButtonLayout( | ||
modifier: Modifier = Modifier, | ||
showGradient: Boolean = false, | ||
button: @Composable () -> Unit, | ||
content: @Composable () -> Unit, | ||
) { | ||
SubcomposeLayout(modifier) { constraints -> | ||
val gradientPlaceable = subcompose("gradient") { | ||
ListBottomGradient(124) | ||
}.first().measure(constraints) | ||
|
||
val buttonPlaceable = subcompose("button") { | ||
button() | ||
}.first().measure(constraints) | ||
|
||
val contentMaxHeight = constraints.maxHeight - buttonPlaceable.height | ||
val contentPlaceable = subcompose("content") { | ||
content() | ||
}.first().measure(constraints.copy(maxHeight = contentMaxHeight)) | ||
|
||
layout(constraints.maxWidth, constraints.maxHeight) { | ||
contentPlaceable.placeRelative(0, 0) | ||
|
||
if (showGradient) { | ||
gradientPlaceable.placeRelative(0, constraints.maxHeight - gradientPlaceable.height) | ||
} | ||
|
||
buttonPlaceable.placeRelative(0, contentMaxHeight) | ||
} | ||
} | ||
} |
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.