Skip to content

Commit

Permalink
Merge branch 'main' into feature/446-gridlines
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-b-stb authored Aug 20, 2024
2 parents 789657d + a0a5cc0 commit 7df2ad7
Show file tree
Hide file tree
Showing 272 changed files with 9,582 additions and 2,005 deletions.
3 changes: 0 additions & 3 deletions .github/configs/labeler.yml

This file was deleted.

44 changes: 25 additions & 19 deletions .github/workflows/ios-assign-reviewers.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
name: Auto assign iOS PR reviewers

on:
pull_request:
types: [opened, ready_for_review, labeled]
workflow_run:
workflows: ["save-pr-number-for-ios-assign-reviewers"]
types:
- completed

permissions:
actions: read # for downloading artifacts
contents: read # for accessing repository contents
pull-requests: write # for assign reviewers

jobs:
reviewers-assign:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}

timeout-minutes: 5
steps:
- name: Download PR number
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0
with:
name: pr_number
path: ./
run_id: ${{ github.event.workflow_run.id }}

- name: Read PR number
id: pr_number
run: echo "::set-output name=number::$(cat pr_number.txt)"

- name: Assign reviewers
uses: actions/github-script@v7
if: contains(github.event.pull_request.labels.*.name, 'type:iOS 🍎') && github.event.pull_request.draft == false
run: gh pr edit "$NUMBER" --add-reviewer "$IOS_REVIEWERS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ steps.pr_number.outputs.number }}
IOS_REVIEWERS: ${{ vars.IOS_REVIEWERS }}
with:
script: |
const { IOS_REVIEWERS } = process.env
const author = context.payload.pull_request.user.login;
const reviewers = IOS_REVIEWERS.split(',').filter(reviewer => reviewer !== author)
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
reviewers
});
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: iOS Build
name: iOS Build and Test

on:
push:
branches: [ "main" ]
pull_request:

concurrency:
group: ios-build-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-ios:
build-test-ios:
runs-on: macos-latest

steps:
Expand All @@ -20,3 +20,5 @@ jobs:
run: echo "arch=arm64" >> local.properties
- run: make build-app-debug
working-directory: app-ios
- run: make test-app-debug
working-directory: app-ios
36 changes: 26 additions & 10 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
name: 'PR Labeler'

on:
pull_request:
workflow_run:
workflows: ["save-pr-number-for-labeler"]
types:
- completed

permissions:
actions: read # for downloading artifacts
contents: read # for accessing repository contents
pull-requests: write # for add labels to pull requests

jobs:
label:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}

timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download PR number
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 # v2.27.0
with:
name: pr_number
path: ./
run_id: ${{ github.event.workflow_run.id }}

- name: Read PR number
id: pr_number
run: echo "::set-output name=number::$(cat pr_number.txt)"

- name: Add label
uses: actions/labeler@v5
with:
configuration-path: .github/configs/labeler.yml
run: gh pr edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ steps.pr_number.outputs.number }}
LABELS: type:iOS 🍎
20 changes: 20 additions & 0 deletions .github/workflows/save-pr-number-for-ios-assign-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: save-pr-number-for-ios-assign-reviewers

on:
pull_request:
types: [opened, ready_for_review, labeled]

jobs:
save_pr_number:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'type:iOS 🍎') && github.event.pull_request.draft == false

steps:
- name: Save PR number
run: |
echo ${{ github.event.pull_request.number }} > pr_number.txt
- name: Upload PR number
uses: actions/upload-artifact@v2
with:
name: pr_number
path: pr_number.txt
19 changes: 19 additions & 0 deletions .github/workflows/save-pr-number-for-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: save-pr-number-for-labeler

on:
pull_request:
paths:
- app-ios/**

jobs:
save_pr_number:
runs-on: ubuntu-latest
steps:
- name: Save PR number
run: |
echo ${{ github.event.pull_request.number }} > pr_number.txt
- name: Upload PR number
uses: actions/upload-artifact@v2
with:
name: pr_number
path: pr_number.txt
2 changes: 2 additions & 0 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation(projects.feature.about)
implementation(projects.feature.sponsors)
implementation(projects.feature.staff)
implementation(projects.feature.settings)
implementation(projects.feature.favorites)
implementation(projects.core.model)
implementation(projects.core.data)
Expand All @@ -115,6 +116,7 @@ dependencies {
implementation(libs.androidxWindow)
implementation(libs.kermit)
implementation(libs.firebaseDynamicLinks)
implementation(libs.androidxAppCompat)
debugImplementation(projects.core.testingManifest)
testImplementation(projects.core.testing)
testImplementation(libs.composablePreviewScanner)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.droidkaigi.confsched

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import dagger.hilt.android.HiltAndroidApp
import io.github.droidkaigi.confsched.data.di.ServerEnvironmentModule
import io.github.droidkaigi.confsched2024.BuildConfig
Expand All @@ -11,4 +12,9 @@ class App : Application(), ServerEnvironmentModule.HasServerEnvironment {
ServerEnvironmentModule.ServerEnvironment(
BuildConfig.SERVER_URL,
)

override fun onCreate() {
super.onCreate()
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ import androidx.annotation.RequiresApi
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.animation.ExperimentalSharedTransitionApi
import androidx.compose.animation.SharedTransitionLayout
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.displayCutout
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.windowsizeclass.WindowSizeClass
Expand All @@ -22,6 +29,8 @@ import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.font.FontFamily
import androidx.core.content.getSystemService
import androidx.core.net.toUri
import androidx.core.os.bundleOf
Expand All @@ -39,6 +48,7 @@ import io.github.droidkaigi.confsched.contributors.contributorsScreenRoute
import io.github.droidkaigi.confsched.contributors.contributorsScreens
import io.github.droidkaigi.confsched.designsystem.theme.ColorContrast
import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme
import io.github.droidkaigi.confsched.eventmap.eventMapScreenRoute
import io.github.droidkaigi.confsched.eventmap.eventMapScreens
import io.github.droidkaigi.confsched.eventmap.navigateEventMapScreen
import io.github.droidkaigi.confsched.favorites.favoritesScreenRoute
Expand All @@ -61,10 +71,14 @@ import io.github.droidkaigi.confsched.profilecard.navigateProfileCardScreen
import io.github.droidkaigi.confsched.profilecard.profileCardScreen
import io.github.droidkaigi.confsched.profilecard.profileCardScreenRoute
import io.github.droidkaigi.confsched.sessions.navigateTimetableScreen
import io.github.droidkaigi.confsched.sessions.navigateToSearchScreen
import io.github.droidkaigi.confsched.sessions.navigateToTimetableItemDetailScreen
import io.github.droidkaigi.confsched.sessions.nestedSessionScreens
import io.github.droidkaigi.confsched.sessions.searchScreens
import io.github.droidkaigi.confsched.sessions.sessionScreens
import io.github.droidkaigi.confsched.sessions.timetableScreenRoute
import io.github.droidkaigi.confsched.settings.settingsScreenRoute
import io.github.droidkaigi.confsched.settings.settingsScreens
import io.github.droidkaigi.confsched.share.ShareNavigator
import io.github.droidkaigi.confsched.sponsors.sponsorsScreenRoute
import io.github.droidkaigi.confsched.sponsors.sponsorsScreens
Expand All @@ -78,10 +92,13 @@ import kotlinx.collections.immutable.PersistentList
fun KaigiApp(
windowSize: WindowSizeClass,
displayFeatures: PersistentList<DisplayFeature>,
fontFamily: FontFamily?,
modifier: Modifier = Modifier,
) {
val layoutDirection = LocalLayoutDirection.current
KaigiTheme(
colorContrast = colorContrast(),
fontFamily = fontFamily,
) {
Surface(
modifier = modifier.fillMaxSize(),
Expand All @@ -90,6 +107,14 @@ fun KaigiApp(
KaigiNavHost(
windowSize = windowSize,
displayFeatures = displayFeatures,
modifier = Modifier.padding(
start = WindowInsets.displayCutout
.asPaddingValues()
.calculateStartPadding(layoutDirection),
end = WindowInsets.displayCutout
.asPaddingValues()
.calculateEndPadding(layoutDirection),
),
)
}
}
Expand All @@ -101,10 +126,11 @@ private fun KaigiNavHost(
windowSize: WindowSizeClass,
@Suppress("UnusedParameter")
displayFeatures: PersistentList<DisplayFeature>,
modifier: Modifier = Modifier,
navController: NavHostController = rememberNavController(),
externalNavController: ExternalNavController = rememberExternalNavController(),
) {
SharedTransitionLayout {
SharedTransitionLayout(modifier = modifier) {
CompositionLocalProvider(
LocalSharedTransitionScope provides this,
) {
Expand All @@ -118,22 +144,37 @@ private fun KaigiNavHost(
onLinkClick = externalNavController::navigate,
onCalendarRegistrationClick = externalNavController::navigateToCalendarRegistration,
onShareClick = externalNavController::onShareClick,
onFavoriteListClick = { navController.navigate(favoritesScreenRoute) },
)

contributorsScreens(
onNavigationIconClick = navController::popBackStack,
onContributorItemClick = externalNavController::navigate,
)

searchScreens(
onTimetableItemClick = navController::navigateToTimetableItemDetailScreen,
onBackClick = navController::popBackStack,
)

staffScreens(
onNavigationIconClick = navController::popBackStack,
onStaffItemClick = externalNavController::navigate,
)

settingsScreens(
onNavigationIconClick = navController::popBackStack,
)

sponsorsScreens(
onNavigationIconClick = navController::popBackStack,
onSponsorsItemClick = externalNavController::navigate,
)

favoritesScreens(
onTimetableItemClick = navController::navigateToTimetableItemDetailScreen,
contentPadding = PaddingValues(),
)
}
}
}
Expand All @@ -151,6 +192,7 @@ private fun NavGraphBuilder.mainScreen(
mainNestedGraph = { mainNestedNavController, contentPadding ->
nestedSessionScreens(
modifier = Modifier,
onSearchClick = navController::navigateToSearchScreen,
onTimetableItemClick = navController::navigateToTimetableItemDetailScreen,
contentPadding = contentPadding,
)
Expand All @@ -173,6 +215,7 @@ private fun NavGraphBuilder.mainScreen(
AboutItem.Map -> externalNavController.navigate(
url = "https://goo.gl/maps/vv9sE19JvRjYKtSP9",
)

AboutItem.Sponsors -> navController.navigate(sponsorsScreenRoute)
AboutItem.CodeOfConduct -> {
externalNavController.navigate(
Expand All @@ -192,6 +235,8 @@ private fun NavGraphBuilder.mainScreen(
)
}

AboutItem.Settings -> navController.navigate(settingsScreenRoute)

AboutItem.Staff -> navController.navigate(staffScreenRoute)
AboutItem.X -> externalNavController.navigate(
url = "https://twitter.com/DroidKaigi",
Expand All @@ -214,6 +259,7 @@ class KaigiAppMainNestedGraphStateHolder : MainNestedGraphStateHolder {
override fun routeToTab(route: String): MainScreenTab? {
return when (route) {
timetableScreenRoute -> Timetable
eventMapScreenRoute -> EventMap
profileCardScreenRoute -> ProfileCard
aboutScreenRoute -> About
favoritesScreenRoute -> Favorite
Expand Down Expand Up @@ -339,7 +385,7 @@ private class ExternalNavController(
val specializedActivityIntent = Intent(Intent.ACTION_VIEW, uri)
.addCategory(Intent.CATEGORY_BROWSABLE)
val resolvedSpecializedList: MutableSet<String> =
pm.queryIntentActivities(browserActivityIntent, 0)
pm.queryIntentActivities(specializedActivityIntent, 0)
.map { it.activityInfo.packageName }
.toMutableSet()

Expand Down
Loading

0 comments on commit 7df2ad7

Please sign in to comment.