Skip to content

Commit 1745adc

Browse files
authored
Merge pull request #1780 from google/bumptobeta
Raise Compose version to 1.7.0-beta04
2 parents 57907e1 + 9ef8273 commit 1745adc

File tree

18 files changed

+117
-90
lines changed

18 files changed

+117
-90
lines changed

.github/workflows/build.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# Allow tests to continue on other devices if they fail on one device.
8282
fail-fast: false
8383
matrix:
84-
api-level: [ 22, 26, 29 ]
84+
api-level: [ 22, 26, 30 ]
8585
shard: [ 0, 1 ] # Need to update shard-count below if this changes
8686

8787
env:
@@ -96,6 +96,12 @@ jobs:
9696
- name: Copy CI gradle.properties
9797
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
9898

99+
- name: Enable KVM
100+
run: |
101+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
102+
sudo udevadm control --reload-rules
103+
sudo udevadm trigger --name-match=kvm
104+
99105
- name: Setup java
100106
uses: actions/setup-java@v3
101107
with:
@@ -126,7 +132,7 @@ jobs:
126132
API_LEVEL: ${{ matrix.api-level }}
127133
run: |
128134
ARCH="x86"
129-
if [ "$API_LEVEL" -ge "31" ]; then
135+
if [ "$API_LEVEL" -ge "29" ]; then
130136
ARCH="x86_64"
131137
fi
132138
echo "ARCH=$ARCH" >> $GITHUB_OUTPUT

