Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fcd674e authored by Cassy Chun-Crogan's avatar Cassy Chun-Crogan
Browse files

[DocsUI M3] Only show apps row when show_apps_row config is enabled

Follow up to ag/32733002 which only showed the apps row for
non-FEATURE_PC devices. Instead change the condition to only
show the apps row when the newly introduced show_apps_row config
is enabled. This is true by default but will be overwritten in a
desktop DocumentsUIGoogleOverlay to be false so that the apps row
is hidden on desktops.

Bug: 414692965
Test: atest com.android.documentsui.dirlist.AppsRowManagerTest
Flag: com.android.documentsui.flags.use_material3
Change-Id: I1dc85c376ed02540028941cef8e413a139a6c947
parent a21d71df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
  int full_bar_search_view;
  int is_launcher_enabled;
  int show_search_bar;
  int show_apps_row;
}
-keep class com.android.documentsui.R$color {
  int app_background_color;
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
    <!-- Indicates if showing as search bar design -->
    <bool name="show_search_bar">false</bool>

    <!-- Indicates if showing the apps row -->
    <bool name="show_apps_row">true</bool>

    <!-- Indicates if showing hidden files by default -->
    <bool name="show_hidden_files_by_default">false</bool>

+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
            <item type="bool" name="handle_view_downloads_intent"/>
            <item type="bool" name="is_launcher_enabled"/>
            <item type="bool" name="show_search_bar"/>
            <item type="bool" name="show_apps_row"/>
            <item type="bool" name="force_material3"/>
            <!-- END BOOLEAN CONFIG -->

+1 −2
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static com.android.documentsui.util.Material3Config.getRes;

import android.app.ActivityManager.TaskDescription;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
@@ -251,7 +250,7 @@ public class FilesActivity extends BaseActivity implements AbstractActionHandler
    private AppsRowManager getAppsRowManager() {
        boolean shouldShowByDefault =
                !isUseMaterial3FlagEnabled()
                        || !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC);
                        || getResources().getBoolean(R.bool.show_apps_row);
        return mConfigStore.isPrivateSpaceInDocsUIEnabled()
                ? new AppsRowManager(
                mInjector.actions,
+1 −2
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled;
import static com.android.documentsui.util.Material3Config.getRes;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.net.Uri;
@@ -187,7 +186,7 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons {
    private AppsRowManager getAppsRowManager() {
        boolean shouldShowByDefault =
                !isUseMaterial3FlagEnabled()
                        || !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC);
                        || getResources().getBoolean(R.bool.show_apps_row);
        return mConfigStore.isPrivateSpaceInDocsUIEnabled()
                ? new AppsRowManager(
                mInjector.actions,
Loading