Skip to content

Commit

Permalink
Merge branch 'main' into implement-search-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
chigichan24 committed Aug 17, 2023
2 parents c205a1e + 7bb4e35 commit 5a13fb7
Show file tree
Hide file tree
Showing 70 changed files with 671 additions and 167 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ local.properties
*.iml
.idea/*
!.idea/copyright
!.idea/codeInsightSettings.xml
# Keep the code styles.
!/.idea/codeStyles
/.idea/codeStyles/*
Expand Down
22 changes: 22 additions & 0 deletions .idea/codeInsightSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private fun NavGraphBuilder.mainScreen(
onNavigationIconClick = {
navController.popBackStack()
},
onContributorItemClick = externalNavController::navigate,
)
}
},
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/About/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public struct AboutView<ContributorView: View>: View {
Text("アプリバージョン")
.font(Font.system(size: 14, weight: .medium))
Spacer().frame(height: 8)
Text("1.2")
Text(Bundle.main.formattedVersion)
.font(Font.system(size: 14, weight: .medium))
}
.padding(.horizontal, 16)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "bookmarks.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
17 changes: 17 additions & 0 deletions app-ios/Modules/Sources/Model/Extension/Bundle.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

public extension Bundle {

var shortVersionString: String {
infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
}

var buildNumber: String {
infoDictionary?["CFBundleVersion"] as? String ?? ""
}

var formattedVersion: String {
"\(shortVersionString) (\(buildNumber))"
}

}
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Timetable/TimetableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public struct TimetableView<SessionView: View>: View {
Assets.Icons.search.swiftUIImage
}
ToolbarItem {
Assets.Icons.bookmarkBorder.swiftUIImage
Assets.Icons.bookmarks.swiftUIImage
}
ToolbarItem {
Assets.Icons.gridView.swiftUIImage
Expand Down
2 changes: 1 addition & 1 deletion core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ kotlin {
implementation(libs.ktorKotlinxSerialization)
implementation(libs.ktorContentNegotiation)
implementation(libs.kermit)
implementation(libs.firebaseRemoteConfig)
}
}
val androidMain by getting {
Expand All @@ -33,6 +32,7 @@ kotlin {
implementation(libs.ktorClientOkHttp)
implementation(libs.okHttpLoggingInterceptor)
implementation(libs.okHttpLoggingInterceptor)
implementation(libs.firebaseRemoteConfig)
}
}
val iosMain by getting {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.droidkaigi.confsched2023.data.remoteconfig

import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.remoteconfig.get
import dev.gitlive.firebase.remoteconfig.remoteConfig

actual class DefaultRemoteConfigApi : RemoteConfigApi {

private val firebaseRemoteConfig = Firebase.remoteConfig

/**
* If you want to change the interval time to fetch, please change it here
*/
// init {
// CoroutineScope(Dispatchers.IO).launch {
// firebaseRemoteConfig.settings {
// minimumFetchIntervalInSeconds = 12 * 3600L
// }
// }
// }

