Skip to content

Commit

Permalink
Merge branch 'main' into fix_method_of_getting_version_names
Browse files Browse the repository at this point in the history
  • Loading branch information
syarihu authored Sep 7, 2023
2 parents 3e66444 + 169f2d1 commit 1913a99
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 84 deletions.
24 changes: 1 addition & 23 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id("droidkaigi.primitive.android.crashlytics")
id("droidkaigi.primitive.detekt")
id("droidkaigi.primitive.android.roborazzi")
id("droidkaigi.primitive.kover")
id("droidkaigi.primitive.kover.entrypoint")
id("droidkaigi.primitive.android.osslicenses")
}

Expand Down Expand Up @@ -116,25 +116,3 @@ dependencies {
implementation(libs.firebaseDynamicLinks)
testImplementation(projects.core.testing)
}

// Dependency configuration to aggregate Kover coverage reports
// TODO: extract report aggregation to build-logic
dependencies {
kover(projects.appIosShared)

kover(projects.feature.about)
kover(projects.feature.contributors)
kover(projects.feature.floorMap)
kover(projects.feature.main)
kover(projects.feature.sessions)
kover(projects.feature.sponsors)
kover(projects.feature.staff)
kover(projects.feature.achievements)

kover(projects.core.common)
kover(projects.core.data)
kover(projects.core.designsystem)
kover(projects.core.model)
kover(projects.core.testing)
kover(projects.core.ui)
}
1 change: 0 additions & 1 deletion app-ios-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
plugins {
id("droidkaigi.primitive.kmp")
id("droidkaigi.primitive.kmp.ios")
id("droidkaigi.primitive.kover")
}

