Skip to content

Commit

Permalink
Merge pull request #1020 from sanao1006/fix/KaigiAppCompositionLocalP…
Browse files Browse the repository at this point in the history
…rovider-into-regular-methods

Extract KaigiAppCompositionLocalProvider into regular methods
  • Loading branch information
takahirom authored Sep 9, 2024
2 parents 1ccf1fe + 194f5b1 commit 643d3d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
Expand All @@ -21,8 +22,9 @@ import androidx.window.layout.WindowInfoTracker
import dagger.hilt.android.AndroidEntryPoint
import io.github.droidkaigi.confsched.data.di.RepositoryProvider
import io.github.droidkaigi.confsched.designsystem.theme.dotGothic16FontFamily
import io.github.droidkaigi.confsched.droidkaigiui.KaigiAppCompositionLocalProvider
import io.github.droidkaigi.confsched.droidkaigiui.ProvideAndroidContextToComposeResource
import io.github.droidkaigi.confsched.droidkaigiui.compositionlocal.LocalClock
import io.github.droidkaigi.confsched.droidkaigiui.isTest
import io.github.droidkaigi.confsched.model.FontFamily.DotGothic16Regular
import io.github.droidkaigi.confsched.model.FontFamily.SystemDefault
import io.github.droidkaigi.confsched.model.Settings.DoesNotExists
Expand Down Expand Up @@ -90,11 +92,10 @@ class MainActivity : ComponentActivity() {
}
}

KaigiAppCompositionLocalProvider(
locals = arrayOf(
LocalClock provides clockProvider.clock(),
),
) {
CompositionLocalProvider(LocalClock provides clockProvider.clock()) {
if (isTest()) {
ProvideAndroidContextToComposeResource()
}
repositoryProvider.Provide {
KaigiApp(
windowSize = windowSize,
Expand Down

This file was deleted.

0 comments on commit 643d3d9

Please sign in to comment.