From 49c7452ce0656fcc66bd10480636f26a14a1247e Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Tue, 15 Sep 2026 00:42:56 +0800 Subject: [PATCH 1/3] Switch LoadingContent over to the material3 pull-to-refresh The add/edit screen was moved to PullToRefreshBox during the M3 pass but ComposeUtils was left on Accompanist's SwipeRefresh, so the tasks, statistics and task detail screens were still using the deprecated one. Same behaviour: the indicator follows the loading flag and onRefresh is passed straight through. --- .../blueprints/todoapp/util/ComposeUtils.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt index 84d641712..fbad347c8 100644 --- a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt +++ b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt @@ -14,13 +14,15 @@ * limitations under the License. */ +@file:OptIn(ExperimentalMaterial3Api::class) + package com.example.android.architecture.blueprints.todoapp.util +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.pulltorefresh.PullToRefreshBox import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import com.google.accompanist.swiperefresh.SwipeRefresh -import com.google.accompanist.swiperefresh.rememberSwipeRefreshState val primaryDarkColor: Color = Color(0xFF263238) @@ -46,11 +48,12 @@ fun LoadingContent( if (empty) { emptyContent() } else { - SwipeRefresh( - state = rememberSwipeRefreshState(loading), + PullToRefreshBox( + isRefreshing = loading, onRefresh = onRefresh, modifier = modifier, - content = content, - ) + ) { + content() + } } } From 9f6d4263891b94a7b0f9014821f2437197c6ca71 Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Tue, 15 Sep 2026 00:43:35 +0800 Subject: [PATCH 2/3] Drop the accompanist dependency Nothing imports com.google.accompanist any more now that LoadingContent uses PullToRefreshBox, so the last two entries go too. The three remaining catalog aliases (flowlayout, systemuicontroller, testharness) were already unused. One catch: accompanist-appcompat-theme was the only thing pulling androidx.appcompat onto the classpath, and the app theme in styles.xml is Theme.AppCompat.Light.NoActionBar. So appcompat gets declared directly instead of being borrowed from a library we no longer use. The catalog already had the alias pointing at 1.7.0. --- app/build.gradle.kts | 3 +-- gradle/libs.versions.toml | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 64ede2fbb..31ceb22d8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -112,6 +112,7 @@ dependencies { // App dependencies implementation(libs.androidx.annotation) + implementation(libs.androidx.appcompat) implementation(libs.kotlinx.coroutines.android) implementation(libs.timber) implementation(libs.androidx.test.espresso.idling.resources) @@ -142,8 +143,6 @@ dependencies { implementation(libs.androidx.navigation.compose) implementation(libs.androidx.lifecycle.runtimeCompose) implementation(libs.androidx.lifecycle.viewModelCompose) - implementation(libs.accompanist.appcompat.theme) - implementation(libs.accompanist.swiperefresh) debugImplementation(composeBom) debugImplementation(libs.androidx.compose.ui.tooling.core) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index af9da79dd..c7ab0fbc3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,4 @@ [versions] -accompanist = "0.36.0" annotation = "1.9.1" androidDesugarJdkLibs = "2.1.3" androidGradlePlugin = "8.7.3" @@ -59,11 +58,6 @@ truth = "1.4.4" turbine = "0.12.1" [libraries] -accompanist-appcompat-theme = { group = "com.google.accompanist", name = "accompanist-appcompat-theme", version.ref = "accompanist" } -accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" } -accompanist-swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist" } -accompanist-systemuicontroller = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist" } -accompanist-testharness = { group = "com.google.accompanist", name = "accompanist-testharness", version.ref = "accompanist" } android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" } From 328348438b35e02fa9ca8c3241cea55404fbe037 Mon Sep 17 00:00:00 2001 From: rootkiller6788 Date: Tue, 15 Sep 2026 00:43:50 +0800 Subject: [PATCH 3/3] Remove the leftover ScrollChildSwipeRefreshLayout styleable It declares a refreshing attr for a custom SwipeRefreshLayout subclass from the old Views version of the app. That class and the layouts are long gone, and nothing references the styleable, so the whole file goes. --- app/src/main/res/values/attrs.xml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 app/src/main/res/values/attrs.xml diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml deleted file mode 100644 index 824764515..000000000 --- a/app/src/main/res/values/attrs.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - -