Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-side-event-list
Browse files Browse the repository at this point in the history
  • Loading branch information
coffmark authored Aug 25, 2023
2 parents 48f3fdd + 43c8e1c commit 8cdae96
Show file tree
Hide file tree
Showing 33 changed files with 307 additions and 98 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @DroidKaigi/ConferenceApp2023Reviewer
/app-ios/ @DroidKaigi/appios
1 change: 0 additions & 1 deletion app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ dependencies {
implementation(libs.composeNavigation)
implementation(libs.composeHiltNavigtation)
implementation(libs.composeMaterialWindowSize)
implementation(libs.accompanistSystemUiController)
implementation(libs.androidxBrowser)
implementation(libs.androidxWindow)
implementation(libs.kermit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ import android.os.Build
import android.provider.CalendarContract
import androidx.annotation.RequiresApi
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.windowsizeclass.WindowSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.core.net.toUri
import androidx.core.os.bundleOf
Expand All @@ -30,7 +27,6 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.window.layout.DisplayFeature
import co.touchlab.kermit.Logger
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import io.github.droidkaigi.confsched2023.about.aboutScreenRoute
import io.github.droidkaigi.confsched2023.about.navigateAboutScreen
import io.github.droidkaigi.confsched2023.about.nestedAboutScreen
Expand Down Expand Up @@ -84,14 +80,6 @@ fun KaigiApp(
modifier: Modifier = Modifier,
) {
KaigiTheme {
val systemUiController = rememberSystemUiController()
val useDarkIcons = !isSystemInDarkTheme()

DisposableEffect(systemUiController, useDarkIcons) {
systemUiController.setSystemBarsColor(Color.Transparent, useDarkIcons)
onDispose {}
}

Surface(
modifier = modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package io.github.droidkaigi.confsched2023
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.core.view.WindowCompat
import androidx.window.layout.DisplayFeature
import androidx.window.layout.WindowInfoTracker
import dagger.hilt.android.AndroidEntryPoint
Expand All @@ -23,7 +23,7 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

WindowCompat.setDecorFitsSystemWindows(window, false)
enableEdgeToEdge()

setContent {
val windowSize = calculateWindowSizeClass(this)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "map.pdf",
"filename" : "floormap.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "floormap_fill_off.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "info_fill_off.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "badge.pdf",
"filename" : "stamp.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "stamp_fill_off.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "timetable_fill_off.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
36 changes: 28 additions & 8 deletions app-ios/Modules/Sources/Navigation/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ public struct RootView: View {
Label {
Text("Timetable")
} icon: {
Assets.Icons.timetable.swiftUIImage
.renderingMode(.template)
if selection == .timeline {
Assets.Icons.timetable.swiftUIImage
.renderingMode(.template)
} else {
Assets.Icons.timetableFillOff.swiftUIImage
.renderingMode(.template)
}
}
}
FloorMapView()
Expand All @@ -44,8 +49,13 @@ public struct RootView: View {
Label {
Text("FloorMap")
} icon: {
Assets.Icons.map.swiftUIImage
.renderingMode(.template)
if selection == .floorMap {
Assets.Icons.floorMap.swiftUIImage
.renderingMode(.template)
} else {
Assets.Icons.floorMapFillOff.swiftUIImage
.renderingMode(.template)
}
}
}
StampsView()
Expand All @@ -54,8 +64,13 @@ public struct RootView: View {
Label {
Text("Stamps")
} icon: {
Assets.Icons.badge.swiftUIImage
.renderingMode(.template)
if selection == .stamps {
Assets.Icons.stamp.swiftUIImage
.renderingMode(.template)
} else {
Assets.Icons.stampFillOff.swiftUIImage
.renderingMode(.template)
}
}
}
AboutView(
Expand All @@ -74,8 +89,13 @@ public struct RootView: View {
Label {
Text("About")
} icon: {
Assets.Icons.info.swiftUIImage
.renderingMode(.template)
if selection == .about {
Assets.Icons.info.swiftUIImage
.renderingMode(.template)
} else {
Assets.Icons.infoFillOff.swiftUIImage
.renderingMode(.template)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Stamps/StampsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct StampsView: View {
.padding(16)
}
.background(AssetColors.Surface.surface.swiftUIColor)
.navigationTitle("Badges")
.navigationTitle("Stamps")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct TimetableListItemView: View {
}
Spacer().frame(height: 16)
}
.frame(maxWidth: .infinity, alignment: .leading)
Button(
action: {
// TODO: favorite action
Expand Down
2 changes: 1 addition & 1 deletion config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ style:
ClassOrdering:
active: true
# Multi-line if statements force curly braces
MandatoryBracesIfStatements:
BracesOnIfStatements:
active: true
# Multiline for, while... forces curly braces
MandatoryBracesLoops:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fun SessionsAllResponse.Companion.fake(): SessionsAllResponse {
isServiceSession = true,
isPlenumSession = false,
speakers = emptyList(),
roomId = 1,
roomId = 2,
targetAudience = "TBW",
language = "JAPANESE",
sessionCategoryItemId = 1,
Expand All @@ -101,12 +101,12 @@ fun SessionsAllResponse.Companion.fake(): SessionsAllResponse {
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,
LocalDateTime.parse("2023-09-14T11:00:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 30 * 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,
LocalDateTime.parse("2023-09-14T11:30:00")
.toInstant(TimeZone.of("UTC+9")).epochSeconds + index * 30 * 60 + dayOffset,
).toLocalDateTime(TimeZone.of("UTC+9"))

val session = SessionResponse(
Expand Down
20 changes: 10 additions & 10 deletions core/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ plugins {
android.namespace = "io.github.droidkaigi.confsched2023.core.testing"

dependencies {
implementation(project(":core:model"))
implementation(project(":core:designsystem"))
implementation(project(":core:data"))
implementation(project(":feature:main"))
implementation(project(":feature:sessions"))
implementation(project(":feature:about"))
implementation(project(":feature:sponsors"))
implementation(project(":feature:floor-map"))
implementation(project(":feature:stamps"))
implementation(project(":feature:staff"))
implementation(projects.core.model)
implementation(projects.core.designsystem)
implementation(projects.core.data)
implementation(projects.feature.main)
implementation(projects.feature.sessions)
implementation(projects.feature.about)
implementation(projects.feature.sponsors)
implementation(projects.feature.floorMap)
implementation(projects.feature.stamps)
implementation(projects.feature.staff)
implementation(libs.daggerHiltAndroidTesting)
implementation(libs.roborazzi)
implementation(libs.kermit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class RobotTestRule(
return RuleChain
.outerRule(HiltAndroidAutoInjectRule(testInstance))
.around(CoroutinesTestRule())
.around(TimeZoneTestRule())
.around(object : TestWatcher() {
override fun starting(description: Description) {
// To see logs in the console
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.github.droidkaigi.confsched2023.testing

import org.junit.rules.TestWatcher
import org.junit.runner.Description
import java.util.TimeZone

class TimeZoneTestRule : TestWatcher() {
private lateinit var evacuatedTimeZone: TimeZone

override fun starting(description: Description) {
evacuatedTimeZone = TimeZone.getDefault()
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Tokyo"))
}

override fun finished(description: Description) {
TimeZone.setDefault(evacuatedTimeZone)
}
}
6 changes: 3 additions & 3 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation(project(":core:designsystem"))
implementation(project(":core:data"))
implementation(projects.core.designsystem)
implementation(projects.core.data)
implementation(libs.kermit)
api(project(":core:common"))
api(projects.core.common)
api(libs.composeImageLoader)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package io.github.droidkaigi.confsched2023.about.component

import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FileCopy
import androidx.compose.material.icons.outlined.Gavel
import androidx.compose.material.icons.outlined.PrivacyTip
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched2023.about.AboutStrings
import io.github.droidkaigi.confsched2023.designsystem.preview.MultiLanguagePreviews
import io.github.droidkaigi.confsched2023.designsystem.preview.MultiThemePreviews
import io.github.droidkaigi.confsched2023.designsystem.theme.KaigiTheme

const val AboutOthersCodeOfConductItemTestTag = "AboutOthersCodeOfConductItem"
const val AboutOthersLicenseItemTestTag = "AboutOthersLicenseItem"
Expand Down Expand Up @@ -70,3 +76,20 @@ fun LazyListScope.aboutOthers(
)
}
}

@MultiThemePreviews
@MultiLanguagePreviews
@Composable
internal fun AboutOthersPreview() {
KaigiTheme {
Surface {
LazyColumn {
aboutOthers(
onCodeOfConductItemClick = {},
onLicenseItemClick = {},
onPrivacyPolicyItemClick = {},
)
}
}
}
}
Loading

0 comments on commit 8cdae96

Please sign in to comment.