diff --git a/buildSrc/src/main/java/dev/chrisbanes/accompanist/buildsrc/dependencies.kt b/buildSrc/src/main/java/dev/chrisbanes/accompanist/buildsrc/dependencies.kt index a1bea9d54..3f7b31175 100644 --- a/buildSrc/src/main/java/dev/chrisbanes/accompanist/buildsrc/dependencies.kt +++ b/buildSrc/src/main/java/dev/chrisbanes/accompanist/buildsrc/dependencies.kt @@ -58,8 +58,8 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.0.0-alpha02" - + const val version = "1.0.0-alpha03" + const val runtime = "androidx.compose.runtime:runtime:$version" const val foundation = "androidx.compose.foundation:foundation:${version}" const val layout = "androidx.compose.foundation:foundation-layout:${version}" diff --git a/coil/src/androidTest/java/dev/chrisbanes/accompanist/coil/CoilTest.kt b/coil/src/androidTest/java/dev/chrisbanes/accompanist/coil/CoilTest.kt index 5000222ca..42be0b188 100644 --- a/coil/src/androidTest/java/dev/chrisbanes/accompanist/coil/CoilTest.kt +++ b/coil/src/androidTest/java/dev/chrisbanes/accompanist/coil/CoilTest.kt @@ -91,7 +91,7 @@ class CoilTest { // Wait for the Coil request listener to release the latch latch.await(5, TimeUnit.SECONDS) - runOnIdle { + composeTestRule.runOnIdle { // And assert that we got a single successful result assertThat(results).hasSize(1) assertThat(results[0]).isInstanceOf(SuccessResult::class.java) @@ -113,7 +113,7 @@ class CoilTest { // Wait for the onRequestCompleted to release the latch latch.await(5, TimeUnit.SECONDS) - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertIsDisplayed() .assertWidthIsEqualTo(128.dp) .assertHeightIsEqualTo(128.dp) @@ -135,7 +135,7 @@ class CoilTest { // Wait for the onRequestCompleted to release the latch latch.await(5, TimeUnit.SECONDS) - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertWidthIsEqualTo(128.dp) .assertHeightIsEqualTo(128.dp) .assertIsDisplayed() @@ -194,7 +194,7 @@ class CoilTest { } // Assert that the content is completely Red - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertWidthIsEqualTo(128.dp) .assertHeightIsEqualTo(128.dp) .assertIsDisplayed() @@ -208,7 +208,7 @@ class CoilTest { runBlocking { loadCompleteSignal.receive() } // Assert that the content is completely Blue - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertWidthIsEqualTo(128.dp) .assertHeightIsEqualTo(128.dp) .assertIsDisplayed() @@ -267,7 +267,7 @@ class CoilTest { // Wait for the onRequestCompleted to release the latch latch.await(5, TimeUnit.SECONDS) - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertWidthIsAtLeast(1.dp) .assertHeightIsAtLeast(1.dp) .assertIsDisplayed() @@ -294,7 +294,7 @@ class CoilTest { latch.await(5, TimeUnit.SECONDS) // Assert that the whole layout is drawn cyan - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertIsDisplayed() .captureToBitmap() .assertPixels { Color.Cyan } @@ -316,7 +316,7 @@ class CoilTest { latch.await(5, TimeUnit.SECONDS) // Assert that the layout is in the tree and has the correct size - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertIsDisplayed() .assertWidthIsEqualTo(128.dp) .assertHeightIsEqualTo(128.dp) @@ -347,7 +347,7 @@ class CoilTest { } // Assert that the loading component is displayed - onNodeWithText("Loading").assertIsDisplayed() + composeTestRule.onNodeWithText("Loading").assertIsDisplayed() // Now resume the dispatcher to start the Coil request dispatcher.resumeDispatcher() @@ -357,7 +357,7 @@ class CoilTest { loadLatch.await(5, TimeUnit.SECONDS) // And assert that the loading component no longer exists - onNodeWithText("Loading").assertDoesNotExist() + composeTestRule.onNodeWithText("Loading").assertDoesNotExist() } @Test @@ -381,7 +381,7 @@ class CoilTest { latch.await(5, TimeUnit.SECONDS) // Assert that the whole layout is drawn red - onNodeWithTag(CoilTestTags.Image) + composeTestRule.onNodeWithTag(CoilTestTags.Image) .assertIsDisplayed() .captureToBitmap() .assertPixels { Color.Red } diff --git a/gradle.properties b/gradle.properties index d422a1e31..86cc19afe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ android.useAndroidX=true systemProp.org.gradle.internal.publish.checksums.insecure=true GROUP=dev.chrisbanes.accompanist -VERSION_NAME=0.2.1 +VERSION_NAME=0.2.2 POM_DESCRIPTION=A collection of utilities for Jetpack Compose diff --git a/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilBasicSample.kt b/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilBasicSample.kt index 9380a2a18..34f12ef24 100644 --- a/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilBasicSample.kt +++ b/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilBasicSample.kt @@ -95,7 +95,7 @@ private fun Sample() { data = randomSampleImageUrl(), loading = { Stack(Modifier.fillMaxSize()) { - CircularProgressIndicator(Modifier.gravity(Alignment.Center)) + CircularProgressIndicator(Modifier.align(Alignment.Center)) } }, modifier = Modifier.preferredSize(128.dp) @@ -121,7 +121,7 @@ private fun Sample() { data = randomSampleImageUrl(), loading = { Stack(Modifier.fillMaxSize()) { - CircularProgressIndicator(Modifier.gravity(Alignment.Center)) + CircularProgressIndicator(Modifier.align(Alignment.Center)) } }, modifier = Modifier.preferredSize(128.dp) @@ -132,7 +132,7 @@ private fun Sample() { data = randomSampleImageUrl(), loading = { Stack(Modifier.fillMaxSize()) { - CircularProgressIndicator(Modifier.gravity(Alignment.Center)) + CircularProgressIndicator(Modifier.align(Alignment.Center)) } } ) diff --git a/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilLazyColumnSample.kt b/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilLazyColumnSample.kt index 2df073064..2a946c8cd 100644 --- a/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilLazyColumnSample.kt +++ b/sample/src/main/java/dev/chrisbanes/accompanist/sample/coil/CoilLazyColumnSample.kt @@ -82,7 +82,7 @@ private fun Sample() { Text( text = "Text", style = MaterialTheme.typography.subtitle2, - modifier = Modifier.weight(1f).gravity(Alignment.CenterVertically) + modifier = Modifier.weight(1f).align(Alignment.CenterVertically) ) } }