Skip to content

Commit

Permalink
Merge branch 'main' into feature/adding_tests_to_BookmarkScreenTest
Browse files Browse the repository at this point in the history
  • Loading branch information
hiesiea committed Aug 29, 2023
2 parents bf00417 + 46d7bf5 commit 0412cf4
Show file tree
Hide file tree
Showing 24 changed files with 303 additions and 74 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/Analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Analyze

on:
pull_request:
workflow_dispatch:

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

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- uses: ./.github/actions/setup-java

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Build project
run: ./gradlew :app-android:assemble --stacktrace

- name: Perform analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ private fun NavGraphBuilder.mainScreen(
windowSize = windowSize,
displayFeatures = displayFeatures,
mainNestedGraphStateHolder = KaigiAppMainNestedGraphStateHolder(),
mainNestedGraph = { mainNestedNavController, _ ->
mainNestedGraph = { mainNestedNavController, contentPadding ->
nestedSessionScreens(
modifier = Modifier,
onSearchClick = navController::navigateSearchScreen,
onTimetableItemClick = navController::navigateToTimetableItemDetailScreen,
onBookmarkIconClick = navController::navigateToBookmarkScreen,
contentPadding = contentPadding,
)
nestedAboutScreen(
onAboutItemClick = { aboutItem ->
Expand All @@ -160,15 +161,18 @@ private fun NavGraphBuilder.mainScreen(
}
},
onLinkClick = externalNavController::navigate,
contentPadding = contentPadding,
)
nestedFloorMapScreen(
windowSize = windowSize,
onSideEventClick = externalNavController::navigate,
contentPadding = contentPadding,
)
nestedStampsScreen(
onStampsClick = {
// TODO
},
contentPadding = contentPadding,
)
// For KMP, we are not using navigation abstraction for contributors screen
composable(contributorsScreenRoute) {
Expand All @@ -182,6 +186,7 @@ private fun NavGraphBuilder.mainScreen(
)
},
onContributorItemClick = externalNavController::navigate,
contentPadding = contentPadding,
)
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "bookmarks.pdf",
"filename" : "trailing-icon 2.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions app-ios/Modules/Sources/Timetable/TimetableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ public struct TimetableView<SessionView: View>: View {
NavigationLink(value: TimetableRouting.search) {
Assets.Icons.search.swiftUIImage
}
.buttonStyle(.plain)
}
ToolbarItem {
NavigationLink(value: TimetableRouting.bookmark) {
Assets.Icons.bookmarks.swiftUIImage
}
.buttonStyle(.plain)
}
ToolbarItem {
Assets.Icons.gridView.swiftUIImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Context
import android.content.pm.PackageManager.PackageInfoFlags
import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.ExperimentalMaterial3Api
Expand All @@ -17,7 +17,6 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
Expand All @@ -41,11 +40,13 @@ const val aboutScreenRoute = "about"
fun NavGraphBuilder.nestedAboutScreen(
onAboutItemClick: (AboutItem) -> Unit,
onLinkClick: (url: String) -> Unit,
contentPadding: PaddingValues,
) {
composable(aboutScreenRoute) {
AboutScreen(
onAboutItemClick = onAboutItemClick,
onLinkClick = onLinkClick,
contentPadding = contentPadding,
)
}
}
Expand All @@ -63,6 +64,7 @@ const val AboutScreenTestTag = "AboutScreen"
fun AboutScreen(
onAboutItemClick: (AboutItem) -> Unit,
viewModel: AboutScreenViewModel = hiltViewModel<AboutScreenViewModel>(),
contentPadding: PaddingValues = PaddingValues(),
onLinkClick: (url: String) -> Unit,
) {
// val uiState by viewModel.uiState.collectAsState()
Expand All @@ -80,6 +82,7 @@ fun AboutScreen(
onAboutItemClick = onAboutItemClick,
versionName = versionName,
onLinkClick = onLinkClick,
contentPadding = contentPadding,
)
}

Expand All @@ -93,8 +96,10 @@ private fun AboutScreen(
onAboutItemClick: (AboutItem) -> Unit,
versionName: String?,
onLinkClick: (url: String) -> Unit,
contentPadding: PaddingValues,
) {
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior()
val layoutDirection = LocalLayoutDirection.current
Scaffold(
modifier = Modifier.testTag(AboutScreenTestTag),
topBar = {
Expand All @@ -118,15 +123,17 @@ private fun AboutScreen(
)
},
snackbarHost = { SnackbarHost(snackbarHostState) },
contentWindowInsets = WindowInsets(
left = contentPadding.calculateLeftPadding(layoutDirection),
top = contentPadding.calculateTopPadding(),
right = contentPadding.calculateRightPadding(layoutDirection),
bottom = contentPadding.calculateBottomPadding(),
),
content = { padding ->
LazyColumn(
Modifier
.padding(
top = padding.calculateTopPadding(),
start = padding.calculateStartPadding(LocalLayoutDirection.current),
end = padding.calculateEndPadding(LocalLayoutDirection.current),
)
.nestedScroll(scrollBehavior.nestedScrollConnection),
contentPadding = padding,
) {
item {
AboutDroidKaigiDetail(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.droidkaigi.confsched2023.contributors

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
Expand All @@ -21,8 +21,8 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched2023.contributors.component.ContributorListItem
import io.github.droidkaigi.confsched2023.model.Contributor
import kotlinx.collections.immutable.PersistentList
Expand All @@ -36,13 +36,15 @@ data class ContributorsUiState(val contributors: PersistentList<Contributor>)
fun ContributorsScreen(
viewModel: ContributorsViewModel,
onNavigationIconClick: () -> Unit,
onContributorItemClick: (url: String) -> Unit
onContributorItemClick: (url: String) -> Unit,
contentPadding: PaddingValues = PaddingValues(),
) {
val uiState by viewModel.uiState.collectAsState()
ContributorsScreen(
uiState = uiState,
onBackClick = onNavigationIconClick,
onContributorItemClick = onContributorItemClick
onContributorItemClick = onContributorItemClick,
contentPadding = contentPadding,
)
}

Expand All @@ -52,8 +54,10 @@ private fun ContributorsScreen(
uiState: ContributorsUiState,
onBackClick: () -> Unit,
onContributorItemClick: (url: String) -> Unit,
contentPadding: PaddingValues,
) {
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
val localLayoutDirection = LocalLayoutDirection.current
Scaffold(
modifier = Modifier.testTag(ContributorsScreenTestTag),
topBar = {
Expand All @@ -76,15 +80,20 @@ private fun ContributorsScreen(
scrollBehavior = scrollBehavior
)
},
contentWindowInsets = WindowInsets(0.dp),
) { padding ->
contentWindowInsets = WindowInsets(
left = contentPadding.calculateLeftPadding(localLayoutDirection),
top = contentPadding.calculateTopPadding(),
right = contentPadding.calculateRightPadding(localLayoutDirection),
bottom = contentPadding.calculateBottomPadding(),
),
) { innerContentPadding ->
Contributors(
contributors = uiState.contributors,
onContributorItemClick = onContributorItemClick,
modifier = Modifier
.fillMaxSize()
.padding(padding)
.nestedScroll(scrollBehavior.nestedScrollConnection)
.nestedScroll(scrollBehavior.nestedScrollConnection),
contentPadding = innerContentPadding,
)
}
}
Expand All @@ -94,10 +103,11 @@ private fun Contributors(
contributors: PersistentList<Contributor>,
onContributorItemClick: (url: String) -> Unit,
modifier: Modifier = Modifier,
contentPadding: PaddingValues,
) {
// FIXME: Bottom Inset not implemented
LazyColumn(
modifier = modifier
modifier = modifier,
contentPadding = contentPadding,
) {
items(contributors) {
ContributorListItem(
Expand Down
Loading

0 comments on commit 0412cf4

Please sign in to comment.