-
Notifications
You must be signed in to change notification settings - Fork 1
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 #57 from YAPP-Github/feature/MZ-176-ledger-filter
Feature/mz 176 ledger filter
- Loading branch information
Showing
18 changed files
with
334 additions
and
6 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
core/designsystem/src/main/java/com/susu/core/designsystem/component/button/RefreshButton.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,47 @@ | ||
package com.susu.core.designsystem.component.button | ||
|
||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
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 | ||
import com.susu.core.designsystem.theme.Gray30 | ||
import com.susu.core.designsystem.theme.SusuTheme | ||
import com.susu.core.ui.extension.susuClickable | ||
|
||
@Composable | ||
fun RefreshButton( | ||
modifier: Modifier = Modifier, | ||
onClick: () -> Unit = {}, | ||
) { | ||
Icon( | ||
modifier = modifier | ||
.border( | ||
width = 1.dp, | ||
color = Gray30, | ||
shape = RoundedCornerShape(size = 100.dp), | ||
) | ||
.size(44.dp) | ||
.clip(RoundedCornerShape(size = 100.dp)) | ||
.susuClickable(onClick = onClick) | ||
.padding(SusuTheme.spacing.spacing_xs), | ||
painter = painterResource(id = R.drawable.ic_refresh), | ||
contentDescription = stringResource(R.string.content_description_refresh), | ||
) | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun RefreshButtonPreview() { | ||
SusuTheme { | ||
RefreshButton() | ||
} | ||
} |
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
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="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M12,20C9.767,20 7.875,19.225 6.325,17.675C4.775,16.125 4,14.233 4,12C4,9.767 4.775,7.875 6.325,6.325C7.875,4.775 9.767,4 12,4C13.15,4 14.25,4.237 15.3,4.712C16.35,5.187 17.25,5.866 18,6.75V5C18,4.717 18.096,4.479 18.288,4.288C18.48,4.097 18.717,4.001 19,4C19.283,4 19.521,4.096 19.713,4.288C19.905,4.48 20.001,4.717 20,5V10C20,10.283 19.904,10.521 19.712,10.713C19.52,10.905 19.283,11.001 19,11H14C13.717,11 13.479,10.904 13.288,10.712C13.097,10.52 13.001,10.283 13,10C13,9.717 13.096,9.479 13.288,9.288C13.48,9.097 13.717,9.001 14,9H17.2C16.667,8.067 15.938,7.333 15.013,6.8C14.088,6.267 13.084,6 12,6C10.333,6 8.917,6.583 7.75,7.75C6.583,8.917 6,10.333 6,12C6,13.667 6.583,15.083 7.75,16.25C8.917,17.417 10.333,18 12,18C13.133,18 14.171,17.713 15.113,17.138C16.055,16.563 16.784,15.792 17.3,14.825C17.433,14.592 17.621,14.429 17.863,14.338C18.105,14.247 18.351,14.242 18.6,14.325C18.867,14.408 19.058,14.583 19.175,14.85C19.292,15.117 19.283,15.367 19.15,15.6C18.467,16.933 17.492,18 16.225,18.8C14.958,19.6 13.55,20 12,20Z" | ||
android:fillColor="#000000"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.susu.core.ui.util | ||
|
||
import java.time.LocalDateTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
val currentDate = LocalDateTime.now() | ||
|
||
@Suppress("detekt:FunctionNaming") | ||
fun LocalDateTime.to_yyyy_dot_MM_dot_dd(): String { | ||
val formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd") | ||
return this.format(formatter) | ||
} |
File renamed without changes.
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
185 changes: 185 additions & 0 deletions
185
feature/received/src/main/java/com/susu/feature/received/ledgerfilter/LedgerFilterScreen.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,185 @@ | ||
package com.susu.feature.received.ledgerfilter | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
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.component.appbar.SusuDefaultAppBar | ||
import com.susu.core.designsystem.component.appbar.icon.BackIcon | ||
import com.susu.core.designsystem.component.button.FilledButtonColor | ||
import com.susu.core.designsystem.component.button.LinedButtonColor | ||
import com.susu.core.designsystem.component.button.RefreshButton | ||
import com.susu.core.designsystem.component.button.SmallButtonStyle | ||
import com.susu.core.designsystem.component.button.SusuFilledButton | ||
import com.susu.core.designsystem.component.button.SusuLinedButton | ||
import com.susu.core.designsystem.component.button.XSmallButtonStyle | ||
import com.susu.core.designsystem.theme.Gray10 | ||
import com.susu.core.designsystem.theme.SusuTheme | ||
import com.susu.core.ui.extension.susuClickable | ||
import com.susu.feature.received.R | ||
import com.susu.feature.received.ledgerfilter.component.DateText | ||
|
||
@Composable | ||
fun LedgerFilterRoute( | ||
@Suppress("unused") | ||
popBackStack: () -> Unit, | ||
) { | ||
LedgerFilterScreen( | ||
onClickBackIcon = popBackStack, | ||
) | ||
} | ||
|
||
@Composable | ||
fun LedgerFilterScreen( | ||
onClickBackIcon: () -> Unit = {}, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.background(SusuTheme.colorScheme.background10) | ||
.fillMaxSize(), | ||
) { | ||
SusuDefaultAppBar( | ||
leftIcon = { | ||
BackIcon(onClickBackIcon) | ||
}, | ||
title = stringResource(id = com.susu.core.ui.R.string.word_filter), | ||
) | ||
|
||
Column( | ||
modifier = Modifier.padding( | ||
top = SusuTheme.spacing.spacing_xl, | ||
start = SusuTheme.spacing.spacing_m, | ||
end = SusuTheme.spacing.spacing_m, | ||
bottom = SusuTheme.spacing.spacing_xxs, | ||
), | ||
) { | ||
Text(text = stringResource(R.string.ledger_filter_screen_event_category), style = SusuTheme.typography.title_xs) | ||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_m)) | ||
Row( | ||
horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), | ||
) { | ||
SusuLinedButton( | ||
color = LinedButtonColor.Black, | ||
style = XSmallButtonStyle.height28, | ||
isActive = false, | ||
text = "결혼식", | ||
) | ||
|
||
SusuLinedButton( | ||
color = LinedButtonColor.Black, | ||
style = XSmallButtonStyle.height28, | ||
isActive = false, | ||
text = "돌잔치", | ||
) | ||
|
||
SusuLinedButton( | ||
color = LinedButtonColor.Black, | ||
style = XSmallButtonStyle.height28, | ||
isActive = false, | ||
text = "장례식", | ||
) | ||
|
||
SusuLinedButton( | ||
color = LinedButtonColor.Black, | ||
style = XSmallButtonStyle.height28, | ||
isActive = true, | ||
text = "생일 기념일", | ||
) | ||
} | ||
|
||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_xxxxxxl)) | ||
Text( | ||
text = stringResource(id = com.susu.core.ui.R.string.word_date), | ||
style = SusuTheme.typography.title_xs, | ||
) | ||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_m)) | ||
|
||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
DateText() | ||
|
||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_xxxxs)) | ||
|
||
Text( | ||
text = stringResource(R.string.ledger_filter_screen_from), | ||
style = SusuTheme.typography.title_xxs, | ||
) | ||
|
||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_m)) | ||
|
||
DateText() | ||
|
||
Spacer(modifier = Modifier.size(SusuTheme.spacing.spacing_xxxxs)) | ||
|
||
Text( | ||
text = stringResource(R.string.ledger_filter_screen_until), | ||
style = SusuTheme.typography.title_xxs, | ||
) | ||
} | ||
|
||
Spacer(modifier = Modifier.weight(1f)) | ||
|
||
Column( | ||
verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), | ||
) { | ||
SusuFilledButton( | ||
color = FilledButtonColor.Orange, | ||
style = XSmallButtonStyle.height28, | ||
text = "결혼식", | ||
isClickable = false, | ||
rightIcon = { | ||
Icon( | ||
modifier = Modifier | ||
.clip(CircleShape) | ||
.size(12.dp) | ||
.susuClickable { /* TODO */ }, | ||
painter = painterResource(id = com.susu.core.ui.R.drawable.ic_close), | ||
contentDescription = stringResource(id = com.susu.core.ui.R.string.content_description_close_icon), | ||
tint = Gray10, | ||
) | ||
}, | ||
) | ||
|
||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_m), | ||
) { | ||
RefreshButton() | ||
|
||
SusuFilledButton( | ||
modifier = Modifier.fillMaxWidth(), | ||
color = FilledButtonColor.Black, | ||
style = SmallButtonStyle.height48, | ||
isActive = true, | ||
text = stringResource(com.susu.core.ui.R.string.word_apply_filter), | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun LedgerFilterScreenPreview() { | ||
SusuTheme { | ||
LedgerFilterScreen() | ||
} | ||
} |
Oops, something went wrong.