Skip to content

Commit 1795edb

Browse files
committedDec 15, 2020
[Owl] Update to snapshot 7033025.
Change-Id: I13fc51cb6c007fa26535e67afe47cc840d2baadb
1 parent 57931f9 commit 1795edb

File tree

9 files changed

+43
-50
lines changed

9 files changed

+43
-50
lines changed
 

‎Owl/app/src/androidTest/java/com/example/owl/ui/NavigationTest.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ package com.example.owl.ui
1818

1919
import androidx.activity.ComponentActivity
2020
import androidx.compose.runtime.Providers
21-
import androidx.compose.ui.test.hasLabel
21+
import androidx.compose.ui.test.hasContentDescription
2222
import androidx.compose.ui.test.hasSubstring
2323
import androidx.compose.ui.test.junit4.createAndroidComposeRule
24-
import androidx.compose.ui.test.onNodeWithLabel
24+
import androidx.compose.ui.test.onNodeWithContentDescription
2525
import androidx.compose.ui.test.onNodeWithSubstring
2626
import androidx.compose.ui.test.performClick
2727
import androidx.test.platform.app.InstrumentationRegistry
@@ -72,7 +72,7 @@ class NavigationTest {
7272
startActivity()
7373
// The first screen should be the onboarding screen.
7474
// Assert that the FAB label for the onboarding screen exists:
75-
composeTestRule.onNodeWithLabel(getOnboardingFabLabel()).assertExists()
75+
composeTestRule.onNodeWithContentDescription(getOnboardingFabLabel()).assertExists()
7676
}
7777

7878
@Test
@@ -82,7 +82,7 @@ class NavigationTest {
8282

8383
// Navigate to the next screen by clicking on the FAB
8484
val fabLabel = getOnboardingFabLabel()
85-
composeTestRule.onNodeWithLabel(fabLabel).performClick()
85+
composeTestRule.onNodeWithContentDescription(fabLabel).performClick()
8686

8787
// The first course should be shown
8888
composeTestRule.onNodeWithSubstring(courses.first().name).assertExists()
@@ -95,7 +95,7 @@ class NavigationTest {
9595

9696
// Navigate to the first course
9797
composeTestRule.onNode(
98-
hasLabel(getFeaturedCourseLabel()).and(hasSubstring(courses.first().name))
98+
hasContentDescription(getFeaturedCourseLabel()).and(hasSubstring(courses.first().name))
9999
).performClick()
100100

101101
// Assert navigated to the course details

‎Owl/app/src/main/java/com/example/owl/ui/course/CourseDetails.kt

+14-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import androidx.compose.foundation.layout.offset
3232
import androidx.compose.foundation.layout.padding
3333
import androidx.compose.foundation.layout.preferredHeight
3434
import androidx.compose.foundation.layout.preferredSize
35-
import androidx.compose.foundation.lazy.LazyRowFor
35+
import androidx.compose.foundation.lazy.LazyRow
3636
import androidx.compose.foundation.rememberScrollState
3737
import androidx.compose.foundation.shape.RoundedCornerShape
3838
import androidx.compose.material.AmbientContentAlpha
@@ -298,23 +298,24 @@ private fun RelatedCourses(
298298
vertical = 24.dp
299299
)
300300
)
301-
LazyRowFor(
302-
items = relatedCourses,
301+
LazyRow(
303302
contentPadding = PaddingValues(
304303
start = 16.dp,
305304
bottom = 32.dp,
306305
end = FabSize + 8.dp
307306
)
308-
) { related ->
309-
CourseListItem(
310-
course = related,
311-
onClick = { selectCourse(related.id) },
312-
titleStyle = MaterialTheme.typography.body2,
313-
modifier = Modifier
314-
.padding(end = 8.dp)
315-
.preferredSize(288.dp, 80.dp),
316-
iconSize = 14.dp
317-
)
307+
) {
308+
items(relatedCourses) { related ->
309+
CourseListItem(
310+
course = related,
311+
onClick = { selectCourse(related.id) },
312+
titleStyle = MaterialTheme.typography.body2,
313+
modifier = Modifier
314+
.padding(end = 8.dp)
315+
.preferredSize(288.dp, 80.dp),
316+
iconSize = 14.dp
317+
)
318+
}
318319
}
319320
}
320321
}

