-
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
[Feature/#5] : 그룹 상세 페이지 구현
- Loading branch information
Showing
35 changed files
with
1,824 additions
and
5 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
.../src/main/java/com/sopt/core/designsystem/component/button/NoostakFloatingActionButton.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.sopt.core.designsystem.component.button | ||
|
||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.ExtendedFloatingActionButton | ||
import androidx.compose.material3.FloatingActionButtonDefaults | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.dimensionResource | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.R | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
import com.sopt.core.util.NoRippleInteractionSource | ||
|
||
@Composable | ||
fun NoostakFloatingActionButton( | ||
title: String, | ||
modifier: Modifier = Modifier, | ||
onClick: () -> Unit | ||
) { | ||
ExtendedFloatingActionButton( | ||
modifier = modifier, | ||
shape = RoundedCornerShape(dimensionResource(id = R.dimen.fab_radius)), | ||
containerColor = NoostakTheme.colors.black, | ||
contentColor = NoostakTheme.colors.white, | ||
elevation = FloatingActionButtonDefaults.elevation(4.dp), | ||
onClick = { onClick() }, | ||
interactionSource = NoRippleInteractionSource | ||
) { | ||
Icon( | ||
imageVector = ImageVector.vectorResource(id = R.drawable.ic_add), | ||
contentDescription = null, | ||
tint = NoostakTheme.colors.white | ||
) | ||
Spacer(modifier = Modifier.width(5.dp)) | ||
Text( | ||
text = title, | ||
color = NoostakTheme.colors.white, | ||
style = NoostakTheme.typography.b4SemiBold1 | ||
) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
core/src/main/java/com/sopt/core/designsystem/component/chip/NoostakCategoryChip.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,24 @@ | ||
package com.sopt.core.designsystem.component.chip | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.dimensionResource | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.R | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
|
||
@Composable | ||
fun NoostakCategoryChip( | ||
text: String, | ||
backgroundColor: Color | ||
) { | ||
NoostakChip( | ||
text = text, | ||
textStyle = NoostakTheme.typography.c2SemiBold, | ||
textColor = NoostakTheme.colors.white, | ||
backgroundColor = backgroundColor, | ||
borderColor = Color.Transparent, | ||
horizontalPaddingValues = dimensionResource(id = R.dimen.category_chip_horizontal_padding), | ||
verticalPaddingValues = dimensionResource(id = R.dimen.category_chip_vertical_padding) | ||
) | ||
} |
78 changes: 78 additions & 0 deletions
78
core/src/main/java/com/sopt/core/designsystem/component/chip/NoostakChip.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,78 @@ | ||
package com.sopt.core.designsystem.component.chip | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.defaultMinSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
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.graphics.Color | ||
import androidx.compose.ui.res.dimensionResource | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.R | ||
import com.sopt.core.designsystem.theme.NoostakAndroidTheme | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
|
||
@Composable | ||
fun NoostakChip( | ||
text: String, | ||
textStyle: TextStyle, | ||
textColor: Color, | ||
backgroundColor: Color, | ||
borderColor: Color, | ||
horizontalPaddingValues: Dp, | ||
verticalPaddingValues: Dp | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.background( | ||
color = backgroundColor, | ||
shape = RoundedCornerShape(dimensionResource(id = R.dimen.chip_radius)) | ||
) | ||
.border( | ||
width = 1.dp, | ||
color = borderColor, | ||
shape = RoundedCornerShape(dimensionResource(id = R.dimen.chip_radius)) | ||
) | ||
.defaultMinSize(minWidth = 39.dp) | ||
.padding(horizontal = horizontalPaddingValues, vertical = verticalPaddingValues) | ||
) { | ||
Text( | ||
modifier = Modifier | ||
.align(Alignment.Center) | ||
.wrapContentSize(), | ||
text = text, | ||
style = textStyle, | ||
color = textColor, | ||
textAlign = TextAlign.Center, | ||
overflow = TextOverflow.Ellipsis, | ||
maxLines = 1 | ||
) | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun NoostakChipPreview() { | ||
NoostakAndroidTheme { | ||
NoostakChip( | ||
text = "나", | ||
textStyle = NoostakTheme.typography.c3Regular, | ||
textColor = NoostakTheme.colors.gray900, | ||
backgroundColor = NoostakTheme.colors.blue200, | ||
borderColor = NoostakTheme.colors.blue200, | ||
horizontalPaddingValues = 8.dp, | ||
verticalPaddingValues = 6.dp | ||
) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
core/src/main/java/com/sopt/core/designsystem/component/chip/NoostakUserChip.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,26 @@ | ||
package com.sopt.core.designsystem.component.chip | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.dimensionResource | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.R | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
|
||
@Composable | ||
fun NoostakUserChip( | ||
text: String, | ||
textColor: Color, | ||
backgroundColor: Color, | ||
borderColor: Color | ||
) { | ||
NoostakChip( | ||
text = text, | ||
textStyle = NoostakTheme.typography.c3Regular, | ||
textColor = textColor, | ||
backgroundColor = backgroundColor, | ||
borderColor = borderColor, | ||
horizontalPaddingValues = dimensionResource(id = R.dimen.user_chip_horizontal_padding), | ||
verticalPaddingValues = dimensionResource(id = R.dimen.user_chip_vertical_padding) | ||
) | ||
} |
69 changes: 69 additions & 0 deletions
69
core/src/main/java/com/sopt/core/designsystem/component/topappbar/NoostakTopAppBar.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,69 @@ | ||
package com.sopt.core.designsystem.component.topappbar | ||
|
||
import androidx.compose.foundation.layout.WindowInsets | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.CenterAlignedTopAppBar | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TopAppBarDefaults | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color.Companion.White | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.sopt.core.R | ||
import com.sopt.core.designsystem.theme.NoostakAndroidTheme | ||
import com.sopt.core.designsystem.theme.NoostakTheme | ||
import com.sopt.core.extension.noRippleClickable | ||
import com.sopt.core.extension.showIf | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun NoostakTopAppBar( | ||
title: String = "", | ||
modifier: Modifier = Modifier, | ||
isIconVisible: Boolean, | ||
onBackButtonClick: () -> Unit = {} | ||
) { | ||
CenterAlignedTopAppBar( | ||
modifier = modifier.fillMaxWidth(), | ||
title = { | ||
Text( | ||
text = title, | ||
textAlign = TextAlign.Center, | ||
style = NoostakTheme.typography.b2Regular, | ||
color = NoostakTheme.colors.black | ||
) | ||
}, | ||
navigationIcon = { | ||
Icon( | ||
painter = painterResource(id = R.drawable.ic_back), | ||
contentDescription = stringResource(id = R.string.ic_back), | ||
modifier = Modifier | ||
.padding(start = 8.dp) | ||
.noRippleClickable { onBackButtonClick() } | ||
.showIf(isIconVisible), | ||
tint = NoostakTheme.colors.black | ||
) | ||
}, | ||
colors = TopAppBarDefaults.topAppBarColors(White), | ||
windowInsets = WindowInsets(0) | ||
) | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun NoostakTopAppBarPreview() { | ||
NoostakAndroidTheme { | ||
NoostakTopAppBar( | ||
modifier = Modifier.fillMaxWidth(), | ||
isIconVisible = true, | ||
title = "그룹" | ||
) | ||
} | ||
} |
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,19 @@ | ||
package com.sopt.core.util | ||
|
||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import kotlinx.coroutines.flow.MutableSharedFlow | ||
import kotlinx.coroutines.flow.SharedFlow | ||
import kotlinx.coroutines.flow.asSharedFlow | ||
import kotlinx.coroutines.launch | ||
|
||
abstract class BaseViewModel<T> : ViewModel() { | ||
private val _sideEffects = MutableSharedFlow<T>() | ||
val sideEffects: SharedFlow<T> get() = _sideEffects.asSharedFlow() | ||
|
||
protected fun emitSideEffect(sideEffect: T) { | ||
viewModelScope.launch { | ||
_sideEffects.emit(sideEffect) | ||
} | ||
} | ||
} |
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,18 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="12dp" | ||
android:height="13dp" | ||
android:viewportWidth="12" | ||
android:viewportHeight="13"> | ||
<path | ||
android:pathData="M6,1.5L6,11.5" | ||
android:strokeWidth="1.5" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#ffffff" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="M11,6.5L1,6.5" | ||
android:strokeWidth="1.5" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#ffffff" | ||
android:strokeLineCap="round"/> | ||
</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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<dimen name="chip_radius">16dp</dimen> | ||
<dimen name="user_chip_horizontal_padding">8dp</dimen> | ||
<dimen name="user_chip_vertical_padding">6dp</dimen> | ||
<dimen name="category_chip_horizontal_padding">15dp</dimen> | ||
<dimen name="category_chip_vertical_padding">6dp</dimen> | ||
<dimen name="fab_radius">30dp</dimen> | ||
</resources> |
15 changes: 15 additions & 0 deletions
15
domain/src/main/java/com/sopt/domain/entity/ConfirmedDetailEntity.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,15 @@ | ||
package com.sopt.domain.entity | ||
|
||
data class ConfirmedDetailEntity( | ||
val appointName: String, | ||
val date: String, | ||
val weekday: String, | ||
val startTime: String, | ||
val endTime: String, | ||
val category: String, | ||
val likes: Int, | ||
val availableMembersCount: Int, | ||
val availableMembers: List<String>, | ||
val unavailableMembersCount: Int, | ||
val unavailableMembers: List<String> | ||
) |
8 changes: 8 additions & 0 deletions
8
domain/src/main/java/com/sopt/domain/entity/ConfirmedEntity.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.sopt.domain.entity | ||
|
||
data class ConfirmedEntity( | ||
val appointmentId: Long, | ||
val appointmentName: String, | ||
val date: String, | ||
val weekday: String | ||
) |
8 changes: 8 additions & 0 deletions
8
domain/src/main/java/com/sopt/domain/entity/GroupDetailEntity.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.sopt.domain.entity | ||
|
||
data class GroupDetailEntity( | ||
val groupName: String, | ||
val groupMembersCount: Int, | ||
val progressEntities: List<ProgressEntity>, | ||
val confirmedEntities: List<ConfirmedEntity> | ||
) |
18 changes: 18 additions & 0 deletions
18
domain/src/main/java/com/sopt/domain/entity/GroupMembersEntity.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,18 @@ | ||
package com.sopt.domain.entity | ||
|
||
data class GroupMembersEntity( | ||
val groupName: String, | ||
val groupMembersCount: Int, | ||
val groupLeader: GroupLeaderEntity, | ||
val groupMembers: List<GroupMemberEntity> | ||
) | ||
|
||
data class GroupLeaderEntity( | ||
val groupLeaderName: String, | ||
val groupLeaderImage: String | ||
) | ||
|
||
data class GroupMemberEntity( | ||
val groupMemberName: String, | ||
val groupMemberImage: String | ||
) |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/sopt/domain/entity/ProgressEntity.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.sopt.domain.entity | ||
|
||
data class ProgressEntity( | ||
val appointmentId: Int, | ||
val appointmentName: String, | ||
val date: String, | ||
val weekday: String, | ||
val startTime: String, | ||
val endTime: String, | ||
val participants: Int, | ||
val maxParticipants: Int | ||
) |
Oops, something went wrong.