-
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 branch 'develop' into feature/MZ-138-sent-search
# Conflicts: # feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt # feature/sent/src/main/java/com/susu/feature/sent/SentScreen.kt # feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt # feature/sent/src/main/res/values/strings.xml
- Loading branch information
Showing
148 changed files
with
4,363 additions
and
889 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
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
98 changes: 98 additions & 0 deletions
98
...signsystem/src/main/java/com/susu/core/designsystem/component/text/AnimatedCounterText.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,98 @@ | ||
package com.susu.core.designsystem.component.text | ||
|
||
import androidx.compose.animation.AnimatedContent | ||
import androidx.compose.animation.slideInVertically | ||
import androidx.compose.animation.slideOutVertically | ||
import androidx.compose.animation.togetherWith | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.susu.core.designsystem.theme.Gray100 | ||
import com.susu.core.designsystem.theme.SusuTheme | ||
import java.text.DecimalFormat | ||
|
||
private val upward = slideInVertically { it } togetherWith slideOutVertically { -it } | ||
private val downward = slideInVertically { -it } togetherWith slideOutVertically { it } | ||
|
||
@Composable | ||
fun AnimatedCounterText( | ||
number: Int, | ||
modifier: Modifier = Modifier, | ||
prefix: String? = null, | ||
postfix: String? = null, | ||
style: TextStyle = SusuTheme.typography.title_xs, | ||
color: Color = Gray100, | ||
) { | ||
val moneyFormat = remember { DecimalFormat("#,###") } | ||
val currentString = moneyFormat.format(number) | ||
|
||
Row( | ||
modifier = modifier, | ||
horizontalArrangement = Arrangement.End, | ||
) { | ||
prefix?.let { | ||
Text( | ||
text = it, | ||
style = style, | ||
color = color, | ||
) | ||
} | ||
for (i in currentString.indices) { | ||
val char = currentString[i] | ||
|
||
AnimatedContent( | ||
targetState = char, | ||
transitionSpec = { | ||
when { | ||
initialState.isDigit() && targetState.isDigit() && | ||
initialState.digitToInt() < targetState.digitToInt() -> upward | ||
|
||
initialState.isDigit() && targetState.isDigit() && | ||
initialState.digitToInt() > targetState.digitToInt() -> downward | ||
|
||
else -> upward | ||
} | ||
}, | ||
label = "animatedCounterChar$i", | ||
) { | ||
Text( | ||
text = it.toString(), | ||
style = style, | ||
color = color, | ||
) | ||
} | ||
} | ||
postfix?.let { | ||
Text( | ||
text = it, | ||
style = style, | ||
color = color, | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun AnimatedCounterTextPreview() { | ||
SusuTheme { | ||
var number by remember { mutableStateOf(10000) } | ||
Column { | ||
Button(onClick = { number += 6000 }) { | ||
Text(text = "증가") | ||
} | ||
AnimatedCounterText(number = number) | ||
} | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
core/model/src/main/java/com/susu/core/model/EnvelopeDetail.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,14 @@ | ||
package com.susu.core.model | ||
|
||
import androidx.compose.runtime.Stable | ||
import kotlinx.serialization.Serializable | ||
|
||
@Stable | ||
@Serializable | ||
data class EnvelopeDetail( | ||
val envelope: Envelope = Envelope(), | ||
val category: Category = Category(), | ||
val relationship: Relationship = Relationship(), | ||
val friendRelationship: FriendRelationship = FriendRelationship(), | ||
val friend: Friend = Friend(), | ||
) |
8 changes: 8 additions & 0 deletions
8
core/model/src/main/java/com/susu/core/model/EnvelopeSearch.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,8 @@ | ||
package com.susu.core.model | ||
|
||
data class EnvelopeSearch( | ||
val envelope: Envelope, | ||
val category: Category? = null, | ||
val friend: Friend? = null, | ||
val relationship: Relationship? = null, | ||
) |
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
12 changes: 12 additions & 0 deletions
12
core/model/src/main/java/com/susu/core/model/FriendRelationship.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,12 @@ | ||
package com.susu.core.model | ||
|
||
import androidx.compose.runtime.Stable | ||
import kotlinx.serialization.Serializable | ||
|
||
@Stable | ||
@Serializable | ||
data class FriendRelationship( | ||
val id: Long = 0, | ||
val friendId: Long = 0, | ||
val relationshipId: Long = 0, | ||
) |
2 changes: 1 addition & 1 deletion
2
...va/com/susu/core/model/EnvelopeStatics.kt → ...a/com/susu/core/model/FriendStatistics.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
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
16 changes: 16 additions & 0 deletions
16
core/model/src/main/java/com/susu/core/model/SusuStatistics.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,16 @@ | ||
package com.susu.core.model | ||
|
||
import androidx.compose.runtime.Stable | ||
|
||
@Stable | ||
data class SusuStatistics( | ||
val averageSent: Int = 0, | ||
val averageRelationship: StatisticsElement = StatisticsElement(), | ||
val averageCategory: StatisticsElement = StatisticsElement(), | ||
val recentSpent: List<StatisticsElement> = emptyList(), | ||
val recentTotalSpent: Int = 0, | ||
val recentMaximumSpent: Int = 0, | ||
val mostSpentMonth: Int = 0, | ||
val mostRelationship: StatisticsElement = StatisticsElement(), | ||
val mostCategory: StatisticsElement = StatisticsElement(), | ||
) |
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.