kotlin {
Expand Down
6 changes: 3 additions & 3 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ gradlePlugin {
id = "droidkaigi.primitive.kmp.serialization"
implementationClass = "io.github.droidkaigi.confsched2023.primitive.KotlinSerializationPlugin"
}
register("kover") {
id = "droidkaigi.primitive.kover"
implementationClass = "io.github.droidkaigi.confsched2023.primitive.KoverPlugin"
register("koverEntryPoint") {
id = "droidkaigi.primitive.kover.entrypoint"
implementationClass = "io.github.droidkaigi.confsched2023.primitive.KoverEntryPointPlugin"
}
register("detekt") {
id = "droidkaigi.primitive.detekt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class AndroidFeaturePlugin : Plugin<Project> {
apply("droidkaigi.primitive.android.compose")
apply("droidkaigi.primitive.android.hilt")
apply("droidkaigi.primitive.android.roborazzi")
apply("droidkaigi.primitive.kover")
apply("droidkaigi.primitive.detekt")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure

class KoverPlugin : Plugin<Project> {
class KoverEntryPointPlugin : Plugin<Project> {
override fun apply(target: Project) {
val koverPlugin = "org.jetbrains.kotlinx.kover"
with(target) {
pluginManager.apply("org.jetbrains.kotlinx.kover")
pluginManager.apply(koverPlugin)

rootProject.subprojects {
if (this@subprojects.name == target.name) return@subprojects
this@subprojects.pluginManager.apply(koverPlugin)
target.dependencies.add("kover", this@subprojects)
}

configure<KoverReportExtension> {
filters {
Expand Down
1 change: 0 additions & 1 deletion core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id("droidkaigi.primitive.kmp.android")
id("droidkaigi.primitive.kmp.ios")
id("droidkaigi.primitive.kmp.android.hilt")
id("droidkaigi.primitive.kover")
id("droidkaigi.primitive.detekt")
}

Expand Down
1 change: 0 additions & 1 deletion core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id("droidkaigi.primitive.detekt")
id("droidkaigi.primitive.kmp.ktorfit")
id("droidkaigi.primitive.kmp.serialization")
id("droidkaigi.primitive.kover")
}

android.namespace = "io.github.droidkaigi.confsched2023.core.data"
Expand Down
1 change: 0 additions & 1 deletion core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id("droidkaigi.primitive.kmp.android.hilt")
id("droidkaigi.primitive.detekt")
id("droidkaigi.primitive.kmp.android.showkase")
id("droidkaigi.primitive.kover")
}

android.namespace = "io.github.droidkaigi.confsched2023.core.designsystem"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
package io.github.droidkaigi.confsched2023.designsystem.theme

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.platform.Font
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.resource

val fontMap: HashMap<String, FontFamily?> = HashMap()

Expand All @@ -20,21 +13,23 @@ val fontMap: HashMap<String, FontFamily?> = HashMap()
@ExperimentalResourceApi
@Composable
actual fun fontFamilyResource(fontResource: FontResource): FontFamily? {
var fontFamily: FontFamily? by
remember(fontResource.resName) { mutableStateOf(fontMap[fontResource.resName]) }
if (fontFamily == null) {
LaunchedEffect(fontResource.resName) {
fontFamily = try {
val font = Font(
fontResource.resName,
resource("font/${fontResource.resName}").readBytes(),
)
fontMap[fontResource.resName] = FontFamily(font)
fontMap[fontResource.resName]
} catch (e: Exception) {
throw IllegalArgumentException(e)
}
}
}
return fontFamily
// FIXME: Load the custom font in resources directory
return FontFamily.Default
// var fontFamily: FontFamily? by
// remember(fontResource.resName) { mutableStateOf(fontMap[fontResource.resName]) }
// if (fontFamily == null) {
// LaunchedEffect(fontResource.resName) {
// fontFamily = try {
// val font = Font(
// fontResource.resName,
// resource("font/${fontResource.resName}").readBytes(),
// )
// fontMap[fontResource.resName] = FontFamily(font)
// fontMap[fontResource.resName]
// } catch (e: Exception) {
// throw IllegalArgumentException(e)
// }
// }
// }
// return fontFamily
}
1 change: 0 additions & 1 deletion core/model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("droidkaigi.primitive.kmp")
id("droidkaigi.primitive.kmp.android")
id("droidkaigi.primitive.kmp.ios")
id("droidkaigi.primitive.kover")
id("droidkaigi.primitive.detekt")
}

Expand Down
1 change: 0 additions & 1 deletion core/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id("droidkaigi.primitive.android.kotlin")
id("droidkaigi.primitive.android.compose")
id("droidkaigi.primitive.android.hilt")
id("droidkaigi.primitive.kover")
id("droidkaigi.primitive.detekt")
}

Expand Down
1 change: 0 additions & 1 deletion core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id("droidkaigi.primitive.kmp.ios")
id("droidkaigi.primitive.kmp.compose")
id("droidkaigi.primitive.kmp.android.hilt")
id("droidkaigi.primitive.kover")
id("droidkaigi.primitive.detekt")
}

Expand Down
1 change: 0 additions & 1 deletion feature/contributors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id("droidkaigi.primitive.kmp.android.hilt")
id("droidkaigi.primitive.kmp.ios")
id("droidkaigi.primitive.kmp.compose")
id("droidkaigi.primitive.kover")
}

android.namespace = "io.github.droidkaigi.confsched2023.feature.contributors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
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 @@ -24,7 +23,6 @@ import androidx.compose.runtime.remember
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 io.github.droidkaigi.confsched2023.contributors.component.ContributorListItem
import io.github.droidkaigi.confsched2023.model.Contributor
Expand All @@ -42,7 +40,6 @@ fun ContributorsScreen(
isTopAppBarHidden: Boolean = false,
onNavigationIconClick: () -> Unit,
onContributorItemClick: (url: String) -> Unit,
contentPadding: PaddingValues = PaddingValues(),
) {
val uiState by viewModel.uiState.collectAsState()
val snackbarHostState = remember { SnackbarHostState() }
Expand All @@ -57,7 +54,6 @@ fun ContributorsScreen(
snackbarHostState = snackbarHostState,
onBackClick = onNavigationIconClick,
onContributorItemClick = onContributorItemClick,
contentPadding = contentPadding,
)
}

Expand All @@ -68,7 +64,6 @@ private fun ContributorsScreen(
snackbarHostState: SnackbarHostState,
onBackClick: () -> Unit,
onContributorItemClick: (url: String) -> Unit,
contentPadding: PaddingValues,
isTopAppBarHidden: Boolean,
) {
val scrollBehavior =
Expand All @@ -77,7 +72,6 @@ private fun ContributorsScreen(
} else {
null
}
val localLayoutDirection = LocalLayoutDirection.current
Scaffold(
modifier = Modifier.testTag(ContributorsScreenTestTag),
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
Expand All @@ -103,26 +97,20 @@ private fun ContributorsScreen(
)
}
},
contentWindowInsets = WindowInsets(
left = contentPadding.calculateLeftPadding(localLayoutDirection),
top = contentPadding.calculateTopPadding(),
right = contentPadding.calculateRightPadding(localLayoutDirection),
bottom = contentPadding.calculateBottomPadding(),
),
) { innerContentPadding ->
) { padding ->
Contributors(
contributors = uiState.contributors,
onContributorItemClick = onContributorItemClick,
modifier = Modifier
.fillMaxSize()
.padding(padding)
.let {
if (scrollBehavior != null) {
it.nestedScroll(scrollBehavior.nestedScrollConnection)
} else {
it
}
},
contentPadding = innerContentPadding,
)
}
}
Expand All @@ -132,11 +120,9 @@ private fun Contributors(
contributors: PersistentList<Contributor>,
onContributorItemClick: (url: String) -> Unit,
modifier: Modifier = Modifier,
contentPadding: PaddingValues,
) {
LazyColumn(
modifier = modifier,
contentPadding = contentPadding,
) {
items(contributors) {
ContributorListItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.droidkaigi.confsched2023.contributors
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.interop.LocalUIViewController
import androidx.compose.ui.window.ComposeUIViewController
import io.github.droidkaigi.confsched2023.designsystem.theme.KaigiTheme
import io.github.droidkaigi.confsched2023.model.ContributorsRepository
import io.github.droidkaigi.confsched2023.ui.UserMessageStateHolderImpl
import platform.UIKit.UIViewController
Expand All @@ -23,10 +24,12 @@ fun contributorViewController(
// viewModel.viewModelScope.cancel()
}

ContributorsScreen(
viewModel = viewModel,
isTopAppBarHidden = true,
onNavigationIconClick = { /** no action for iOS side **/ },
onContributorItemClick = onContributorItemClick,
)
KaigiTheme {
ContributorsScreen(
viewModel = viewModel,
isTopAppBarHidden = true,
onNavigationIconClick = { /** no action for iOS side **/ },
onContributorItemClick = onContributorItemClick,
)
}
}

0 comments on commit 1913a99

Please sign in to comment.