.idea/deploymentTargetSelector.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowlayout/src/sharedTest/kotlin/com/google/accompanist/flowlayout/LayoutTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ open class LayoutTest {
6060
size: Ref<IntSize>,
6161
position: Ref<Offset>,
6262
positionedLatch: CountDownLatch
63-
): Modifier = this then onGloballyPositioned { coordinates ->
63+
): Modifier = onGloballyPositioned { coordinates ->
6464
size.value = IntSize(coordinates.size.width, coordinates.size.height)
6565
position.value = coordinates.localToRoot(Offset(0f, 0f))
6666
positionedLatch.countDown()

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000
3333

3434
GROUP=com.google.accompanist
3535
# !! No longer need to update this manually when using a Compose SNAPSHOT
36-
VERSION_NAME=0.35.2-SNAPSHOT
36+
VERSION_NAME=0.35.2-beta
3737

3838
POM_DESCRIPTION=Utilities for Jetpack Compose
3939

gradle/libs.versions.toml

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[versions]
22

3-
compose = "1.7.0-alpha02"
3+
compose = "1.7.0-beta07"
44
composeCompiler = "1.5.8"
55
composeMaterial3 = "1.0.1"
66
composesnapshot = "-" # a single character = no snapshot
77

88
dokka = "1.8.10"
99

1010
# gradlePlugin and lint need to be updated together
11-
gradlePlugin = "8.2.2"
11+
gradlePlugin = "8.5.2"
1212
lintMinCompose = "30.0.0"
1313

1414
ktlint = "0.45.2"
@@ -18,8 +18,8 @@ okhttp = "3.12.13"
1818
coil = "1.3.2"
1919

2020
androidlint = "25.3.0"
21-
androidxtest = "1.4.0"
22-
androidxnavigation = "2.7.0-alpha01"
21+
androidxtest = "1.6.1"
22+
androidxnavigation = "2.7.7"
2323
androidxWindow = "1.0.0"
2424

2525
metalava = "0.3.2"
@@ -68,8 +68,8 @@ coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
6868

6969
androidx-appcompat = "androidx.appcompat:appcompat:1.4.2"
7070
androidx-core = "androidx.core:core-ktx:1.8.0"
71-
androidx-activity-compose = "androidx.activity:activity-compose:1.7.2"
72-
androidx-fragment = "androidx.fragment:fragment-ktx:1.5.1"
71+
androidx-activity-compose = "androidx.activity:activity-compose:1.9.0"
72+
androidx-fragment = "androidx.fragment:fragment-ktx:1.8.1"
7373
androidx-dynamicanimation = "androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03"
7474
androidx-lifecycle-runtime = "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
7575
androidx-lifecycle-viewmodel-compose = "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1"
@@ -82,19 +82,18 @@ androidx-navigation-testing = { module = "androidx.navigation:navigation-testing
8282

8383
mdc = "com.google.android.material:material:1.8.0"
8484

85-
androidx-test-core = "androidx.test:core-ktx:1.5.0-alpha02"
86-
androidx-test-runner = "androidx.test:runner:1.5.0-alpha04"
85+
androidx-test-core = "androidx.test:core-ktx:1.6.1"
86+
androidx-test-runner = "androidx.test:runner:1.6.1"
8787
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxtest" }
88-
androidx-test-orchestrator = "androidx.test:orchestrator:1.4.1"
89-
androidx-test-uiAutomator = "androidx.test.uiautomator:uiautomator:2.2.0"
88+
androidx-test-orchestrator = "androidx.test:orchestrator:1.5.0"
89+
androidx-test-uiAutomator = "androidx.test.uiautomator:uiautomator:2.3.0"
9090

91-
# alpha for robolectric x compose fix
92-
androidx-test-espressoCore = "androidx.test.espresso:espresso-core:3.5.1"
93-
androidx-test-espressoWeb = "androidx.test.espresso:espresso-web:3.5.1"
91+
androidx-test-espressoCore = "androidx.test.espresso:espresso-core:3.6.1"
92+
androidx-test-espressoWeb = "androidx.test.espresso:espresso-web:3.6.1"
9493

9594
junit = "junit:junit:4.13.2"
96-
truth = "com.google.truth:truth:1.1.2"
97-
robolectric = "org.robolectric:robolectric:4.9"
95+
truth = "com.google.truth:truth:1.1.3"
96+
robolectric = "org.robolectric:robolectric:4.12.1"
9897

9998
affectedmoduledetector = "com.dropbox.affectedmoduledetector:affectedmoduledetector:0.1.2"
10099

@@ -103,7 +102,7 @@ android-tools-lint-lint = { module = "com.android.tools.lint:lint", version.ref
103102
android-tools-lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lintMinCompose" }
104103
android-tools-lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lintMinCompose" }
105104

106-
squareup-mockwebserver = "com.squareup.okhttp3:mockwebserver:4.9.3"
105+
squareup-mockwebserver = "com.squareup.okhttp3:mockwebserver:4.10.0"
107106

108107
[plugins]
109108
android-application = { id = "com.android.application", version.ref = "gradlePlugin" }
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#Wed Jul 10 11:49:25 AEST 2024
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
45
networkTimeout=10000
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

navigation-material/src/androidTest/java/com/google/accompanist/navigation.material/SheetContentHostTest.kt

+12-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ import androidx.compose.material.Text
2828
import androidx.compose.runtime.Composable
2929
import androidx.compose.runtime.LaunchedEffect
3030
import androidx.compose.runtime.State
31+
import androidx.compose.runtime.getValue
3132
import androidx.compose.runtime.mutableStateOf
33+
import androidx.compose.runtime.remember
3234
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
35+
import androidx.compose.runtime.setValue
3336
import androidx.compose.ui.Modifier
37+
import androidx.compose.ui.layout.onPlaced
3438
import androidx.compose.ui.platform.testTag
3539
import androidx.compose.ui.test.junit4.ComposeContentTestRule
3640
import androidx.compose.ui.test.junit4.createComposeRule
@@ -174,10 +178,8 @@ internal class SheetContentHostTest {
174178
onSheetDismissed: (NavBackStackEntry) -> Unit
175179
) {
176180
setContent {
181+
var anchored by remember { mutableStateOf(false) }
177182
val saveableStateHolder = rememberSaveableStateHolder()
178-
LaunchedEffect(backStackEntry.value) {
179-
if (backStackEntry.value == null) sheetState.hide() else sheetState.show()
180-
}
181183
ModalBottomSheetLayout(
182184
sheetContent = {
183185
SheetContentHost(
@@ -189,6 +191,7 @@ internal class SheetContentHostTest {
189191
)
190192
},
191193
sheetState = sheetState,
194+
modifier = Modifier.onPlaced { anchored = true },
192195
content = {
193196
Box(
194197
Modifier
@@ -197,6 +200,12 @@ internal class SheetContentHostTest {
197200
)
198201
}
199202
)
203+
204+
if (anchored) {
205+
LaunchedEffect(backStackEntry.value) {
206+
if (backStackEntry.value == null) sheetState.hide() else sheetState.show()
207+
}
208+
}
200209
}
201210
}
202211

permissions/src/androidTest/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1818

1919
<uses-permission android:name="android.permission.CAMERA" />
20-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
20+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
2121

2222
<application>
2323
<activity

permissions/src/androidTest/java/com/google/accompanist/permissions/MultipleAndSinglePermissionsTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class MultipleAndSinglePermissionsTest {
158158
composeTestRule.setContent {
159159
ComposableUnderTest(
160160
listOf(
161-
android.Manifest.permission.READ_EXTERNAL_STORAGE,
161+
android.Manifest.permission.ACCESS_FINE_LOCATION,
162162
android.Manifest.permission.CAMERA
163163
)
164164
)
@@ -181,7 +181,7 @@ class MultipleAndSinglePermissionsTest {
181181
composeTestRule.setContent {
182182
ComposableUnderTest(
183183
listOf(
184-
android.Manifest.permission.READ_EXTERNAL_STORAGE,
184+
android.Manifest.permission.ACCESS_FINE_LOCATION,
185185
android.Manifest.permission.CAMERA
186186
)
187187
)

permissions/src/androidTest/java/com/google/accompanist/permissions/MultiplePermissionsStateTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ class MultiplePermissionsStateTest {
3737
@get:Rule
3838
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
3939
"android.permission.CAMERA",
40-
"android.permission.READ_EXTERNAL_STORAGE"
40+
"android.permission.ACCESS_FINE_LOCATION"
4141
)
4242

4343
@Test
4444
fun permissionState_hasPermission() {
4545
composeTestRule.setContent {
4646
val state = rememberMultiplePermissionsState(
4747
listOf(
48-
android.Manifest.permission.READ_EXTERNAL_STORAGE,
48+
android.Manifest.permission.ACCESS_FINE_LOCATION,
4949
android.Manifest.permission.CAMERA
5050
)
5151
)
@@ -65,7 +65,7 @@ class MultiplePermissionsStateTest {
6565
val state = rememberMultiplePermissionsState(
6666
listOf(
6767
android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
68-
android.Manifest.permission.READ_EXTERNAL_STORAGE,
68+
android.Manifest.permission.ACCESS_FINE_LOCATION,
6969
android.Manifest.permission.CAMERA
7070
)
7171
)

permissions/src/androidTest/java/com/google/accompanist/permissions/PermissionStateTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PermissionStateTest {
4949

5050
@Test
5151
fun permissionTest_shouldShowRationale() {
52-
val permission = android.Manifest.permission.WRITE_EXTERNAL_STORAGE
52+
val permission = android.Manifest.permission.ACCESS_FINE_LOCATION
5353
composeTestRule.activity.shouldShowRequestPermissionRationale = mapOf(
5454
permission to true
5555
)

permissions/src/androidTest/java/com/google/accompanist/permissions/RequestMultiplePermissionsTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class RequestMultiplePermissionsTest {
105105
// This is cheating, I know, but the order in which the system request the permissions
106106
// is unpredictable. Therefore, we need to grant both to make this test deterministic.
107107
grantPermissionProgrammatically("android.permission.CAMERA")
108-
grantPermissionProgrammatically("android.permission.READ_EXTERNAL_STORAGE")
108+
grantPermissionProgrammatically("android.permission.ACCESS_FINE_LOCATION")
109109
simulateAppComingFromTheBackground(composeTestRule)
110110
composeTestRule.activityRule.scenario.onActivity {
111111
it.setContent { ComposableUnderTest() }
@@ -119,7 +119,7 @@ class RequestMultiplePermissionsTest {
119119
private fun ComposableUnderTest() {
120120
val state = rememberMultiplePermissionsState(
121121
listOf(
122-
android.Manifest.permission.READ_EXTERNAL_STORAGE,
122+
android.Manifest.permission.ACCESS_FINE_LOCATION,
123123
android.Manifest.permission.CAMERA
124124
)
125125
)

permissions/src/androidTest/java/com/google/accompanist/permissions/RequestPermissionTest.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class RequestPermissionTest {
7474
composeTestRule.onNodeWithText("No permission").assertIsDisplayed()
7575
}
7676

77+
@SdkSuppress(minSdkVersion = 29) // Flaky below
7778
@FlakyTest
7879
@Test
7980
fun permissionTest_grantInTheBackground() {
@@ -86,12 +87,14 @@ class RequestPermissionTest {
8687
composeTestRule.onNodeWithText("No permission").assertIsDisplayed()
8788

8889
// This simulates the user going to the Settings screen and granting the permission
89-
grantPermissionProgrammatically("android.permission.CAMERA")
90+
grantPermissionProgrammatically(android.Manifest.permission.CAMERA)
9091
simulateAppComingFromTheBackground(composeTestRule)
9192
composeTestRule.activityRule.scenario.onActivity {
9293
it.setContent { ComposableUnderTest() }
9394
}
9495

96+
composeTestRule.waitForIdle()
97+
9598
composeTestRule.onNodeWithText("Granted").assertIsDisplayed()
9699
}
97100

0 commit comments

Comments
 (0)