‎Owl/app/src/main/java/com/example/owl/ui/courses/FeaturedCourses.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import androidx.compose.runtime.Composable
3434
import androidx.compose.ui.Modifier
3535
import androidx.compose.ui.layout.Layout
3636
import androidx.compose.ui.res.stringResource
37-
import androidx.compose.ui.semantics.accessibilityLabel
37+
import androidx.compose.ui.semantics.contentDescription
3838
import androidx.compose.ui.semantics.semantics
3939
import androidx.compose.ui.text.style.TextAlign
4040
import androidx.compose.ui.tooling.preview.Preview
@@ -89,7 +89,7 @@ fun FeaturedCourse(
8989
onClick = { selectCourse(course.id) }
9090
)
9191
.semantics {
92-
accessibilityLabel = featuredString
92+
contentDescription = featuredString
9393
}
9494
) {
9595
val (image, avatar, subject, name, steps, icon) = createRefs()

‎Owl/app/src/main/java/com/example/owl/ui/onboarding/Onboarding.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import androidx.compose.ui.draw.scale
6060
import androidx.compose.ui.layout.Layout
6161
import androidx.compose.ui.res.stringResource
6262
import androidx.compose.ui.res.vectorResource
63-
import androidx.compose.ui.semantics.accessibilityLabel
63+
import androidx.compose.ui.semantics.contentDescription
6464
import androidx.compose.ui.semantics.semantics
6565
import androidx.compose.ui.text.style.TextAlign
6666
import androidx.compose.ui.tooling.preview.Preview
@@ -89,7 +89,7 @@ fun Onboarding(onboardingComplete: () -> Unit) {
8989
modifier = Modifier
9090
.navigationBarsPadding()
9191
.semantics {
92-
accessibilityLabel = fabLabel
92+
contentDescription = fabLabel
9393
}
9494
) {
9595
Icon(Icons.Rounded.Explore)

‎Owl/app/src/main/java/com/example/owl/ui/theme/Theme.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -148,35 +148,35 @@ object OwlTheme {
148148
/**
149149
* Proxy to [MaterialTheme]
150150
*/
151-
@Composable
152151
val colors: Colors
152+
@Composable
153153
get() = MaterialTheme.colors
154154

155155
/**
156156
* Proxy to [MaterialTheme]
157157
*/
158-
@Composable
159158
val typography: Typography
159+
@Composable
160160
get() = MaterialTheme.typography
161161

162162
/**
163163
* Proxy to [MaterialTheme]
164164
*/
165-
@Composable
166165
val shapes: Shapes
166+
@Composable
167167
get() = MaterialTheme.shapes
168168

169169
/**
170170
* Retrieves the current [Elevations] at the call site's position in the hierarchy.
171171
*/
172-
@Composable
173172
val elevations: Elevations
173+
@Composable
174174
get() = AmbientElevations.current
175175

176176
/**
177177
* Retrieves the current [Images] at the call site's position in the hierarchy.
178178
*/
179-
@Composable
180179
val images: Images
180+
@Composable
181181
get() = AmbientImages.current
182182
}

‎Owl/app/src/main/java/com/example/owl/ui/utils/Scrim.kt

+5-13
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,14 @@
1717
package com.example.owl.ui.utils
1818

1919
import androidx.compose.ui.Modifier
20-
import androidx.compose.ui.draw.drawWithCache
20+
import androidx.compose.ui.draw.drawWithContent
21+
import androidx.compose.ui.graphics.Brush
2122
import androidx.compose.ui.graphics.Color
22-
import androidx.compose.ui.graphics.VerticalGradient
2323

2424
/**
2525
* A [Modifier] which draws a vertical gradient
2626
*/
27-
fun Modifier.scrim(colors: List<Color>): Modifier = drawWithCache {
28-
// Use drawWithCache modifier to create and cache the gradient when size is known or changes.
29-
val gradient = VerticalGradient(
30-
colors = colors,
31-
startY = 0f,
32-
endY = size.height
33-
)
34-
onDrawWithContent {
35-
drawContent()
36-
drawRect(brush = gradient)
37-
}
27+
fun Modifier.scrim(colors: List<Color>): Modifier = drawWithContent {
28+
drawContent()
29+
drawRect(Brush.verticalGradient(colors))
3830
}

‎Owl/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929
}
3030

3131
plugins {
32-
id 'com.diffplug.spotless' version '5.7.0'
32+
id 'com.diffplug.spotless' version '5.8.2'
3333
}
3434

3535
subprojects {

‎Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
package com.example.owl.buildsrc
1818

1919
object Versions {
20-
const val ktlint = "0.39.0"
20+
const val ktlint = "0.40.0"
2121
}
2222

2323
object Libs {
24-
const val androidGradlePlugin = "com.android.tools.build:gradle:7.0.0-alpha02"
24+
const val androidGradlePlugin = "com.android.tools.build:gradle:7.0.0-alpha03"
2525
const val junit = "junit:junit:4.13"
2626

2727
object Accompanist {
28-
private const val version = "0.4.0"
28+
private const val version = "0.4.1.compose-7033025-SNAPSHOT"
2929
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
3030
const val insets = "dev.chrisbanes.accompanist:accompanist-insets:$version"
3131
}
3232

3333
object Kotlin {
34-
private const val version = "1.4.20"
34+
private const val version = "1.4.21"
3535
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version"
3636
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version"
3737
const val extensions = "org.jetbrains.kotlin:kotlin-android-extensions:$version"
@@ -45,12 +45,12 @@ object Libs {
4545
}
4646

4747
object AndroidX {
48-
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha04"
49-
const val navigation = "androidx.navigation:navigation-compose:1.0.0-alpha03"
48+
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha05"
49+
const val navigation = "androidx.navigation:navigation-compose:1.0.0-SNAPSHOT"
5050

5151
object Compose {
52-
const val snapshot = ""
53-
const val version = "1.0.0-alpha08"
52+
const val snapshot = "7033025"
53+
const val version = "1.0.0-SNAPSHOT"
5454

5555
const val animation = "androidx.compose.animation:animation:$version"
5656
const val foundation = "androidx.compose.foundation:foundation:$version"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)