Skip to content
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

Feature/mz 201 vote list UI #92

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.susu.core.ui.extension.susuClickable
fun BasicButton(
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
textModifier: Modifier = Modifier,
text: String? = null,
textStyle: TextStyle = TextStyle.Default,
contentColor: Color = Color.Unspecified,
Expand Down Expand Up @@ -72,6 +73,7 @@ fun BasicButton(

text?.let {
Text(
modifier = textModifier,
text = it,
style = textStyle,
color = contentColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -49,6 +50,8 @@ enum class FilledButtonColor(
fun SusuFilledButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: FilledButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -63,8 +66,9 @@ fun SusuFilledButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
contentColor = if (isActive) activeContentColor else inactiveContentColor,
rippleColor = rippleColor,
backgroundColor = if (isActive) activeBackgroundColor else inactiveBackgroundColor,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.susu.core.designsystem.component.button

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -12,6 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand All @@ -23,6 +25,7 @@ import com.susu.core.ui.extension.susuClickable
@Composable
fun SusuFloatingButton(
modifier: Modifier = Modifier,
@DrawableRes imageResId: Int = R.drawable.ic_floating_button_add,
onClick: () -> Unit = {},
) {
Box(
Expand All @@ -34,7 +37,10 @@ fun SusuFloatingButton(
.susuClickable(rippleColor = Gray10, onClick = onClick),
contentAlignment = Alignment.Center,
) {
Image(painter = painterResource(id = R.drawable.ic_floating_button_add), contentDescription = "μΆ”κ°€ μ•„μ΄μ½˜")
Image(
painter = painterResource(id = imageResId),
contentDescription = stringResource(id = com.susu.core.ui.R.string.content_description_add_button),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -49,6 +50,8 @@ enum class GhostButtonColor(
fun SusuGhostButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: GhostButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -64,8 +67,9 @@ fun SusuGhostButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
contentColor = if (isActive) activeContentColor else inactiveContentColor,
rippleColor = rippleColor,
backgroundColor = if (isActive) activeBackgroundColor else inactiveBackgroundColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -56,6 +57,8 @@ enum class LinedButtonColor(
fun SusuLinedButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: LinedButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -70,8 +73,9 @@ fun SusuLinedButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
borderWidth = 1.dp,
borderColor = if (isActive) activeBorderColor else inactiveBorderColor,
contentColor = if (isActive) activeContentColor else inactiveContentColor,
Expand Down
1 change: 1 addition & 0 deletions core/ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
<string name="word_memo">λ©”λͺ¨</string>
<string name="word_register">등둝</string>
<string name="word_free">자유</string>
<string name="content_description_report_button">μ‹ κ³  λ²„νŠΌ</string>
</resources>

This file was deleted.

Loading
Loading