Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue-406_dynamic_color
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Sep 28, 2022
2 parents b7502a6 + 56ad640 commit cf43ce3
Show file tree
Hide file tree
Showing 53 changed files with 754 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/DependencyDiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
env:
BASE_BRANCH: ${{ github.base_ref }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
- uses: peter-evans/find-comment@b1c41cb2fb7ede4111f49c934663a66f1a664b63
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/iOSBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
with:
name: XCFrameworks
path: appioscombined.xcframework.zip
- name: Copy XCFramework to build dir
working-directory: app-ios
run: |
mkdir -p build
cp -r '../app-ios-combined/build/XCFrameworks/debug/appioscombined.xcframework' 'build'
- name: Build App
working-directory: app-ios
run: |
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

### Android

You can install the production app via Get it on Google Play.

[<img src="https://play.google.com/intl/ja/badges/static/images/badges/en_badge_web_generic.png" alt="You can install the production app via Get it on Google Play" width="155px">](https://play.google.com/store/apps/details?id=io.github.droidkaigi.confsched2022)

The builds being distributed through mobile app distribution services.

- Try the latest staging through [<img src="https://dply.me/rdembt/button/small" alt="Download to device">](https://dply.me/rdembt#install)
Expand All @@ -28,6 +32,11 @@ https://github.com/DroidKaigi/conference-app-2022/actions/workflows/Build.yml?qu

### iOS

You can install the production app via Get it on App Store.

[<img src="https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg" alt="You can install the production app via Get it on App Store" width="155px">](https://apps.apple.com/jp/app/droidkaigi2022%E5%85%AC%E5%BC%8F%E3%82%A2%E3%83%97%E3%83%AA/id1643449914)


Beta version of this app is available on TestFlight.
You can try and test this app with following public link.

Expand Down
1 change: 1 addition & 0 deletions app-ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
/build
2 changes: 1 addition & 1 deletion app-ios/DroidKaigi2022/ci_scripts/ci_post_clone.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh

brew install java
brew install openjdk@17
8 changes: 5 additions & 3 deletions app-ios/DroidKaigi2022/ci_scripts/ci_pre_xcodebuild.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/zsh

export PATH="/usr/local/opt/openjdk/bin:$PATH"
export PATH="/usr/local/opt/openjdk@17/bin:$PATH"

cd $CI_WORKSPACE
./gradlew appioscombined:assembleXCFramework
cd "$CI_WORKSPACE/app-ios"
./scripts/build_kmm_framework.sh release prod

echo $GOOGLE_INFO_PLIST | base64 -d > DroidKaigi2022/Shared/GoogleService-Info.plist
2 changes: 1 addition & 1 deletion app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ var package = Package(
),
.binaryTarget(
name: "appioscombined",
path: "../app-ios-combined/build/XCFrameworks/debug/appioscombined.xcframework"
path: "build/appioscombined.xcframework"
),
.plugin(
name: "SwiftLintPlugin",
Expand Down
3 changes: 1 addition & 2 deletions app-ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
- Build Kotlin Multiplatform Mobile XCFramework for iOS

```sh
cd ../
./gradlew appioscombined:assembleXCFramework
./scripts/build_kmm_framework.sh Debug
```

### Open project with Xcode
Expand Down
1 change: 1 addition & 0 deletions app-ios/Sources/ContributorFeature/ContributorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public let contributorReducer = Reducer<ContributorState, ContributorAction, Con
switch action {
case .refresh:
return .run { @MainActor subscriber in
try await environment.contributorsRepository.refresh()
for try await result: [Contributor] in environment.contributorsRepository.contributors().stream() {
await subscriber.send(
.refreshResponse(
Expand Down
1 change: 1 addition & 0 deletions app-ios/Sources/SponsorFeature/SponsorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public let sponsorReducer = Reducer<SponsorState, SponsorAction, SponsorEnvironm
case .refresh:
state.isLoading = true
return .run { @MainActor subscriber in
try await environment.sponsorsRepository.refresh()
for try await result: [Sponsor] in environment.sponsorsRepository.sponsors().stream() {
await subscriber.send(
.refreshResponse(
Expand Down
1 change: 1 addition & 0 deletions app-ios/Sources/StaffFeature/StaffView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public let staffReducer = Reducer<StaffState, StaffAction, StaffEnvironment> { s
switch action {
case .refresh:
return .run { @MainActor subscriber in
try await environment.staffRepository.refresh()
for try await result: [Staff] in environment.staffRepository.staff().stream() {
await subscriber.send(
.refreshResponse(
Expand Down
13 changes: 13 additions & 0 deletions app-ios/scripts/build_kmm_framework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Usage: ./build_kmm_framework.sh BUILD(debug/release) CONFIGURATION(dev/prod)

SCRIPT_PATH=${0}
BUILD=${1}
FLAVOR=${2}

cd "$(dirname $SCRIPT_PATH)/../../"
./gradlew appioscombined:assembleXCFramework -Pbuildkonfig.flavor=$FLAVOR

mkdir -p "app-ios/build"
cp -r "app-ios-combined/build/XCFrameworks/$BUILD/appioscombined.xcframework" "app-ios/build"
1 change: 1 addition & 0 deletions app-ios/scripts/copy_mokoresources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function prop {

if [ "$CI" = true -o "$CI" = TRUE ] ; then
export PATH="/usr/local/opt/openjdk/bin:$PATH"
export PATH="/usr/local/opt/openjdk@17/bin:$PATH"
else
export JAVA_HOME=$(prop 'org.gradle.java.home')
echo "JAVA_HOME has been set by the script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@ package io.github.droidkaigi.confsched2022.data.contributors
import io.github.droidkaigi.confsched2022.model.Contributor
import io.github.droidkaigi.confsched2022.model.ContributorsRepository
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toPersistentList
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.callbackFlow

// TODO: Move to core-testing, once contributors server is created
public class DataContributorsRepository(
private val contributorsApi: ContributorsApi,
) : ContributorsRepository {
private val contributorsStateFlow =
MutableStateFlow<PersistentList<Contributor>>(persistentListOf())

override fun contributors(): Flow<PersistentList<Contributor>> {
return callbackFlow {
send(
contributorsApi
.contributors()
.toPersistentList()
)
awaitClose { }
contributorsStateFlow.collect {
send(it)
}
}
}

override suspend fun refresh() {
TODO("Not yet implemented")
contributorsStateFlow.value = contributorsApi
.contributors()
.toPersistentList()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ public class FakeContributorsRepository : ContributorsRepository {
}

override suspend fun refresh() {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ package io.github.droidkaigi.confsched2022.data.sponsors
import io.github.droidkaigi.confsched2022.model.Sponsor
import io.github.droidkaigi.confsched2022.model.SponsorsRepository
import kotlinx.collections.immutable.PersistentList
import kotlinx.coroutines.channels.awaitClose
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.callbackFlow

public class DataSponsorsRepository(
private val sponsorsApi: SponsorsApi
) : SponsorsRepository {
private val sponsorsStateFlow =
MutableStateFlow<PersistentList<Sponsor>>(persistentListOf())
override fun sponsors(): Flow<PersistentList<Sponsor>> =
callbackFlow {
send(
sponsorsApi.sponsors()
)
awaitClose { }
sponsorsStateFlow.collect {
send(it)
}
}

override suspend fun refresh() {
sponsorsStateFlow.value = sponsorsApi
.sponsors()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ import kotlinx.coroutines.flow.flowOf

public class FakeSponsorsRepository : SponsorsRepository {
override fun sponsors(): Flow<PersistentList<Sponsor>> = flowOf(Sponsor.fakes())

override suspend fun refresh() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@ package io.github.droidkaigi.confsched2022.data.staff
import io.github.droidkaigi.confsched2022.model.Staff
import io.github.droidkaigi.confsched2022.model.StaffRepository
import kotlinx.collections.immutable.PersistentList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toPersistentList
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.callbackFlow

public class DataStaffRepository(
private val staffApi: StaffApi
) : StaffRepository {
private val staffStateFlow =
MutableStateFlow<PersistentList<Staff>>(persistentListOf())

override fun staff(): Flow<PersistentList<Staff>> {
return callbackFlow {
send(
staffApi
.staff()
.toPersistentList()
)
awaitClose { }
staffStateFlow.collect {
send(it)
}
}
}

override suspend fun refresh() {
staffStateFlow.value = staffApi
.staff()
.toPersistentList()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ public class FakeStaffRepository : StaffRepository {
override fun staff(): Flow<PersistentList<Staff>> {
return flowOf(staff)
}

override suspend fun refresh() {
}
}
1 change: 1 addition & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ dependencies {
kotlinCompilerPluginClasspath(libs.composeCompiler)
implementation(libs.coilCompose)
implementation(libs.composeUiGoogleFonts)
implementation(libs.accompanistPlaceholder)
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.github.droidkaigi.confsched2022.designsystem.components

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -14,9 +16,16 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil.compose.SubcomposeAsyncImage
import com.google.accompanist.placeholder.PlaceholderDefaults
import com.google.accompanist.placeholder.PlaceholderHighlight
import com.google.accompanist.placeholder.material.placeholder
import com.google.accompanist.placeholder.material.shimmerHighlightColor
import com.google.accompanist.placeholder.shimmer
import io.github.droidkaigi.confsched2022.designsystem.theme.KaigiColors

@Composable
fun UsernameRow(
Expand All @@ -39,11 +48,27 @@ fun UsernameRow(
) {
Spacer(modifier = Modifier.width(16.dp))

AsyncImage(
SubcomposeAsyncImage(
model = iconUrl,
contentDescription = null,
alignment = Alignment.Center,
contentScale = ContentScale.Fit,
loading = {
Box(
modifier = Modifier
.fillMaxSize()
.placeholder(
color = MaterialTheme.colorScheme.surfaceVariant,
visible = true,
highlight = PlaceholderHighlight.shimmer(
highlightColor = PlaceholderDefaults.shimmerHighlightColor(
backgroundColor = Color(KaigiColors.neutralVariantKeyColor60)
),
),
shape = CircleShape,
)
)
},
modifier = Modifier
.clip(CircleShape)
.size(60.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ public enum class DroidKaigi2022Day(
.toInstant(TimeZone.of("UTC+9"))
);

public val kaigiPlace: KaigiPlace
get() = if (this != Day3) {
KaigiPlace.Prism
} else {
KaigiPlace.Bellesalle
}

public companion object {
public fun ofOrNull(time: Instant): DroidKaigi2022Day? {
return values().firstOrNull() {
return values().firstOrNull {
time in it.start..it.end
}
}
}
}

public enum class KaigiPlace {
Prism,
Bellesalle
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ public data class DroidKaigiSchedule(
public fun DroidKaigiSchedule.Companion.fake(): DroidKaigiSchedule {
return of(Timetable.fake())
}

public fun DroidKaigiSchedule.Companion.empty(): DroidKaigiSchedule {
return of(Timetable())
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import kotlinx.coroutines.flow.Flow

public interface SponsorsRepository {
public fun sponsors(): Flow<PersistentList<Sponsor>>

public suspend fun refresh()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import kotlinx.coroutines.flow.Flow

public interface StaffRepository {
public fun staff(): Flow<PersistentList<Staff>>

public suspend fun refresh()
}
Loading

0 comments on commit cf43ce3

Please sign in to comment.