Skip to content
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

[Quick View] Merging compose-latest to main #985

Merged
merged 43 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
40ad9dc
Merge pull request #919 from android/ben/merge_main_latest
bentrengrove Aug 5, 2022
c733b55
Upgrade to Compose 1.3
bentrengrove Aug 4, 2022
fbb1e66
Fix lint on JetNews
bentrengrove Aug 5, 2022
0f862df
Make reply work with upgrade script
bentrengrove Aug 5, 2022
f1ebfe3
Upgrade samples to compiler 1.3.0-rc02
bentrengrove Aug 8, 2022
12764b6
Merge pull request #918 from android/ben/1.3
JolandaVerhoef Aug 9, 2022
69f4ea7
Update compose-latest | Compose 1.3.0-alpha03 | Compiler 1.3.0 | Kotl…
JolandaVerhoef Aug 12, 2022
9302ed0
[compose-latest Crane] Bugfix for destinations not found in Crane (#939)
riggaroo Aug 15, 2022
dc6d23c
Merge branch 'main' into compose-latest
riggaroo Aug 23, 2022
58d8728
Main into Compose-latest (#965)
JolandaVerhoef Aug 24, 2022
d3aa517
[compose-latest] Update samples on compose-latest branch to Compose 1…
simona-anomis Aug 29, 2022
7a9fa37
[Jetsurvey] Converted to use Material 3 (#954) (#971)
IanGClifton Sep 2, 2022
c6812c6
Update to Compose 1.3.0-beta02 (#974)
bentrengrove Sep 10, 2022
172bd85
[All] Updated to Compose 1.3.0-beta03, AGP 7.3.0 (#979)
IanGClifton Sep 23, 2022
8ecabc5
main > compose-latest (#984)
JolandaVerhoef Sep 30, 2022
b83ce65
Ben/merge main into latest (#988)
bentrengrove Oct 3, 2022
4d17b11
Merge branch 'main' into ben/merge_main_into_latest2
bentrengrove Oct 5, 2022
f21dbbe
Merge main into latest (#991)
bentrengrove Oct 5, 2022
90145a6
[All] Update to 1.3.0-rc01-SNAP
astamato Sep 30, 2022
148b4d8
[All] Update to 1.3.0-rc01-SNAP
astamato Oct 5, 2022
734ab7f
[All] Update to 1.3.0-rc01-SNAP
astamato Oct 5, 2022
7bf22ba
[All] Update to 1.3.0-rc01-SNAP - Compose compiler 1.3.2
astamato Oct 5, 2022
90ee320
[All] Update Accompanist to 0.26.5-rc
astamato Oct 6, 2022
fab8511
[All] Update to 1.3.0-rc01 (#983)
astamato Oct 6, 2022
c278506
Updating Material3 to RC01
florina-muntenescu Oct 7, 2022
67e1e32
[All] Update all to material3 and compose-materialWindow to rc01
astamato Oct 7, 2022
1079eaa
Fix snapshot script not working on unix runners
bentrengrove Oct 7, 2022
b20ef93
Fix snapshot script not working on unix runners (#994)
bentrengrove Oct 7, 2022
b94906f
[All] Update to collectAsStateWithLifecycle to latest alpha
astamato Oct 8, 2022
fd05483
[All] Update to collectAsStateWithLifecycle to latest alpha
astamato Oct 8, 2022
0a3ac4d
Updating Material3 to RC01 (#993)
florina-muntenescu Oct 8, 2022
0a38a42
Update Jetcaster/README.md with correct refdoc
astamato Oct 10, 2022
9dad1d8
[All] Update to collectAsStateWithLifecycle to latest alpha (#995)
astamato Oct 10, 2022
316b8c6
[Jetsurvey] Removed Slider workaround for M3 bug
IanGClifton Oct 11, 2022
e56a368
[Jetsurvey] Removed Slider workaround for M3 bug (#998)
IanGClifton Oct 11, 2022
07b0a26
Merge remote-tracking branch 'origin/main' into compose-latest
JolandaVerhoef Oct 20, 2022
9c8064e
[All] Update non-compose dependencies
JolandaVerhoef Oct 20, 2022
2389cf5
[All] Update Compose dependencies to Snapshot
JolandaVerhoef Oct 20, 2022
47f4777
[All] Update dependencies to use Compose BOM
JolandaVerhoef Oct 20, 2022
1933558
[All] Update dependencies to use Compose BOM
JolandaVerhoef Oct 20, 2022
d526aaa
Merge main into compose-latest (#1002)
JolandaVerhoef Oct 20, 2022
7484956
[All] Revert faulty Androidx window library version update
JolandaVerhoef Oct 24, 2022
7659a1d
Update Compose version (#1003)
JolandaVerhoef Oct 24, 2022
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
4 changes: 4 additions & 0 deletions Crane/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ android {
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)

implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)

Expand Down
3 changes: 3 additions & 0 deletions Crane/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ android {
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)

implementation(libs.androidx.test.ext.junit)
implementation(libs.androidx.test.espresso.core)
implementation(libs.androidx.test.uiautomator)
Expand Down
71 changes: 34 additions & 37 deletions Crane/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
# Do not add a dependency to an individual sample, edit the global version instead.
#####
[versions]
accompanist = "0.25.1"
androidGradlePlugin = "7.3.0"
androidx-activity-compose = "1.5.1"
androidx-appcompat = "1.5.0"
accompanist = "0.26.5-rc"
androidGradlePlugin = "7.3.1"
androidx-activity-compose = "1.6.0"
androidx-appcompat = "1.5.1"
androidx-benchmark = "1.1.0"
androidx-benchmark-junit4 = "1.1.0-beta04"
androidx-compose-bom = "2022.10.00"
androidx-constraintlayout = "1.0.1"
androidx-corektx = "1.8.0"
androidx-corektx = "1.9.0"
androidx-lifecycle-compose = "2.5.1"
androidx-lifecycle-runtime-compose = "2.6.0-alpha02" # merge with above when not alpha
androidx-navigation = "2.5.1"
androidx-lifecycle-runtime-compose = "2.6.0-alpha03"
androidx-navigation = "2.5.2"
androidx-palette = "1.0.0"
androidx-test = "1.3.0"
androidx-test-espresso = "3.3.0"
androidx-test = "1.4.0"
androidx-test-espresso = "3.5.0-alpha06" # Alpha for Compose bugfix and to match upstream, https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:gradle/libs.versions.toml;l=30
androidx-test-ext-junit = "1.1.3"
androidx-test-ext-truth = "1.4.0"
androidx-window = "1.1.0-alpha03"
Expand All @@ -25,12 +26,7 @@ androix-test-uiautomator = "2.2.0"
coil = "2.2.0"
# @keep
compileSdk = "33"
compose = "1.2.1"
compose-compiler = "1.3.0"
# @pin to be updated manually - check JetChat tests
compose-material3 = "1.0.0-alpha15"
# @pin to be updated manually - check JetChat tests
compose-materialWindow = "1.0.0-alpha15"
compose-compiler = "1.3.2"
compose-snapshot = "-"
coroutines = "1.6.4"
google-maps = "18.1.0"
Expand All @@ -39,14 +35,14 @@ hiltExt = "1.0.0"
# @pin When updating to AGP 7.3.0-beta03 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
jdkDesugar = "1.1.5"
junit = "4.13.2"
kotlin = "1.7.10"
kotlin = "1.7.20"
maps-compose = "2.5.3"
material = "1.7.0-beta01"
material = "1.8.0-alpha01"
# @keep
minSdk = "21"
okhttp = "4.10.0"
# @pin Bump to latest after Espresso 3.5.0 goes stable (due to https://github.com/robolectric/robolectric/issues/6593)
roboelectric = "4.5.1"
robolectric = "4.5.1"
rome = "1.18.0"
room = "2.5.0-alpha02"
secrets = "2.0.1"
Expand All @@ -65,24 +61,25 @@ androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-benchmark-macrobenchmark = { module = "androidx.benchmark:benchmark-macro", version.ref = "androidx-benchmark" }
androidx-benchmark-macrobenchmark-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "androidx-benchmark-junit4" }
androidx-compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "compose" }
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
androidx-compose-materialWindow = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-materialWindow" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
androidx-compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata", version.ref = "compose" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts", version.ref = "compose" }
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test", version.ref = "compose" }
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose" }
androidx-compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding", version.ref = "compose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-animation = { module = "androidx.compose.animation:animation" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" }
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-materialWindow = { module = "androidx.compose.material3:material3-window-size-class" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" }
androidx-compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts" }
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test" }
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" }
androidx-compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding" }
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" }
Expand Down Expand Up @@ -124,7 +121,7 @@ kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutine
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "roboelectric" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
rometools-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
rometools-rome = { module = "com.rometools:rome", version.ref = "rome" }
secrets-gradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secrets" }
46 changes: 18 additions & 28 deletions JetNews/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,25 @@ android {
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)

implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)

// TODO: Replace when all samples use the same Material3 & Compose version
implementation("androidx.compose.animation:animation:1.3.0-beta03")
implementation("androidx.compose.foundation:foundation-layout:1.3.0-beta03")
implementation("androidx.compose.material:material-icons-extended:1.3.0-beta03")
implementation("androidx.compose.material3:material3:1.0.0-beta03")
implementation("androidx.compose.material3:material3-window-size-class:1.0.0-beta03")
implementation("androidx.compose.runtime:runtime-livedata:1.3.0-beta03")
implementation("androidx.compose.ui:ui-tooling-preview:1.3.0-beta03")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.3.0-beta03")
debugImplementation("androidx.compose.ui:ui-tooling:1.3.0-beta03")
// implementation(libs.androidx.compose.animation)
// implementation(libs.androidx.compose.foundation.layout)
// implementation(libs.androidx.compose.material.iconsExtended)
// implementation(libs.androidx.compose.material3)
// implementation(libs.androidx.compose.materialWindow)
// implementation(libs.androidx.compose.runtime.livedata)
// implementation(libs.androidx.compose.ui.tooling.preview)
// debugImplementation(libs.androidx.compose.ui.test.manifest)
// debugImplementation(libs.androidx.compose.ui.tooling)

implementation("com.google.accompanist:accompanist-swiperefresh:0.26.4-beta")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.26.4-beta")
// implementation(libs.accompanist.swiperefresh)
// implementation(libs.accompanist.systemuicontroller)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.materialWindow)
implementation(libs.androidx.compose.runtime.livedata)
implementation(libs.androidx.compose.ui.tooling.preview)
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling)

implementation(libs.accompanist.swiperefresh)
implementation(libs.accompanist.systemuicontroller)

implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.ktx)
Expand All @@ -131,7 +123,7 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.savedstate)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewModelCompose)

implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.window)

Expand All @@ -147,9 +139,7 @@ dependencies {
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
// Robolectric dependencies
// TODO: Replace when all samples use the same Material3 & Compose version
implementation("androidx.compose.ui:ui-test-junit4:1.3.0-beta03")
// testImplementation(libs.androidx.compose.ui.test.junit4)
testImplementation(libs.androidx.compose.ui.test.junit4)
testImplementation(libs.robolectric)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.remember
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.jetnews.ui.article.ArticleScreen
import com.example.jetnews.ui.home.HomeScreenType.ArticleDetails
import com.example.jetnews.ui.home.HomeScreenType.Feed
Expand All @@ -40,6 +41,7 @@ import com.example.jetnews.ui.home.HomeScreenType.FeedWithArticleDetails
* @param openDrawer (event) request opening the app drawer
* @param snackbarHostState (state) state for the [Scaffold] component on this screen
*/
@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun HomeRoute(
homeViewModel: HomeViewModel,
Expand All @@ -48,7 +50,7 @@ fun HomeRoute(
snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }
) {
// UiState of the HomeScreen
val uiState by homeViewModel.uiState.collectAsState()
val uiState by homeViewModel.uiState.collectAsStateWithLifecycle()

HomeRoute(
uiState = uiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
Expand All @@ -69,6 +68,8 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.constrainHeight
import androidx.compose.ui.unit.constrainWidth
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.jetnews.R
import com.example.jetnews.data.Result
import com.example.jetnews.data.interests.InterestSection
Expand Down Expand Up @@ -166,15 +167,16 @@ fun InterestsScreen(
* Remembers the content for each tab on the Interests screen
* gathering application data from [InterestsViewModel]
*/
@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun rememberTabContent(interestsViewModel: InterestsViewModel): List<TabContent> {
// UiState of the InterestsScreen
val uiState by interestsViewModel.uiState.collectAsState()
val uiState by interestsViewModel.uiState.collectAsStateWithLifecycle()

// Describe the screen sections here since each section needs 2 states and 1 event.
// Pass them to the stateless InterestsScreen using a tabContent.
val topicsSection = TabContent(Sections.Topics) {
val selectedTopics by interestsViewModel.selectedTopics.collectAsState()
val selectedTopics by interestsViewModel.selectedTopics.collectAsStateWithLifecycle()
TabWithSections(
sections = uiState.topics,
selectedTopics = selectedTopics,
Expand All @@ -183,7 +185,7 @@ fun rememberTabContent(interestsViewModel: InterestsViewModel): List<TabContent>
}

val peopleSection = TabContent(Sections.People) {
val selectedPeople by interestsViewModel.selectedPeople.collectAsState()
val selectedPeople by interestsViewModel.selectedPeople.collectAsStateWithLifecycle()
TabWithTopics(
topics = uiState.people,
selectedTopics = selectedPeople,
Expand All @@ -192,7 +194,8 @@ fun rememberTabContent(interestsViewModel: InterestsViewModel): List<TabContent>
}

val publicationSection = TabContent(Sections.Publications) {
val selectedPublications by interestsViewModel.selectedPublications.collectAsState()
val selectedPublications by interestsViewModel.selectedPublications
.collectAsStateWithLifecycle()
TabWithTopics(
topics = uiState.publications,
selectedTopics = selectedPublications,
Expand Down
Loading