Skip to content

Commit

Permalink
Fix test and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Jul 26, 2024
1 parent 86b0e4e commit ec7c35c
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,17 @@ private class ExternalNavController(

/**
* Navigate to Calendar Registration
* @param timeTableItem カレンダー登録に必要なタイムラインアイテムの情報
*/
fun navigateToCalendarRegistration(timeTableItem: TimetableItem) {
fun navigateToCalendarRegistration(timetableItem: TimetableItem) {
val calendarIntent = Intent(Intent.ACTION_INSERT).apply {
data = CalendarContract.Events.CONTENT_URI
putExtras(
bundleOf(
CalendarContract.EXTRA_EVENT_BEGIN_TIME to timeTableItem.startsAt.toEpochMilliseconds(),
CalendarContract.EXTRA_EVENT_END_TIME to timeTableItem.endsAt.toEpochMilliseconds(),
CalendarContract.Events.TITLE to "[${timeTableItem.room.name.currentLangTitle}] ${timeTableItem.title.currentLangTitle}",
CalendarContract.Events.DESCRIPTION to timeTableItem.url,
CalendarContract.Events.EVENT_LOCATION to timeTableItem.room.name.currentLangTitle,
CalendarContract.EXTRA_EVENT_BEGIN_TIME to timetableItem.startsAt.toEpochMilliseconds(),
CalendarContract.EXTRA_EVENT_END_TIME to timetableItem.endsAt.toEpochMilliseconds(),
CalendarContract.Events.TITLE to "[${timetableItem.room.name.currentLangTitle}] ${timetableItem.title.currentLangTitle}",
CalendarContract.Events.DESCRIPTION to timetableItem.url,
CalendarContract.Events.EVENT_LOCATION to timetableItem.room.name.currentLangTitle,
),
)
}
Expand All @@ -253,11 +252,11 @@ private class ExternalNavController(
context.startActivity(Intent(context, OssLicensesMenuActivity::class.java))
}

fun onShareClick(timeTableItem: TimetableItem) {
fun onShareClick(timetableItem: TimetableItem) {
shareNavigator.share(
"[${timeTableItem.room.name.currentLangTitle}] ${timeTableItem.startsTimeString} - ${timeTableItem.endsTimeString}\n" +
"${timeTableItem.title.currentLangTitle}\n" +
timeTableItem.url,
"[${timetableItem.room.name.currentLangTitle}] ${timetableItem.startsTimeString} - ${timetableItem.endsTimeString}\n" +
"${timetableItem.title.currentLangTitle}\n" +
timetableItem.url,
)
}

Expand Down
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ PLATFORM_IOS="iOS Simulator,name=iPhone 15 Pro,OS=17.4"

set -o pipefail && xcodebuild build \
-project $PROJECT \
-scheme "DroidKaigi2024AppWithKmpBuild" \
-scheme "DroidKaigi2024App" \
-configuration Debug \
-destination platform="$PLATFORM_IOS"
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import io.github.droidkaigi.confsched.model.TimetableItem.Session
import io.github.droidkaigi.confsched.model.fake
import io.github.droidkaigi.confsched.sessions.TimetableItemDetailScreenUiState.Loaded
import io.github.droidkaigi.confsched.sessions.TimetableItemDetailScreenUiState.Loading
import io.github.droidkaigi.confsched.sessions.component.TimeTableItemDetailContent
import io.github.droidkaigi.confsched.sessions.component.TimeTableItemDetailHeadline
import io.github.droidkaigi.confsched.sessions.component.TimeTableItemDetailSummaryCard
import io.github.droidkaigi.confsched.sessions.component.TimetableItemDetailBottomAppBar
import io.github.droidkaigi.confsched.sessions.component.TimetableItemDetailContent
import io.github.droidkaigi.confsched.sessions.component.TimetableItemDetailHeadline
import io.github.droidkaigi.confsched.sessions.component.TimetableItemDetailSummaryCard
import io.github.droidkaigi.confsched.sessions.component.TimetableItemDetailTopAppBar
import io.github.droidkaigi.confsched.ui.SnackbarMessageEffect
import io.github.droidkaigi.confsched.ui.UserMessageStateHolder
Expand Down Expand Up @@ -180,19 +180,19 @@ private fun TimetableItemDetailScreen(
modifier = Modifier.fillMaxSize().padding(innerPadding),
) {
item {
TimeTableItemDetailHeadline(
TimetableItemDetailHeadline(
timetableItem = uiState.timetableItem,
)
}

item {
TimeTableItemDetailSummaryCard(
TimetableItemDetailSummaryCard(
timetableItem = uiState.timetableItem,
)
}

item {
TimeTableItemDetailContent(
TimetableItemDetailContent(
timetableItem = uiState.timetableItem,
currentLang = uiState.currentLang,
onLinkClick = onLinkClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched.designsystem.component.ClickableLinkText
import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme
import io.github.droidkaigi.confsched.designsystem.theme.LocalRoomTheme
import io.github.droidkaigi.confsched.designsystem.theme.ProvideRoomTheme
import io.github.droidkaigi.confsched.model.Lang
import io.github.droidkaigi.confsched.model.MultiLangText
import io.github.droidkaigi.confsched.model.TimetableItem
Expand All @@ -38,7 +39,7 @@ import io.github.droidkaigi.confsched.model.fake
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
fun TimeTableItemDetailContent(
fun TimetableItemDetailContent(
timetableItem: TimetableItem,
currentLang: Lang?,
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -189,42 +190,55 @@ private fun ArchiveSection(

@Composable
@Preview
fun TimeTableItemDetailContentPreview() {
fun TimetableItemDetailContentPreview() {
KaigiTheme {
Surface {
TimeTableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.JAPANESE,
onLinkClick = {},
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.JAPANESE,
onLinkClick = {},
)
}
}
}
}

@Composable
@Preview
fun TimeTableItemDetailContentWithEnglishPreview() {
fun TimetableItemDetailContentWithEnglishPreview() {
KaigiTheme {
Surface {
TimeTableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.ENGLISH,
onLinkClick = {},
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.ENGLISH,
onLinkClick = {},
)
}
}
}
}

@Composable
@Preview
fun TimeTableItemDetailContentWithMixedPreview() {
fun TimetableItemDetailContentWithMixedPreview() {
KaigiTheme {
Surface {
TimeTableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.MIXED,
onLinkClick = {},
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailContent(
timetableItem = Session.fake(),
currentLang = Lang.MIXED,
onLinkClick = {},
)
}
}
}
}

@Composable
fun ProvideFakeRoomTheme(content: @Composable () -> Unit) {
ProvideRoomTheme(Session.fake().room.getThemeKey()) {
content()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import io.github.droidkaigi.confsched.ui.rememberAsyncImagePainter
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
fun TimeTableItemDetailHeadline(
fun TimetableItemDetailHeadline(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
) {
Expand Down Expand Up @@ -90,12 +90,14 @@ fun TimeTableItemDetailHeadline(

@Composable
@Preview
fun TimeTableItemDetailHeadlinePreview() {
fun TimetableItemDetailHeadlinePreview() {
KaigiTheme {
Surface {
TimeTableItemDetailHeadline(
timetableItem = TimetableItem.Session.fake(),
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailHeadline(
timetableItem = TimetableItem.Session.fake(),
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import io.github.droidkaigi.confsched.model.nameAndFloor
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
fun TimeTableItemDetailSummaryCard(
fun TimetableItemDetailSummaryCard(
timetableItem: TimetableItem,
modifier: Modifier = Modifier,
) {
Expand Down Expand Up @@ -125,12 +125,14 @@ private fun SummaryCardRow(

@Composable
@Preview
fun TimeTableItemDetailSummaryCardPreview() {
fun TimetableItemDetailSummaryCardPreview() {
KaigiTheme {
Surface {
TimeTableItemDetailSummaryCard(
timetableItem = TimetableItem.Session.fake(),
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailSummaryCard(
timetableItem = TimetableItem.Session.fake(),
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ fun TimetableItemDetailTopAppBar(
@Preview
fun TimetableItemDetailTopAppBarPreview() {
KaigiTheme {
Surface {
TimetableItemDetailTopAppBar(
isLangSelectable = true,
onNavigationIconClick = {},
onSelectedLanguage = {},
scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(),
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailTopAppBar(
isLangSelectable = true,
onNavigationIconClick = {},
onSelectedLanguage = {},
scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(),
)
}
}
}
}
Expand All @@ -116,13 +118,15 @@ fun TimetableItemDetailTopAppBarPreview() {
@Preview
fun TimetableItemDetailTopAppBarUnSelectablePreview() {
KaigiTheme {
Surface {
TimetableItemDetailTopAppBar(
isLangSelectable = false,
onNavigationIconClick = {},
onSelectedLanguage = {},
scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(),
)
ProvideFakeRoomTheme {
Surface {
TimetableItemDetailTopAppBar(
isLangSelectable = false,
onNavigationIconClick = {},
onSelectedLanguage = {},
scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(),
)
}
}
}
}

0 comments on commit ec7c35c

Please sign in to comment.