Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,8 @@ internal class RootNodeOwner(
override val semanticsOwner = SemanticsOwner(root, rootSemanticsNode, layoutNodes)
override val windowInfo get() = platformContext.windowInfo

//TODO https://youtrack.jetbrains.com/issue/CMP-10709/Support-mediaQuery-derivedMediaQuery
@ExperimentalMediaQueryApi
override val uiMediaScope: UiMediaScope? get() = null
override val uiMediaScope: UiMediaScope get() = platformContext.mediaScope
override val retainedValuesStore: RetainedValuesStore get() = ForgetfulRetainedValuesStore
override val rectManager = RectManager(layoutNodes)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import androidx.compose.runtime.ProvidedValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.LocalSaveableStateRegistry
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.ExperimentalMediaQueryApi
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.LocalUiMediaScope
import androidx.lifecycle.LifecycleOwner
import androidx.savedstate.compose.LocalSavedStateRegistryOwner

Expand Down Expand Up @@ -67,7 +65,6 @@ val LocalPlatformPrefetchScheduler = staticCompositionLocalOf<PlatformPrefetchSc
error("CompositionLocal LocalPlatformPrefetchScheduler not present")
}

@OptIn(ExperimentalMediaQueryApi::class)
@Composable
internal fun ProvidePlatformCompositionLocals(
vararg values: ProvidedValue<*>,
Expand Down Expand Up @@ -95,7 +92,6 @@ internal fun ProvidePlatformCompositionLocals(
LocalPlatformScreenReader provides platformContext.screenReader,
LocalPlatformWindowInsets provides platformContext.windowInsets,
LocalPlatformPrefetchScheduler provides platformContext.prefetchScheduler,
LocalUiMediaScope provides platformContext.mediaScope,
androidx.lifecycle.compose.LocalLifecycleOwner provides platformContext.architectureComponentsOwner.lifecycleOwner,
LocalSavedStateRegistryOwner provides platformContext.architectureComponentsOwner.savedStateRegistryOwner,
LocalSaveableStateRegistry provides saveableStateRegistry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface PlatformContext {
* using media state remains safe on platforms that do not provide a richer
* implementation.
*/
@OptIn(ExperimentalMediaQueryApi::class)
@ExperimentalMediaQueryApi
val mediaScope: UiMediaScope get() = EmptyMediaScope

interface RootForTestListener {
Expand Down Expand Up @@ -411,7 +411,7 @@ private object NoOpHapticFeedback : HapticFeedback {
override fun performHapticFeedback(hapticFeedbackType: HapticFeedbackType) = Unit
}

@OptIn(ExperimentalMediaQueryApi::class)
@ExperimentalMediaQueryApi
private object EmptyMediaScope : UiMediaScope {
override val windowPosture: UiMediaScope.Posture
get() = UiMediaScope.Posture.Flat
Expand All @@ -429,4 +429,4 @@ private object EmptyMediaScope : UiMediaScope {
get() = false
override val viewingDistance: UiMediaScope.ViewingDistance
get() = UiMediaScope.ViewingDistance.Near
}
}
Loading