-
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.
Merge pull request #45 from team-haribo/feature/44-publishing-student…
…-management 🔀 :: (#44) - publishing student management
- Loading branch information
Showing
18 changed files
with
702 additions
and
41 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
141 changes: 141 additions & 0 deletions
141
...src/main/java/com/goms/design_system/component/bottomsheet/MultipleSelectorBottomSheet.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,141 @@ | ||
package com.goms.design_system.component.bottomsheet | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.widthIn | ||
import androidx.compose.foundation.lazy.LazyRow | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.ModalBottomSheet | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.rememberModalBottomSheetState | ||
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.layout.onGloballyPositioned | ||
import androidx.compose.ui.platform.LocalDensity | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
import com.goms.design_system.component.button.AdminBottomSheetButton | ||
import com.goms.design_system.theme.GomsTheme | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun MultipleSelectorBottomSheet( | ||
modifier: Modifier, | ||
title: String, | ||
subTitle1: String, | ||
list1: List<String>, | ||
selected1: String, | ||
itemChange1: (String) -> Unit, | ||
subTitle2: String, | ||
list2: List<String>, | ||
selected2: String, | ||
itemChange2: (String) -> Unit, | ||
subTitle3: String, | ||
list3: List<String>, | ||
selected3: String, | ||
itemChange3: (String) -> Unit, | ||
closeSheet: () -> Unit | ||
) { | ||
var componentWidth by remember { mutableStateOf( 0.dp ) } | ||
val density = LocalDensity.current | ||
|
||
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) | ||
|
||
GomsTheme { colors, typography -> | ||
ModalBottomSheet( | ||
onDismissRequest = { closeSheet() }, | ||
sheetState = sheetState, | ||
shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp), | ||
containerColor = colors.G1 | ||
) { | ||
Column( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.padding(start = 20.dp, end = 20.dp, bottom = 16.dp) | ||
.onGloballyPositioned { | ||
componentWidth = with(density) { | ||
it.size.width.toDp() | ||
} | ||
}, | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
BottomSheetHeader( | ||
modifier = Modifier, | ||
title = title, | ||
closeSheet = closeSheet | ||
) | ||
Text( | ||
text = subTitle1, | ||
style = typography.titleSmall, | ||
fontWeight = FontWeight.SemiBold, | ||
color = colors.WHITE | ||
) | ||
LazyRow( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
items(list1.size) { | ||
AdminBottomSheetButton( | ||
modifier = Modifier.widthIn((componentWidth - 16.dp * list1.lastIndex) / list1.size), | ||
text = list1[it], | ||
selected = selected1 == list1[it] | ||
) { | ||
itemChange1(list1[it]) | ||
} | ||
} | ||
} | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
Text( | ||
text = subTitle2, | ||
style = typography.titleSmall, | ||
fontWeight = FontWeight.SemiBold, | ||
color = colors.WHITE | ||
) | ||
LazyRow( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
items(list2.size) { | ||
AdminBottomSheetButton( | ||
modifier = Modifier.widthIn((componentWidth - 16.dp * list2.lastIndex) / list2.size), | ||
text = list2[it], | ||
selected = selected2 == list2[it] | ||
) { | ||
itemChange2(list2[it]) | ||
} | ||
} | ||
} | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
Text( | ||
text = subTitle3, | ||
style = typography.titleSmall, | ||
fontWeight = FontWeight.SemiBold, | ||
color = colors.WHITE | ||
) | ||
LazyRow( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
items(list3.size) { | ||
AdminBottomSheetButton( | ||
modifier = Modifier.widthIn((componentWidth - 16.dp * list3.lastIndex) / list3.size), | ||
text = list3[it], | ||
selected = selected3 == list3[it] | ||
) { | ||
itemChange3(list3[it]) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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="M15.891,3.048C17.288,1.651 19.554,1.651 20.952,3.048C22.349,4.445 22.349,6.711 20.952,8.109L20.06,9.001L15,3.94L15.891,3.048ZM13.939,5.001L3.941,15C3.535,15.406 3.249,15.917 3.116,16.476L2.02,21.078C1.96,21.331 2.036,21.598 2.22,21.782C2.404,21.966 2.67,22.041 2.924,21.981L7.525,20.885C8.084,20.752 8.595,20.467 9.002,20.06L19,10.061L13.939,5.001Z" | ||
android:fillColor="#2573F3"/> | ||
</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,8 @@ | ||
package com.goms.model.enum | ||
|
||
enum class Class(val value: String, val enum: Int) { | ||
FIRST("1반", 1), | ||
SECOND("2반", 2), | ||
THIRD("3반", 3), | ||
FOURTH("4반", 4) | ||
} |
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,7 @@ | ||
package com.goms.model.enum | ||
|
||
enum class Grade(val value: String, val enum: Int) { | ||
FIRST_GRADE("1학년", 1), | ||
SECOND_GRADE("2학년", 2), | ||
THIRD_GRADE("3학년", 3) | ||
} |
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,7 @@ | ||
package com.goms.model.enum | ||
|
||
enum class Status(val value: String) { | ||
ROLE_STUDENT("학생"), | ||
ROLE_STUDENT_COUNCIL("학생회"), | ||
BLACK_LIST("외출 금지") | ||
} |
Oops, something went wrong.