Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamada-Ika committed Jul 1, 2024
1 parent 62b5bf8 commit d30867a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,22 @@ import io.github.droidkaigi.confsched.model.TimetableItem.Special
@Composable
fun TimeTableItemDetailContent(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
onLinkClick: (url: String) -> Unit,
) {
DescriptionSection(
timetableItem = timetableItem,
onLinkClick = onLinkClick,
)
TargetAudienceSection(timetableItem = timetableItem)
if (timetableItem.asset.isAvailable) {
ArchiveSection(
Column(modifier = modifier) {
DescriptionSection(
timetableItem = timetableItem,
onViewSlideClick = onLinkClick,
onWatchVideoClick = onLinkClick,
onLinkClick = onLinkClick,
)
TargetAudienceSection(timetableItem = timetableItem)
if (timetableItem.asset.isAvailable) {
ArchiveSection(
timetableItem = timetableItem,
onViewSlideClick = onLinkClick,
onWatchVideoClick = onLinkClick,
)
}
}
}

Expand All @@ -60,7 +63,7 @@ private fun DescriptionSection(
.padding(bottom = 16.dp),
) {
ClickableLinkText(
content = when(timetableItem) {
content = when (timetableItem) {
is Session -> timetableItem.description
is Special -> timetableItem.description
}.currentLangTitle,
Expand Down Expand Up @@ -89,62 +92,68 @@ private fun DescriptionSection(
@Composable
private fun TargetAudienceSection(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
) {
Text(
text = "対象者",
style = MaterialTheme.typography.titleLarge,
)
Text(
modifier = Modifier.padding(vertical = 8.dp),
text = timetableItem.targetAudience,
style = MaterialTheme.typography.bodyLarge,
)
Column(modifier = modifier) {
Text(
text = "対象者",
style = MaterialTheme.typography.titleLarge,
)
Text(
modifier = Modifier.padding(vertical = 8.dp),
text = timetableItem.targetAudience,
style = MaterialTheme.typography.bodyLarge,
)
}
}

@Composable
private fun ArchiveSection(
timetableItem: TimetableItem,
onViewSlideClick: (url: String) -> Unit,
modifier: Modifier = Modifier,
onWatchVideoClick: (url: String) -> Unit,
) {
Spacer(Modifier.height(16.dp))
Text(
text = "アーカイブ",
style = MaterialTheme.typography.titleLarge,
)
Spacer(Modifier.height(8.dp))
Row(
verticalAlignment = Alignment.CenterVertically,
) {
timetableItem.asset.slideUrl?.let { slideUrl ->
Button(
modifier = Modifier.weight(1f),
onClick = { onViewSlideClick(slideUrl) },
) {
Icon(
imageVector = Icons.Outlined.Description,
contentDescription = "Slide",
)
Text(
text = "スライド",
style = MaterialTheme.typography.labelLarge,
)
Column(modifier = modifier) {
Spacer(Modifier.height(16.dp))
Text(
text = "アーカイブ",
style = MaterialTheme.typography.titleLarge,
)
Spacer(Modifier.height(8.dp))
Row(
verticalAlignment = Alignment.CenterVertically,
) {
timetableItem.asset.slideUrl?.let { slideUrl ->
Button(
modifier = Modifier.weight(1f),
onClick = { onViewSlideClick(slideUrl) },
) {
Icon(
imageVector = Icons.Outlined.Description,
contentDescription = "Slide",
)
Text(
text = "スライド",
style = MaterialTheme.typography.labelLarge,
)
}
}
}
timetableItem.asset.videoUrl?.let { videoUrl ->
Spacer(modifier = Modifier.width(8.dp))
Button(
modifier = Modifier.weight(1f),
onClick = { onWatchVideoClick(videoUrl) },
) {
Icon(
imageVector = Icons.Outlined.PlayCircle,
contentDescription = "Video",
)
Text(
text = "動画",
style = MaterialTheme.typography.labelLarge,
)
timetableItem.asset.videoUrl?.let { videoUrl ->
Spacer(modifier = Modifier.width(8.dp))
Button(
modifier = Modifier.weight(1f),
onClick = { onWatchVideoClick(videoUrl) },
) {
Icon(
imageVector = Icons.Outlined.PlayCircle,
contentDescription = "Video",
)
Text(
text = "動画",
style = MaterialTheme.typography.labelLarge,
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import io.github.droidkaigi.confsched.ui.rememberAsyncImagePainter
@Composable
fun TimeTableItemDetailHeadline(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
) {
Column {
Column(modifier = modifier) {
Row {
TagView(
tagText = timetableItem.room.name.currentLangTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ import io.github.droidkaigi.confsched.model.nameAndFloor
@Composable
fun TimeTableItemDetailSummaryCard(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
) {
Column(
modifier = Modifier
modifier = modifier
.padding(bottom = 16.dp)
.border(width = 1.dp, color = Color.White, shape = RoundedCornerShape(4.dp)),
) {
Expand Down Expand Up @@ -64,7 +65,7 @@ fun TimeTableItemDetailSummaryCard(
contentDescription = "Language",
title = "対応言語",
description = timetableItem.getSupportedLangString(
getDefaultLocale() == Locale.JAPAN
getDefaultLocale() == Locale.JAPAN,
),
)
SummaryCardRow(
Expand All @@ -82,11 +83,11 @@ fun TimeTableItemDetailSummaryCard(

@Composable
private fun SummaryCardRow(
modifier: Modifier,
imageVector: ImageVector,
contentDescription: String,
title: String,
description: String,
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ fun TimetableItemDetailBottomAppBar(
isBookmarked: Boolean,
onBookmarkClick: (TimetableItem) -> Unit,
onCalendarRegistrationClick: (TimetableItem) -> Unit,
modifier: Modifier = Modifier,
onShareClick: (TimetableItem) -> Unit,
) {
BottomAppBar(
modifier = modifier,
actions = {
IconButton(onClick = { onShareClick(timetableItem) }) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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 io.github.droidkaigi.confsched.model.Lang

@OptIn(ExperimentalMaterial3Api::class)
Expand All @@ -26,8 +27,10 @@ fun TimetableItemDetailTopAppBar(
onNavigationIconClick: () -> Unit,
onSelectedLanguage: (Lang) -> Unit,
scrollBehavior: TopAppBarScrollBehavior,
modifier: Modifier = Modifier,
) {
TopAppBar(
modifier = modifier,
title = {},
navigationIcon = {
IconButton(onClick = { onNavigationIconClick() }) {
Expand Down

0 comments on commit d30867a

Please sign in to comment.