-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Balloon 컴포넌트 구현 #28
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
31ba7f0
[feat] #26 icon svg 추가
beom84 6752c53
[feat] #26 ballonContainer 구현
beom84 92ae4bb
[feat] #26 top , bottom balloon 구현
beom84 deb4167
Merge branch 'develop' into feat/component-balloon
beom84 a51cc6b
[feat] #26 shadow 적용, shadow 확장함수 추가
beom84 549d20e
[feat] #26 BottomTailBalloon 수정
beom84 8989833
[fix] #29 preview 수정
beom84 03f48f4
[fix] #29 ic 네임 수정
beom84 538491e
[fix] #26 balloonContainer 기기대응
beom84 32a1708
Merge branch 'develop' into feat/component-balloon
beom84 c057d46
[fix] #28 applyShadows 함수 가독성향상
beom84 1275760
[fix] #28 ktlint 적용
beom84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
app/src/main/java/org/android/bbangzip/presentation/component/balloon/BalloonContainer.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,49 @@ | ||
package org.android.bbangzip.presentation.component.balloon | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import org.android.bbangzip.presentation.type.BbangZipShadowType | ||
import org.android.bbangzip.presentation.util.modifier.applyShadows | ||
import org.android.bbangzip.ui.theme.BbangZipTheme | ||
|
||
@Composable | ||
fun BalloonContainer( | ||
text: String, | ||
leadingIcon: @Composable () -> Unit = {}, | ||
trailingIcon: @Composable () -> Unit = {}, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Box( | ||
modifier = | ||
modifier | ||
.applyShadows(BbangZipShadowType.STRONG, shape = RoundedCornerShape(size = 20.dp)) | ||
.fillMaxWidth() | ||
.background( | ||
color = BbangZipTheme.colors.staticWhite_FFFFFF, | ||
shape = RoundedCornerShape(size = 20.dp), | ||
) | ||
.padding(horizontal = 16.dp, vertical = 8.dp), | ||
contentAlignment = Alignment.Center, | ||
) { | ||
Row { | ||
leadingIcon() | ||
|
||
Text( | ||
text = text, | ||
style = BbangZipTheme.typography.body1Bold, | ||
color = BbangZipTheme.colors.labelNormal_282119, | ||
) | ||
|
||
trailingIcon() | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
app/src/main/java/org/android/bbangzip/presentation/component/balloon/BottomTailBalloon.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,68 @@ | ||
package org.android.bbangzip.presentation.component.balloon | ||
|
||
import androidx.compose.foundation.background | ||
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.padding | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import org.android.bbangzip.R | ||
import org.android.bbangzip.ui.theme.BbangZipTheme | ||
import org.android.bbangzip.ui.theme.defaultBbangZipColors | ||
|
||
@Composable | ||
fun BottomTailBalloon( | ||
text: String, | ||
leadingIcon: @Composable () -> Unit = {}, | ||
trailingIcon: @Composable () -> Unit = {}, | ||
horizontalPadding: Dp = 0.dp, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = | ||
modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = horizontalPadding), | ||
) { | ||
BalloonContainer( | ||
leadingIcon = leadingIcon, | ||
text = text, | ||
trailingIcon = trailingIcon, | ||
) | ||
|
||
Icon( | ||
imageVector = ImageVector.vectorResource(R.drawable.ic_balloon_tail_down_8), | ||
contentDescription = null, | ||
modifier = Modifier.padding(start = 24.dp), | ||
tint = BbangZipTheme.colors.staticWhite_FFFFFF, | ||
) | ||
} | ||
} | ||
beom84 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun TopBalloonPreview() { | ||
Column( | ||
Modifier | ||
.fillMaxSize() | ||
.background(color = defaultBbangZipColors.backgroundAccent_FFDAA0), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
Spacer(modifier = Modifier.height(10.dp)) | ||
|
||
BottomTailBalloon( | ||
text = "사장님의 과제 빵점 탈출을 위해서", | ||
horizontalPadding = 16.dp, | ||
) | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
app/src/main/java/org/android/bbangzip/presentation/component/balloon/TopTailBalloon.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,68 @@ | ||
package org.android.bbangzip.presentation.component.balloon | ||
|
||
import androidx.compose.foundation.background | ||
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.padding | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import org.android.bbangzip.R | ||
import org.android.bbangzip.ui.theme.BbangZipTheme | ||
import org.android.bbangzip.ui.theme.defaultBbangZipColors | ||
|
||
@Composable | ||
fun TopTailBalloon( | ||
text: String, | ||
leadingIcon: @Composable () -> Unit = {}, | ||
trailingIcon: @Composable () -> Unit = {}, | ||
horizontalPadding: Dp = 0.dp, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = | ||
modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = horizontalPadding), | ||
) { | ||
Icon( | ||
imageVector = ImageVector.vectorResource(R.drawable.ic_balloon_tail_up_8), | ||
contentDescription = null, | ||
modifier = Modifier.padding(start = 24.dp), | ||
tint = BbangZipTheme.colors.staticWhite_FFFFFF, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
BalloonContainer( | ||
leadingIcon = leadingIcon, | ||
text = text, | ||
trailingIcon = trailingIcon, | ||
) | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun TopBalloonPreview() { | ||
Column( | ||
Modifier | ||
.fillMaxSize() | ||
.background(color = defaultBbangZipColors.backgroundAccent_FFDAA0), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
Spacer(modifier = Modifier.height(10.dp)) | ||
|
||
TopTailBalloon( | ||
text = "사장님의 과제 빵점 탈출을 위해서", | ||
horizontalPadding = 16.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
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="8dp" | ||
android:height="7dp" | ||
android:viewportWidth="8" | ||
android:viewportHeight="7"> | ||
<path | ||
android:pathData="M5.1618,7C2.1099,4.5808 0.7823,1.3253 0.5,0H7.5C6.0843,2.1154 5.367,5.1297 5.1618,7Z" | ||
android:fillColor="#ffffff"/> | ||
</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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="8dp" | ||
android:height="7dp" | ||
android:viewportWidth="8" | ||
android:viewportHeight="7"> | ||
<path | ||
android:pathData="M5.1618,0C2.1099,2.4192 0.7823,5.6747 0.5,7H7.5C6.0843,4.8846 5.367,1.8703 5.1618,0Z" | ||
android:fillColor="#ffffff"/> | ||
</vector> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p2
여기는 기기대응 고려해서 수정해야 할 것 같아요! 말풍선 너비 계산해서..Modifier.onSizeChanged
이용하는 방안에 대해서 고민해보세요