From 001a2db3839ce06d93a3a7c452b966fa5d9f7491 Mon Sep 17 00:00:00 2001 From: Cassy Chun-Crogan Date: Wed, 12 Mar 2025 06:05:11 +0000 Subject: [DocsUI M3] Remove the break between folders and files Folders always appear before files and a visual break between them was introduced in ag/836035. For example, if there is one folder and several files, the folder appears on the first row and the rest of the files are displayed below it. In Material3 we want to display the items continuously, so remove this break. See bug for attached screenshots. Bug: 401108520 Test: m DocumentsUIGoogle && manual inspection Flag: com.android.documentsui.flags.use_material3 Change-Id: Idd51a10699fe1dad8101c3573afa5d19a04b6c88 --- src/com/android/documentsui/dirlist/DirectoryAddonsAdapter.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/com/android/documentsui/dirlist/DirectoryAddonsAdapter.java b/src/com/android/documentsui/dirlist/DirectoryAddonsAdapter.java index 8989853a0..8be400924 100644 --- a/src/com/android/documentsui/dirlist/DirectoryAddonsAdapter.java +++ b/src/com/android/documentsui/dirlist/DirectoryAddonsAdapter.java @@ -16,6 +16,8 @@ package com.android.documentsui.dirlist; +import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled; + import android.os.UserManager; import android.view.ViewGroup; @@ -207,6 +209,11 @@ final class DirectoryAddonsAdapter extends DocumentsAdapter { return; } + if (isUseMaterial3FlagEnabled()) { + // Do not add a visual break between folders and documents in Material3. + return; + } + // Walk down the list of IDs till we encounter something that's not a directory, and // insert a whitespace element - this introduces a visual break in the grid between // folders and documents. -- cgit v1.2.3-59-g8ed1b