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

Commit 51a0b7b5 authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Update drawer trigger bar color

Check the attached bug for the demo.

Bug: 411004359
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: Ief35bfa9ab5da75acf5987428d3f09ae218203e4
parent 97a03330
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.legacy.app.ActionBarDrawerToggle;

import com.android.documentsui.base.Display;
import com.android.documentsui.base.Providers;
import com.android.documentsui.util.ColorUtils;

/**
 * A facade over the various pieces comprising "roots fragment in a Drawer".
@@ -143,10 +144,18 @@ public abstract class DrawerController implements DrawerListener {
        public void setDropTargetHighlight(View v, boolean highlight) {
            assert (v.getId() == R.id.drawer_edge);

            @ColorRes int id = highlight ? R.color.secondary :
                android.R.color.transparent;
            if (isUseMaterial3FlagEnabled()) {
                int highlightColor =
                        ColorUtils.resolveMaterialColorAttribute(
                                v.getContext(),
                                com.google.android.material.R.attr.colorPrimaryContainer);
                int normalColor = v.getResources().getColor(android.R.color.transparent, null);
                v.setBackgroundColor(highlight ? highlightColor : normalColor);
            } else {
                @ColorRes int id = highlight ? R.color.secondary : android.R.color.transparent;
                v.setBackgroundColor(id);
            }
        }

        @Override
        public void onDragEntered(View v) {