From 60ab4dfb4e8814d1da61ba450cd228b4771b84bf Mon Sep 17 00:00:00 2001 From: Austin Tankiang Date: Thu, 6 Mar 2025 06:47:53 +0000 Subject: Add job progress icon to the app bar This adds a progress indicator to the app bar showing total progress of running jobs. It is not yet interactable. Bug: 385840940 Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.JobPanelControllerTest' Flag: com.android.documentsui.flags.visual_signals_ro Change-Id: I9d81a0f36500c2239b7c7007efb3b1aae98467eb --- .../layout/job_progress_toolbar_item.xml | 25 +++ .../menu/activity.xml | 6 + .../values/dimens.xml | 1 + .../values/styles.xml | 5 + src/com/android/documentsui/JobPanelController.kt | 126 +++++++++++++ src/com/android/documentsui/MenuManager.java | 9 + .../android/documentsui/NavigationViewManager.java | 4 + src/com/android/documentsui/files/MenuManager.java | 18 ++ .../documentsui/services/FileOperationService.java | 10 +- src/com/android/documentsui/services/Job.java | 10 +- .../android/documentsui/JobPanelControllerTest.kt | 207 +++++++++++++++++++++ 11 files changed, 413 insertions(+), 8 deletions(-) create mode 100644 res/flag(com.android.documentsui.flags.use_material3)/layout/job_progress_toolbar_item.xml create mode 100644 src/com/android/documentsui/JobPanelController.kt create mode 100644 tests/unit/com/android/documentsui/JobPanelControllerTest.kt diff --git a/res/flag(com.android.documentsui.flags.use_material3)/layout/job_progress_toolbar_item.xml b/res/flag(com.android.documentsui.flags.use_material3)/layout/job_progress_toolbar_item.xml new file mode 100644 index 000000000..222c8d43e --- /dev/null +++ b/res/flag(com.android.documentsui.flags.use_material3)/layout/job_progress_toolbar_item.xml @@ -0,0 +1,25 @@ + + + + diff --git a/res/flag(com.android.documentsui.flags.use_material3)/menu/activity.xml b/res/flag(com.android.documentsui.flags.use_material3)/menu/activity.xml index 0e636a18c..809a1386a 100644 --- a/res/flag(com.android.documentsui.flags.use_material3)/menu/activity.xml +++ b/res/flag(com.android.documentsui.flags.use_material3)/menu/activity.xml @@ -33,6 +33,12 @@ android:visible="false" app:showAsAction="always|collapseActionView" app:actionViewClass="androidx.appcompat.widget.SearchView"/> + @dimen/space_extra_small_6 + 24dp 0dp diff --git a/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml b/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml index 5d0687a37..6819c12a3 100644 --- a/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml +++ b/res/flag(com.android.documentsui.flags.use_material3)/values/styles.xml @@ -34,6 +34,11 @@ @dimen/icon_size_headline_large + +