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

Commit 55f1f7eb authored by Cassy Chun-Crogan's avatar Cassy Chun-Crogan
Browse files

[DocsUI M3] Uplift disabled state for grid

Apply a 60% opacity to the whole item, not just the
thumbnail.

Also ensure that when the thumbnail gets loaded it is shown
with 100% opacity (from the initial 0% opacity). Previously
this was taken care of during the enable/disable logic applied
to the thumbnail but this is no longer the case.

See bug for screenshots.

Bug: 409878953
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I9017b19ad067ee53fd887eb8fd92e7b78dcd6474
parent d907ab49
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -169,12 +169,14 @@ final class GridDocumentHolder extends DocumentHolder {

        float imgAlpha = enabled ? 1f : DISABLED_ALPHA;

        if (isUseMaterial3FlagEnabled()) {
            itemView.setAlpha(imgAlpha);
        } else {
            mIconMimeLg.setAlpha(imgAlpha);
        if (!isUseMaterial3FlagEnabled()) {
            mIconMimeSm.setAlpha(imgAlpha);
        }
            mIconThumb.setAlpha(imgAlpha);
        }
    }

    @Override
    public void bindPreviewIcon(boolean show, Function<View, Boolean> clickCallback) {
+4 −0
Original line number Diff line number Diff line
@@ -207,6 +207,10 @@ public class IconHelper {
        }

        if (loadedThumbnail) {
            if (isUseMaterial3FlagEnabled()) {
                // Show the thumbnail.
                iconThumb.setAlpha(1f);
            }
            hideImageView(iconMime);
        } else {
            // Add a mime icon if the thumbnail is not shown.