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

release snutt 3.5.0 #257

Merged
merged 8 commits into from
Feb 23, 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 @@ -389,7 +389,11 @@ class RootActivity : AppCompatActivity() {
navController.getBackStackEntry(NavigationDestination.Home)
}
val themeListViewModel = hiltViewModel<ThemeListViewModel>(parentEntry)
ThemeConfigPage(themeListViewModel)
val tableListViewModel = hiltViewModel<TableListViewModel>(parentEntry)
ThemeConfigPage(
themeListViewModel = themeListViewModel,
tableListViewModel = tableListViewModel,
)
}
if (BuildConfig.DEBUG) composable2(NavigationDestination.NetworkLog) { NetworkLogPage() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun BuiltInThemeMoreActionBottomSheet(
) {
Column(
modifier = modifier
.background(MaterialTheme.colors.background)
.background(MaterialTheme.colors.surface)
.padding(vertical = 12.dp)
.fillMaxWidth(),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun CustomThemeMoreActionBottomSheet(
) {
Column(
modifier = modifier
.background(MaterialTheme.colors.background)
.background(MaterialTheme.colors.surface)
.padding(vertical = 12.dp)
.fillMaxWidth(),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ import com.wafflestudio.snutt2.views.LocalModalState
import com.wafflestudio.snutt2.views.LocalNavController
import com.wafflestudio.snutt2.views.NavigationDestination
import com.wafflestudio.snutt2.views.launchSuspendApi
import com.wafflestudio.snutt2.views.logged_in.home.TableListViewModel
import com.wafflestudio.snutt2.views.logged_in.home.settings.SettingColumn
import com.wafflestudio.snutt2.views.logged_in.home.timetable.TimetableViewModel
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterialApi::class)
@Composable
fun ThemeConfigPage(
themeListViewModel: ThemeListViewModel = hiltViewModel(),
timetableViewModel: TimetableViewModel = hiltViewModel(),
tableListViewModel: TableListViewModel = hiltViewModel(), // NavigationDestination.HOME에 scope된 viewmodel
) {
val navController = LocalNavController.current
val modalState = LocalModalState.current
Expand All @@ -83,6 +87,7 @@ fun ThemeConfigPage(

val customThemes by themeListViewModel.customThemes.collectAsState()
val builtInThemes by themeListViewModel.builtInThemes.collectAsState()
val table by timetableViewModel.currentTable.collectAsState()

val onBackPressed: () -> Unit = {
if (bottomSheet.isVisible) {
Expand Down Expand Up @@ -202,6 +207,12 @@ fun ThemeConfigPage(
composableStates = composableStates,
onConfirm = {
themeListViewModel.deleteTheme(theme.id)
table?.let {
// 현재 선택된 시간표의 테마라면 서버에서 변경된 색 배치를 불러옴
if (it.themeId != null && it.themeId == theme.id) {
tableListViewModel.changeSelectedTable(it.id)
}
}
modalState.hide()
bottomSheet.hide()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ fun ThemeDetailPage(
},
colorFilter = ColorFilter.tint(
(if (isDarkMode()) SNUTTColors.DarkGray else SNUTTColors.Gray40).copy(
alpha = if (editingColors.size > 1) 1f else 0.3f,
alpha = if (editingColors.size in 2..8) 1f else 0.3f,
),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ fun NotificationItem(info: NotificationDto) {
modifier = Modifier.padding(top = 4.dp, bottom = 7.dp),
) {
Row(modifier = Modifier.fillMaxWidth()) {
Text(text = info.title, style = SNUTTTypography.h4.copy(fontWeight = FontWeight.SemiBold))
Text(text = info.title, style = SNUTTTypography.h4.copy(fontSize = 13.sp, fontWeight = FontWeight.SemiBold))
Spacer(modifier = Modifier.weight(1f))
Text(
text = getNotificationTime(context, info),
style = SNUTTTypography.body1.copy(color = SNUTTColors.Gray2),
style = SNUTTTypography.body1.copy(fontSize = 13.sp, color = SNUTTColors.Gray2),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
Spacer(modifier = Modifier.height(6.dp))
Text(
text = info.message,
style = SNUTTTypography.body1.copy(lineHeight = 18.2.sp),
style = SNUTTTypography.body1.copy(fontSize = 13.sp, lineHeight = 18.2.sp),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
snuttVersionName=3.4.1
snuttVersionName=3.5.0
Loading