File tree Expand file tree Collapse file tree 8 files changed +113
-7
lines changed
ui-test/src/linuxMain/kotlin/androidx/compose/ui/test
darwinMain/kotlin/androidx/compose/ui
jsNativeMain/kotlin/androidx/compose/ui
jsWasmMain/kotlin/androidx/compose/ui
linuxMain/kotlin/androidx/compose/ui Expand file tree Collapse file tree 8 files changed +113
-7
lines changed Original file line number Diff line number Diff line change 1616
1717package androidx.compose.ui.test
1818
19+ import androidx.compose.ui.platform.ComposeUiMainDispatcher
1920import kotlinx.cinterop.ExperimentalForeignApi
2021import kotlinx.cinterop.cValue
21- import kotlinx.coroutines.Dispatchers
2222import kotlinx.coroutines.runBlocking
2323import platform.posix.nanosleep
2424import platform.posix.timespec
@@ -32,7 +32,7 @@ internal actual fun <T> runOnUiThread(action: () -> T): T {
3232 return if (isOnUiThread()) {
3333 action()
3434 } else {
35- runBlocking(Dispatchers . Main ) {
35+ runBlocking(ComposeUiMainDispatcher ) {
3636 action()
3737 }
3838 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package androidx.compose.ui
18+
19+ import kotlin.coroutines.CoroutineContext
20+ import kotlinx.coroutines.Dispatchers
21+
22+ internal actual val PostDelayedDispatcher : CoroutineContext
23+ get() = Dispatchers .Main
File renamed without changes.
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ package androidx.compose.ui
1818
1919import androidx.compose.ui.node.ModifierNodeElement
2020import androidx.compose.ui.platform.InspectorInfo
21- import kotlin.coroutines.CoroutineContext
22- import kotlinx.coroutines.Dispatchers
2321import kotlinx.coroutines.CancellationException
2422
2523internal actual fun classKeyForObject (a : Any ): Any {
@@ -33,6 +31,3 @@ internal actual fun InspectorInfo.tryPopulateReflectively(
3331 element : ModifierNodeElement <* >
3432) {
3533}
36-
37- internal actual val PostDelayedDispatcher : CoroutineContext
38- get() = Dispatchers .Main
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package androidx.compose.ui
18+
19+ import kotlin.coroutines.CoroutineContext
20+ import kotlinx.coroutines.Dispatchers
21+
22+ internal actual val PostDelayedDispatcher : CoroutineContext
23+ get() = Dispatchers .Main
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package androidx.compose.ui
18+
19+ import androidx.compose.ui.platform.ComposeUiMainDispatcher
20+ import kotlin.coroutines.CoroutineContext
21+
22+ internal actual val PostDelayedDispatcher : CoroutineContext
23+ get() = ComposeUiMainDispatcher
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2025 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package androidx.compose.ui.platform
18+
19+ import kotlinx.coroutines.CoroutineDispatcher
20+
21+ lateinit var ComposeUiMainDispatcher : CoroutineDispatcher // TODO: https://github.com/Kotlin/kotlinx.coroutines/issues/4286
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package androidx.compose.ui.platform
18+
19+ import kotlinx.coroutines.CoroutineDispatcher
20+
21+ internal actual val GlobalSnapshotManagerDispatcher : CoroutineDispatcher get() = ComposeUiMainDispatcher
You can’t perform that action at this time.
0 commit comments