Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c4ce112

Browse files
committedSep 14, 2020
[Owl] Update to alpha03.
Change-Id: Ia21b9245a8c040acd4ef8da0c16045e9317beef2
1 parent e70ba38 commit c4ce112

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed
 

‎Owl/app/src/main/java/com/example/owl/ui/common/CourseListItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fun CourseListItem(
8787
.weight(1f)
8888
.padding(bottom = 4.dp)
8989
)
90-
Row(verticalGravity = Alignment.CenterVertically) {
90+
Row(verticalAlignment = Alignment.CenterVertically) {
9191
Icon(
9292
asset = Icons.Rounded.OndemandVideo,
9393
tint = MaterialTheme.colors.primary,

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import androidx.compose.foundation.ScrollableRow
2525
import androidx.compose.foundation.Text
2626
import androidx.compose.foundation.clickable
2727
import androidx.compose.foundation.layout.Column
28-
import androidx.compose.foundation.layout.InnerPadding
28+
import androidx.compose.foundation.layout.PaddingValues
2929
import androidx.compose.foundation.layout.Row
3030
import androidx.compose.foundation.layout.Spacer
3131
import androidx.compose.foundation.layout.Stack
@@ -89,7 +89,7 @@ import com.example.owl.ui.utils.lerp
8989
import com.example.owl.ui.utils.navigationBarsPadding
9090
import com.example.owl.ui.utils.scrim
9191
import com.example.owl.ui.utils.statusBarsPadding
92-
import com.example.owl.ui.utils.toInnerPadding
92+
import com.example.owl.ui.utils.toPaddingValues
9393

9494
private val FabSize = 56.dp
9595
private const val ExpandedSheetAlpha = 0.96f
@@ -185,15 +185,15 @@ private fun CourseDescriptionHeader(
185185
modifier = Modifier
186186
.padding(bottom = 4.dp)
187187
.preferredSize(24.dp)
188-
.gravity(Alignment.CenterVertically)
188+
.align(Alignment.CenterVertically)
189189
)
190190
Spacer(modifier = Modifier.weight(1f))
191191
}
192192
OutlinedAvatar(
193193
url = course.instructor,
194194
modifier = Modifier
195195
.preferredSize(40.dp)
196-
.gravity(Alignment.BottomCenter)
196+
.align(Alignment.BottomCenter)
197197
.offset(y = 20.dp) // overlap bottom of image
198198
)
199199
}
@@ -284,7 +284,7 @@ private fun RelatedCourses(
284284
)
285285
)
286286
ScrollableRow(
287-
contentPadding = InnerPadding(
287+
contentPadding = PaddingValues(
288288
start = 16.dp,
289289
bottom = 32.dp,
290290
end = FabSize + 8.dp
@@ -373,18 +373,18 @@ private fun Lessons(
373373
modifier = Modifier
374374
.padding(16.dp)
375375
.weight(1f)
376-
.gravity(Alignment.CenterVertically)
376+
.align(Alignment.CenterVertically)
377377
)
378378
IconButton(
379379
onClick = { updateSheet(SheetState.Closed) },
380-
modifier = Modifier.gravity(Alignment.CenterVertically)
380+
modifier = Modifier.align(Alignment.CenterVertically)
381381
) {
382382
Icon(asset = Icons.Rounded.ExpandMore)
383383
}
384384
}
385385
ScrollableColumn(
386386
scrollState = scroll,
387-
contentPadding = InsetsAmbient.current.systemBars.toInnerPadding(
387+
contentPadding = InsetsAmbient.current.systemBars.toPaddingValues(
388388
top = false
389389
)
390390
) {
@@ -404,7 +404,7 @@ private fun Lessons(
404404
.drawLayer(alpha = fabAlpha)
405405
) {
406406
IconButton(
407-
modifier = Modifier.gravity(Alignment.Center),
407+
modifier = Modifier.align(Alignment.Center),
408408
onClick = { updateSheet(SheetState.Open) }
409409
) {
410410
Icon(
@@ -441,7 +441,7 @@ private fun Lesson(lesson: Lesson) {
441441
ProvideEmphasis(EmphasisAmbient.current.medium) {
442442
Row(
443443
modifier = Modifier.padding(top = 4.dp),
444-
verticalGravity = Alignment.CenterVertically
444+
verticalAlignment = Alignment.CenterVertically
445445
) {
446446
Icon(
447447
asset = Icons.Rounded.PlayCircleOutline,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fun Courses(selectCourse: (Long) -> Unit) {
6464
icon = { Icon(vectorResource(tab.icon)) },
6565
label = { Text(stringResource(tab.title).toUpperCase()) },
6666
selected = tab == selectedTab,
67-
onSelect = { setSelectedTab(tab) },
67+
onClick = { setSelectedTab(tab) },
6868
alwaysShowLabels = false,
6969
selectedContentColor = MaterialTheme.colors.secondary,
7070
unselectedContentColor = contentColor(),
@@ -93,11 +93,11 @@ fun CoursesAppBar() {
9393
Image(
9494
modifier = Modifier
9595
.padding(16.dp)
96-
.gravity(Alignment.CenterVertically),
96+
.align(Alignment.CenterVertically),
9797
asset = vectorResource(id = R.drawable.ic_lockup_white)
9898
)
9999
IconButton(
100-
modifier = Modifier.gravity(Alignment.CenterVertically),
100+
modifier = Modifier.align(Alignment.CenterVertically),
101101
onClick = { /* todo */ }
102102
) {
103103
Icon(Icons.Filled.AccountCircle)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private fun AppBar(
9797
asset = vectorResource(id = R.drawable.ic_search),
9898
modifier = Modifier
9999
.padding(16.dp)
100-
.gravity(Alignment.CenterVertically)
100+
.align(Alignment.CenterVertically)
101101
)
102102
// TODO hint
103103
BaseTextField(
@@ -106,10 +106,10 @@ private fun AppBar(
106106
textStyle = MaterialTheme.typography.subtitle1,
107107
modifier = Modifier
108108
.weight(1f)
109-
.gravity(Alignment.CenterVertically)
109+
.align(Alignment.CenterVertically)
110110
)
111111
IconButton(
112-
modifier = Modifier.gravity(Alignment.CenterVertically),
112+
modifier = Modifier.align(Alignment.CenterVertically),
113113
onClick = { /* todo */ }
114114
) {
115115
Icon(Icons.Filled.AccountCircle)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fun Onboarding(onboardingComplete: () -> Unit) {
120120
private fun AppBar() {
121121
Row(
122122
horizontalArrangement = Arrangement.SpaceBetween,
123-
verticalGravity = Alignment.CenterVertically,
123+
verticalAlignment = Alignment.CenterVertically,
124124
modifier = Modifier
125125
.fillMaxWidth()
126126
.statusBarsPadding()
@@ -220,7 +220,7 @@ private fun TopicChip(topic: Topic) {
220220
bottom = 8.dp
221221
)
222222
)
223-
Row(verticalGravity = Alignment.CenterVertically) {
223+
Row(verticalAlignment = Alignment.CenterVertically) {
224224
ProvideEmphasis(emphasis = EmphasisAmbient.current.medium) {
225225
Icon(
226226
asset = vectorResource(R.drawable.ic_grain),

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package com.example.owl.ui.utils
2020

2121
import android.view.View
22-
import androidx.compose.foundation.layout.InnerPadding
22+
import androidx.compose.foundation.layout.PaddingValues
2323
import androidx.compose.foundation.layout.height
2424
import androidx.compose.runtime.Composable
2525
import androidx.compose.runtime.Providers
@@ -118,7 +118,7 @@ class Insets {
118118
internal set
119119
}
120120

121-
val InsetsAmbient = staticAmbientOf<DisplayInsets>()
121+
val InsetsAmbient = staticAmbientOf { DisplayInsets() }
122122

123123
/**
124124
* Applies any [WindowInsetsCompat] values to [InsetsAmbient], which are then available
@@ -425,38 +425,38 @@ fun Modifier.navigationBarsWidthPlus(
425425
}
426426

427427
/**
428-
* Returns the current insets converted into a [InnerPadding].
428+
* Returns the current insets converted into [PaddingValues].
429429
*
430430
* @param start Whether to apply the inset on the start dimension.
431431
* @param top Whether to apply the inset on the top dimension.
432432
* @param end Whether to apply the inset on the end dimension.
433433
* @param bottom Whether to apply the inset on the bottom dimension.
434434
*/
435435
@Composable
436-
fun Insets.toInnerPadding(
436+
fun Insets.toPaddingValues(
437437
start: Boolean = true,
438438
top: Boolean = true,
439439
end: Boolean = true,
440440
bottom: Boolean = true
441-
): InnerPadding = with(DensityAmbient.current) {
441+
): PaddingValues = with(DensityAmbient.current) {
442442
val layoutDirection = LayoutDirectionAmbient.current
443-
InnerPadding(
443+
PaddingValues(
444444
start = when {
445-
start && layoutDirection == LayoutDirection.Ltr -> this@toInnerPadding.left.toDp()
446-
start && layoutDirection == LayoutDirection.Rtl -> this@toInnerPadding.right.toDp()
445+
start && layoutDirection == LayoutDirection.Ltr -> this@toPaddingValues.left.toDp()
446+
start && layoutDirection == LayoutDirection.Rtl -> this@toPaddingValues.right.toDp()
447447
else -> 0.dp
448448
},
449449
top = when {
450-
top -> this@toInnerPadding.top.toDp()
450+
top -> this@toPaddingValues.top.toDp()
451451
else -> 0.dp
452452
},
453453
end = when {
454-
end && layoutDirection == LayoutDirection.Ltr -> this@toInnerPadding.right.toDp()
455-
end && layoutDirection == LayoutDirection.Rtl -> this@toInnerPadding.left.toDp()
454+
end && layoutDirection == LayoutDirection.Ltr -> this@toPaddingValues.right.toDp()
455+
end && layoutDirection == LayoutDirection.Rtl -> this@toPaddingValues.left.toDp()
456456
else -> 0.dp
457457
},
458458
bottom = when {
459-
bottom -> this@toInnerPadding.bottom.toDp()
459+
bottom -> this@toPaddingValues.bottom.toDp()
460460
else -> 0.dp
461461
}
462462
)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
package com.example.owl.buildsrc
1818

1919
object Versions {
20-
const val ktlint = "0.37.2"
20+
const val ktlint = "0.38.1"
2121
}
2222

2323
object Libs {
24-
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha08"
24+
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha10"
2525
const val junit = "junit:junit:4.13"
2626

2727
object Accompanist {
28-
private const val version = "0.2.0"
28+
private const val version = "0.2.2.ui-6824694-SNAPSHOT"
2929
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
3030
}
3131

@@ -44,12 +44,12 @@ object Libs {
4444
}
4545

4646
object AndroidX {
47-
const val appcompat = "androidx.appcompat:appcompat:1.3.0-alpha01"
47+
const val appcompat = "androidx.appcompat:appcompat:1.3.0-alpha02"
4848
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha02"
4949

5050
object Compose {
51-
const val snapshot = ""
52-
const val version = "1.0.0-alpha01"
51+
const val snapshot = "6824694"
52+
const val version = "1.0.0-SNAPSHOT"
5353

5454
const val runtime = "androidx.compose.runtime:runtime:$version"
5555
const val foundation = "androidx.compose.foundation:foundation:$version"

‎Owl/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip

0 commit comments

Comments
 (0)
Please sign in to comment.