actual override suspend fun getBoolean(key: String): Boolean {
firebaseRemoteConfig.fetchAndActivate()
return firebaseRemoteConfig[key]
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
package io.github.droidkaigi.confsched2023.data.remoteconfig

import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.remoteconfig.get
import dev.gitlive.firebase.remoteconfig.remoteConfig

class DefaultRemoteConfigApi : RemoteConfigApi {

private val firebaseRemoteConfig = Firebase.remoteConfig

/**
* If you want to change the interval time to fetch, please change it here
*/
// init {
// CoroutineScope(Dispatchers.IO).launch {
// firebaseRemoteConfig.settings {
// minimumFetchIntervalInSeconds = 12 * 3600L
// }
// }
// }

override suspend fun getBoolean(key: String): Boolean {
firebaseRemoteConfig.fetchAndActivate()
return firebaseRemoteConfig[key]
}
expect class DefaultRemoteConfigApi : RemoteConfigApi {
override suspend fun getBoolean(key: String): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class FakeRemoteConfigApi : RemoteConfigApi {
}

override suspend fun getBoolean(key: String): Boolean {
return status.getBoolean("key")
return status.getBoolean(key)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ fun SessionsAllResponse.Companion.fake(): SessionsAllResponse {
)
val rooms = listOf(
RoomResponse(name = LocaledResponse(ja = "Room1", en = "Room2"), id = 1, sort = 1),
RoomResponse(name = LocaledResponse(ja = "Room3", en = "Room4"), id = 2, sort = 2),
RoomResponse(name = LocaledResponse(ja = "Room5", en = "Room6"), id = 3, sort = 3),
RoomResponse(name = LocaledResponse(ja = "Room7", en = "Room8"), id = 4, sort = 4),
)
val categories = listOf(
CategoryResponse(
Expand All @@ -73,42 +76,44 @@ fun SessionsAllResponse.Companion.fake(): SessionsAllResponse {

for (day in 0 until 3) {
val dayOffset = day * 24 * 60 * 60
for (index in 0 until 4) {
val start = Instant.fromEpochSeconds(
LocalDateTime.parse("2023-09-14T10:10:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 25 * 60 + dayOffset,
).toLocalDateTime(TimeZone.of("UTC+9"))
val end = Instant.fromEpochSeconds(
LocalDateTime.parse("2023-09-14T10:50:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 25 * 60 + dayOffset,
).toLocalDateTime(TimeZone.of("UTC+9"))
for (room in rooms) {
for (index in 0 until 4) {
val start = Instant.fromEpochSeconds(
LocalDateTime.parse("2023-09-14T10:10:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 25 * 60 + dayOffset,
).toLocalDateTime(TimeZone.of("UTC+9"))
val end = Instant.fromEpochSeconds(
LocalDateTime.parse("2023-09-14T10:50:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 25 * 60 + dayOffset,
).toLocalDateTime(TimeZone.of("UTC+9"))

val session = SessionResponse(
id = "$day$index",
isServiceSession = false,
title = LocaledResponse(
ja = "DroidKaigiのアプリのアーキテクチャ day$day index$index",
en = "DroidKaigi App Architecture day$day index$index",
),
speakers = listOf("1", "2"),
description = "これはディスクリプションです。\nこれはディスクリプションです。",
startsAt = start.toString(),
endsAt = end.toString(),
language = "JAPANESE",
roomId = 1,
sessionCategoryItemId = 1,
sessionType = "NORMAL",
message = null,
isPlenumSession = false,
targetAudience = "For App developer アプリ開発者向け",
interpretationTarget = false,
asset = SessionAssetResponse(
videoUrl = "https://www.youtube.com/watch?v=hFdKCyJ-Z9A",
slideUrl = "https://droidkaigi.jp/2021/",
),
levels = listOf("INTERMEDIATE"),
)
sessions.add(session)
val session = SessionResponse(
id = "$day$room$index",
isServiceSession = false,
title = LocaledResponse(
ja = "DroidKaigiのアプリのアーキテクチャ day$day room${room.name.ja} index$index",
en = "DroidKaigi App Architecture day$day room${room.name.en} index$index",
),
speakers = listOf("1", "2"),
description = "これはディスクリプションです。\nこれはディスクリプションです。",
startsAt = start.toString(),
endsAt = end.toString(),
language = "JAPANESE",
roomId = room.id,
sessionCategoryItemId = 1,
sessionType = "NORMAL",
message = null,
isPlenumSession = false,
targetAudience = "For App developer アプリ開発者向け",
interpretationTarget = false,
asset = SessionAssetResponse(
videoUrl = "https://www.youtube.com/watch?v=hFdKCyJ-Z9A",
slideUrl = "https://droidkaigi.jp/2021/",
),
levels = listOf("INTERMEDIATE"),
)
sessions.add(session)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.droidkaigi.confsched2023.data.remoteconfig

import io.github.droidkaigi.confsched2023.data.remoteconfig.FakeRemoteConfigApi.Status.Default

actual class DefaultRemoteConfigApi : RemoteConfigApi {

actual override suspend fun getBoolean(key: String): Boolean {
return FakeRemoteConfigApi().apply {
setUp(Default)
}.getBoolean(key)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ public data class TimetableLanguage(
val langOfSpeaker: String,
val isInterpretationTarget: Boolean,
) {
val langLabel = when (langOfSpeaker) {
"MIXED" -> langOfSpeaker
else -> {
langOfSpeaker.take(2)
}
val labels = if (langOfSpeaker == Lang.MIXED.tagName) {
listOf(Lang.MIXED.tagName)
} else if (isInterpretationTarget) {
listOf(Lang.ENGLISH.tagName, Lang.JAPANESE.tagName)
} else {
listOf(langOfSpeaker.take(2))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.isRoot
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
import androidx.compose.ui.test.onFirst
import androidx.compose.ui.test.onRoot
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.test.swipeUp
import com.github.takahirom.roborazzi.Dump
import com.github.takahirom.roborazzi.RoborazziOptions
import com.github.takahirom.roborazzi.captureRoboImage
import io.github.droidkaigi.confsched2023.data.sessions.FakeSessionsApiClient
import io.github.droidkaigi.confsched2023.data.sessions.SessionsApiClient
Expand Down Expand Up @@ -135,6 +138,18 @@ class TimetableScreenRobot @Inject constructor(
.captureRoboImage()
}

fun checkAccessibilityCapture() {
composeTestRule
.onRoot()
.captureRoboImage(
roborazziOptions = RoborazziOptions(
captureType = RoborazziOptions.CaptureType.Dump(
explanation = Dump.AccessibilityExplanation,
),
),
)
}

fun waitUntilIdle() {
composeTestRule.waitForIdle()
testDispatcher.scheduler.advanceUntilIdle()
Expand Down

0 comments on commit 5a13fb7

Please sign in to comment.