[DocsUI M3] Add tooltip for long file names
Add a tooltip to display the full file name on a long press
or hover over the item.
See the bug for a demo.
Bug: 406304742
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I6f91e9434b4ef8b55161292686494eb35402a6e9
diff --git a/src/com/android/documentsui/dirlist/GridDocumentHolder.java b/src/com/android/documentsui/dirlist/GridDocumentHolder.java
index 75def76..89d3b0a 100644
--- a/src/com/android/documentsui/dirlist/GridDocumentHolder.java
+++ b/src/com/android/documentsui/dirlist/GridDocumentHolder.java
@@ -274,6 +274,8 @@
mTitle.setText(mDoc.displayName, TextView.BufferType.SPANNABLE);
mTitle.setVisibility(View.VISIBLE);
+ // Show the full name in a tooltip.
+ itemView.setTooltipText(mDoc.displayName);
// If file is partial, we want to show summary field as that's more relevant than fileSize
// and date