Skip to content

[All] Update to Compose 1.0.0-alpha06 #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Oct 28, 2020
Merged
Changes from 34 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8499955
[Jetsnack] Cart implementation
JolandaVerhoef Oct 19, 2020
ba64aa1
[Jetsnack] Reuse Quantity Selector
JolandaVerhoef Oct 21, 2020
a831cd8
[Jetsnack] Reuse Destination Bar
JolandaVerhoef Oct 21, 2020
affce96
[Jetsnack] Add Inspired By Section to Cart
JolandaVerhoef Oct 21, 2020
551af64
[Jetsnack] Add Checkout Bar to cart
JolandaVerhoef Oct 21, 2020
3751be0
[Jetsnack] Fix Spotless issues
JolandaVerhoef Oct 21, 2020
7224519
[Jetsnack] Fix review comments
JolandaVerhoef Oct 21, 2020
bb8a07f
[Jetsnack] Fix review comments
JolandaVerhoef Oct 22, 2020
75ebc9f
Merge pull request #243 from android/main
nickbutcher Oct 22, 2020
ad976e6
Update to snapshot 6922857.
nickbutcher Oct 23, 2020
b48daf7
[Jetsurvey] Bump to alpha06
florina-muntenescu Oct 22, 2020
3b0549b
[Owl] Update to snapshot 6922857.
nickbutcher Oct 23, 2020
98321c8
[JetChat] Update to snapshot 6922857
JoseAlcerreca Oct 23, 2020
fe51364
[Rally] Update to snapshot 6922857
JoseAlcerreca Oct 23, 2020
8a95314
[Jetcaster] Update to snapshot 6922857.
JolandaVerhoef Oct 23, 2020
ecd199e
Merge branch 'dev_alpha06' into jv/jc-alpha06
JolandaVerhoef Oct 23, 2020
c5f8e74
[Rally] Update to snapshot 6922857
JoseAlcerreca Oct 23, 2020
1bc1329
Merge branch 'dev_alpha06' into nb/js-alpha06
nickbutcher Oct 23, 2020
63435f2
Merge branch 'dev_alpha06' into nb/owl_alpha06
nickbutcher Oct 23, 2020
63a4c9a
Merge pull request #244 from android/fm/jetsurvey_alpha06
florina-muntenescu Oct 23, 2020
7edd98c
Merge branch 'dev_alpha06' into nb/js-alpha06
nickbutcher Oct 23, 2020
ff4cc73
Merge pull request #247 from android/nb/js-alpha06
nickbutcher Oct 23, 2020
9ea6419
Merge branch 'dev_alpha06' into nb/owl_alpha06
nickbutcher Oct 23, 2020
b2adc8a
Merge pull request #248 from android/nb/owl_alpha06
nickbutcher Oct 23, 2020
a03dc18
Removes unncessary elevation param
JoseAlcerreca Oct 23, 2020
5fd5485
Merge branch 'dev_alpha06' into jv/jc-alpha06
JolandaVerhoef Oct 23, 2020
d4994a7
Merge pull request #251 from android/jv/jc-alpha06
JolandaVerhoef Oct 23, 2020
80fffe8
[Crane] Update to 6922857 snapshot (#246)
manuelvicnt Oct 23, 2020
90c738e
[Owl] Replace elevation overlay workaround with AmbientElevationOverlay.
nickbutcher Oct 23, 2020
3827868
Merge pull request #253 from android/nb/owl_overlays
nickbutcher Oct 26, 2020
fbe78a8
Merge pull request #249 from JoseAlcerreca/dev_jetchat_alpha06
JoseAlcerreca Oct 26, 2020
c637877
[Jetchat] Replace elevation overlay workaround with AmbientElevationO…
JoseAlcerreca Oct 26, 2020
98cd2cd
[Jetchat] Replace elevation overlay workaround with AmbientElevationO…
JoseAlcerreca Oct 26, 2020
af48642
[Jetsurvey] Redesigned next/prev buttons
florina-muntenescu Oct 23, 2020
0213c71
[Jetsurvey] Redesigned progress indicator
florina-muntenescu Oct 23, 2020
d4e7606
[Jetsurvey] Adding elevation to the action bar
florina-muntenescu Oct 24, 2020
a436d25
[Jetsurvey] Capitalising strings
florina-muntenescu Oct 24, 2020
b727bef
[Jetsurvey] Question title redesigned
florina-muntenescu Oct 24, 2020
c368a40
[Jetsurvey] Removing unused composable
florina-muntenescu Oct 24, 2020
35ed12b
[Jetsurvey] Removing the column usage in progress indicator
florina-muntenescu Oct 26, 2020
7027635
Merge pull request #254 from android/fm/redesign_progress
florina-muntenescu Oct 26, 2020
cd04088
Merge branch 'dev_alpha06' into jv/js_cart
JolandaVerhoef Oct 26, 2020
42f1895
Merge pull request #239 from android/jv/js_cart
JolandaVerhoef Oct 27, 2020
91c38e5
[Crane] Adds Hilt to the project (#237)
manuelvicnt Oct 27, 2020
74bc758
[JetNews] bump to alpha06 (#258)
objcode Oct 28, 2020
aecb508
Update all samples to AGP 4.2.0-alpha15
Oct 28, 2020
6a3ee43
Turn on allWarningsAsErrors in Jetsurvey
Oct 28, 2020
963edaa
Tidy up gradle.properties
Oct 28, 2020
3b9ed84
Disable Jetifier where possible
Oct 28, 2020
7e06aa2
Update all projects to ktlint 0.39.0
Oct 28, 2020
e5e4795
Update snapshot URL
Oct 28, 2020
90f516d
Merge pull request #259 from android/cb/dev06-tidyup
chrisbanes Oct 28, 2020
e1371b4
Update to Compose 1.0.0-alpha06
Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ import org.junit.Test
class CalendarTest {

@get:Rule
val composeTestRule = createComposeRule(disableTransitions = true)
val composeTestRule = createComposeRule()

var dateSelected = ""
private val onDayClicked: (CalendarDay, CalendarMonth) -> Unit = { day, month ->
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ import org.junit.Test
class HomeTest {

@get:Rule
val composeTestRule = createComposeRule(disableTransitions = true)
val composeTestRule = createComposeRule()

@Before
fun setUp() {
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ import androidx.annotation.DrawableRes
import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.BaseTextField
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Icon
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.Button
import androidx.compose.material.ButtonConstants
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@@ -163,8 +164,10 @@ private fun ZoomControls(
private fun ZoomButton(text: String, onClick: () -> Unit) {
Button(
modifier = Modifier.padding(8.dp),
backgroundColor = MaterialTheme.colors.onPrimary,
contentColor = MaterialTheme.colors.primary,
colors = ButtonConstants.defaultButtonColors(
backgroundColor = MaterialTheme.colors.onPrimary,
contentColor = MaterialTheme.colors.primary
),
onClick = onClick
) {
Text(text = text, style = MaterialTheme.typography.h5)
2 changes: 1 addition & 1 deletion Crane/build.gradle
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ buildscript {
}

plugins {
id 'com.diffplug.spotless' version '5.1.1'
id 'com.diffplug.spotless' version '5.7.0'
}

subprojects {
Original file line number Diff line number Diff line change
@@ -21,12 +21,12 @@ object Versions {
}

object Libs {
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha13"
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha14"
const val ktLint = "com.pinterest:ktlint:${Versions.ktLint}"
const val googleMaps = "com.google.android.libraries.maps:maps:3.1.0-beta"

object Accompanist {
private const val version = "0.3.1"
private const val version = "0.3.2.compose-6922857-SNAPSHOT"
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
}

@@ -39,8 +39,8 @@ object Libs {

object AndroidX {
object Compose {
const val snapshot = ""
const val version = "1.0.0-alpha05"
const val snapshot = "6922857"
const val version = "1.0.0-SNAPSHOT"

const val runtime = "androidx.compose.runtime:runtime:$version"
const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version"
@@ -71,5 +71,5 @@ object Libs {
object Urls {
const val mavenCentralSnapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
const val composeSnapshotRepo = "https://androidx-dev-prod.appspot.com/snapshots/builds/" +
"${Libs.AndroidX.Compose.snapshot}/artifacts/ui/repository/"
"${Libs.AndroidX.Compose.snapshot}/artifacts/repository/"
}
6 changes: 3 additions & 3 deletions Crane/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 15 11:35:59 CEST 2020
#Fri Oct 23 09:30:32 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@

package com.example.jetcaster.ui.home

import androidx.compose.foundation.Icon
import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
@@ -35,6 +34,7 @@ import androidx.compose.foundation.layout.preferredHeightIn
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
package com.example.jetcaster.ui.home.category

import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.Icon
import androidx.compose.foundation.Image
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable
@@ -38,6 +37,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRowForIndexed
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
Original file line number Diff line number Diff line change
@@ -18,10 +18,10 @@ package com.example.jetcaster.util

import androidx.compose.animation.animate
import androidx.compose.foundation.AmbientContentColor
import androidx.compose.foundation.Icon
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.padding
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.icons.Icons
2 changes: 1 addition & 1 deletion Jetcaster/build.gradle
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ buildscript {
}

plugins {
id 'com.diffplug.spotless' version '5.5.1'
id 'com.diffplug.spotless' version '5.7.0'
}

subprojects {
Original file line number Diff line number Diff line change
@@ -21,15 +21,15 @@ object Versions {
}

object Libs {
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha13"
const val androidGradlePlugin = "com.android.tools.build:gradle:4.2.0-alpha14"
const val jdkDesugar = "com.android.tools:desugar_jdk_libs:1.0.9"

const val junit = "junit:junit:4.13"

const val material = "com.google.android.material:material:1.1.0"

object Accompanist {
private const val version = "0.3.1"
private const val version = "0.3.2.compose-6922857-SNAPSHOT"
const val coil = "dev.chrisbanes.accompanist:accompanist-coil:$version"
}

@@ -57,16 +57,16 @@ object Libs {
const val appcompat = "androidx.appcompat:appcompat:1.2.0-rc01"
const val palette = "androidx.palette:palette:1.0.0"

const val core = "androidx.core:core:1.5.0-alpha02"
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha02"
const val core = "androidx.core:core:1.5.0-alpha04"
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha04"

object Compose {
private const val snapshot = ""
const val version = "1.0.0-alpha05"
private const val snapshot = "6922857"
const val version = "1.0.0-SNAPSHOT"

@get:JvmStatic
val snapshotUrl: String
get() = "https://androidx.dev/snapshots/builds/$snapshot/artifacts/ui/repository/"
get() = "https://androidx.dev/snapshots/builds/$snapshot/artifacts/repository/"

const val runtime = "androidx.compose.runtime:runtime:$version"
const val foundation = "androidx.compose.foundation:foundation:${version}"
2 changes: 1 addition & 1 deletion Jetcaster/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ import org.junit.Test
class ConversationTest {

@get:Rule
val composeTestRule = createAndroidComposeRule<NavActivity>(disableTransitions = true)
val composeTestRule = createAndroidComposeRule<NavActivity>()

// Note that keeping these references is only safe if the activity is not recreated.
// See: https://issuetracker.google.com/160862278
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ import org.junit.Test
class NavigationTest {

@get:Rule
val composeTestRule = createAndroidComposeRule<NavActivity>(disableTransitions = true)
val composeTestRule = createAndroidComposeRule<NavActivity>()

// Note that keeping these references is only safe if the activity is not recreated.
// See: https://issuetracker.google.com/160862278
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ import org.junit.Test
class UserInputTest {

@get:Rule
val composeTestRule = createAndroidComposeRule<NavActivity>(disableTransitions = true)
val composeTestRule = createAndroidComposeRule<NavActivity>()

// Note that keeping these references is only safe if the activity is not recreated.
// See: https://issuetracker.google.com/160862278
Original file line number Diff line number Diff line change
@@ -74,3 +74,11 @@ fun JetchatAppBarPreview() {
JetchatAppBar(title = { Text("Preview!") })
}
}

@Preview
@Composable
fun JetchatAppBarPreviewDark() {
JetchatTheme(isDarkTheme = true) {
JetchatAppBar(title = { Text("Preview!") })
}
}
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
package com.example.compose.jetchat.conversation

import androidx.compose.foundation.ClickableText
import androidx.compose.foundation.Icon
import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.ScrollableColumn
@@ -43,6 +42,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.LastBaseline
import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Surface
@@ -316,7 +316,7 @@ private fun AuthorNameTimestamp(msg: Message) {
text = msg.author,
style = MaterialTheme.typography.subtitle1,
modifier = Modifier
.alignWithSiblings(LastBaseline)
.alignBy(LastBaseline)
.relativePaddingFrom(LastBaseline, after = 8.dp) // Space to 1st bubble
)
}
@@ -325,7 +325,7 @@ private fun AuthorNameTimestamp(msg: Message) {
Text(
text = msg.timestamp,
style = MaterialTheme.typography.caption,
modifier = Modifier.alignWithSiblings(LastBaseline)
modifier = Modifier.alignBy(LastBaseline)
)
}
}
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@ package com.example.compose.jetchat.conversation
import androidx.compose.animation.DpPropKey
import androidx.compose.animation.core.transitionDefinition
import androidx.compose.animation.transition
import androidx.compose.foundation.Icon
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.material.ExtendedFloatingActionButton
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowDownward
Original file line number Diff line number Diff line change
@@ -24,12 +24,10 @@ import androidx.compose.foundation.AmbientTextStyle
import androidx.compose.foundation.BaseTextField
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Icon
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.ScrollableRow
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable
import androidx.compose.foundation.contentColor
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -49,12 +47,12 @@ import androidx.compose.material.AmbientEmphasisLevels
import androidx.compose.material.Button
import androidx.compose.material.ButtonConstants
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ProvideEmphasis
import androidx.compose.material.Surface
import androidx.compose.material.TextButton
import androidx.compose.material.contentColorFor
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AlternateEmail
import androidx.compose.material.icons.outlined.Duo
@@ -309,27 +307,22 @@ private fun UserInputSelector(
}
Spacer(modifier = Modifier.weight(1f))

val backgroundColor = ButtonConstants.defaultButtonBackgroundColor(
enabled = sendMessageEnabled,
disabledColor = MaterialTheme.colors.surface
)
val disabledContentColor =
AmbientEmphasisLevels.current.disabled.applyEmphasis(MaterialTheme.colors.onSurface)
val contentColor = ButtonConstants.defaultButtonContentColor(
enabled = sendMessageEnabled,
defaultColor = contentColorFor(backgroundColor),
disabledColor = disabledContentColor

val buttonColors = ButtonConstants.defaultButtonColors(
disabledBackgroundColor = MaterialTheme.colors.surface,
disabledContentColor = disabledContentColor
)

// Send button
Button(
modifier = Modifier
.padding(horizontal = 16.dp)
.preferredHeight(36.dp),
elevation = 0.dp,
enabled = sendMessageEnabled,
onClick = onMessageSent,
contentColor = contentColor,
backgroundColor = backgroundColor,
colors = buttonColors,
border = border,
// TODO: Workaround for https://issuetracker.google.com/158830170
contentPadding = PaddingValues(0.dp)
@@ -486,25 +479,20 @@ fun ExtendedSelectorInnerButton(
selected: Boolean,
modifier: Modifier = Modifier
) {
val backgroundColor = if (selected) {
MaterialTheme.colors.onSurface.copy(alpha = 0.08f)
} else {
// Same as background
getSelectorExpandedColor()
}
val color = if (selected) {
MaterialTheme.colors.onSurface
} else {
MaterialTheme.colors.onSurface.copy(alpha = 0.74f)
}
val colors = ButtonConstants.defaultButtonColors(
backgroundColor = MaterialTheme.colors.onSurface.copy(alpha = 0.08f),
disabledBackgroundColor = getSelectorExpandedColor(), // Same as background
contentColor = MaterialTheme.colors.onSurface,
disabledContentColor = MaterialTheme.colors.onSurface.copy(alpha = 0.74f)
)
TextButton(
onClick = onClick,
modifier = modifier
.padding(horizontal = 8.dp, vertical = 8.dp)
.preferredHeight(30.dp),
shape = MaterialTheme.shapes.medium,
backgroundColor = backgroundColor,
contentColor = color,
enabled = selected,
colors = colors,
// TODO: Workaround for https://issuetracker.google.com//158830170
contentPadding = PaddingValues(0.dp)
) {
Loading