Skip to content

Commit

Permalink
Extract KaigiAppCompositionLocalProvider into regular methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sanao1006 committed Sep 9, 2024
1 parent 75ed6fe commit 194f5b1
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 194f5b1

Please sign in to comment.