You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d9a92d8
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: decouple gradient scrim and optimize layout in FullBleedImageLayout
- Decouple the linear gradient background scrim from the text column into flat independent sibling layers inside GalleryItemCard.
- Establish a reliable size-class dependent height (100.dp / 140.dp) for the bottom scrim drawable.
- Promote LongTextLayoutDimensions to WidgetTextDimensions to allow shared metrics.
- Add sample_scrim_gradient drawable.
- Add truncateTextToFit helper in FontUtils.
Copy file name to clipboardExpand all lines: samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/text/layout/FullBleedImageLayout.kt
Copy file name to clipboardExpand all lines: samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/text/layout/LongTextLayout.kt
Copy file name to clipboardExpand all lines: samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/layout/utils/FontUtils.kt
+39Lines changed: 39 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,4 +83,43 @@ internal object FontUtils {
83
83
val maxLines = (layoutHeight / textView.textSize).toInt().coerceAtLeast(1)
84
84
return size.sp to maxLines
85
85
}
86
+
87
+
/**
88
+
* Returns a truncated version of the text with "..." if the text does not fit
89
+
* within the available width at the given font size.
0 commit comments