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

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

[DocsUI M3] Truncate long file names in the middle

See bug for screenshots.

Bug: 399460020
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I7511c2eef0f754a26abca9a3ad80c0262be2eb6b
parent 88065a5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@
                android:id="@android:id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:ellipsize="middle"
                android:singleLine="true"
                android:textAlignment="center"
                android:textAppearance="@style/FileItemLabelText" />
+6 −1
Original line number Diff line number Diff line
@@ -244,7 +244,12 @@ final class GridDocumentHolder extends DocumentHolder {

        mIconHelper.load(mDoc, mIconThumb, mIconMimeLg, mIconMimeSm);

        if (isUseMaterial3FlagEnabled()) {
            // Only Normal type works with ellipsize=middle.
            mTitle.setText(mDoc.displayName, TextView.BufferType.NORMAL);
        } else {
            mTitle.setText(mDoc.displayName, TextView.BufferType.SPANNABLE);
        }
        mTitle.setVisibility(View.VISIBLE);
        // Show the full name in a tooltip.
        itemView.setTooltipText(mDoc.displayName);