Skip to content

Commit

Permalink
Bug 1841578 - Refactor RecentlyVisited to no longer use `BoxWithCon…
Browse files Browse the repository at this point in the history
…straints` r=android-reviewers,rsainani

See bug for full info. TLDR: `BoxWithConstraints` is likely causing crashes when paired with our weird hybrid RecyclerView + Compose implementation of the Homepage

Differential Revision: https://phabricator.services.mozilla.com/D210744
  • Loading branch information
MozillaNoah committed May 22, 2024
1 parent e7f9f1c commit d6a65e2
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ fun TextListItem(
* an optional [IconButton] at the end.
*
* @param label The label in the list item.
* @param modifier [Modifier] to be applied to the layout.
* @param description An optional description text below the label.
* @param faviconPainter Optional painter to use when fetching a new favicon is unnecessary.
* @param onClick Called when the user clicks on the item.
Expand All @@ -126,6 +127,7 @@ fun TextListItem(
@Composable
fun FaviconListItem(
label: String,
modifier: Modifier = Modifier,
description: String? = null,
faviconPainter: Painter? = null,
onClick: (() -> Unit)? = null,
Expand All @@ -136,6 +138,7 @@ fun FaviconListItem(
) {
ListItem(
label = label,
modifier = modifier,
description = description,
onClick = onClick,
beforeListAction = {
Expand Down Expand Up @@ -179,6 +182,7 @@ fun FaviconListItem(
* text and an optional [IconButton] or [Icon] at the end.
*
* @param label The label in the list item.
* @param modifier [Modifier] to be applied to the layout.
* @param labelTextColor [Color] to be applied to the label.
* @param description An optional description text below the label.
* @param enabled Controls the enabled state of the list item. When `false`, the list item will not
Expand All @@ -196,6 +200,7 @@ fun FaviconListItem(
@Composable
fun IconListItem(
label: String,
modifier: Modifier = Modifier,
labelTextColor: Color = FirefoxTheme.colors.textPrimary,
description: String? = null,
enabled: Boolean = true,
Expand All @@ -210,6 +215,7 @@ fun IconListItem(
) {
ListItem(
label = label,
modifier = modifier,
labelTextColor = labelTextColor,
description = description,
enabled = enabled,
Expand Down Expand Up @@ -256,6 +262,7 @@ fun IconListItem(
* text and an optional [TextButton] at the end.
*
* @param label The label in the list item.
* @param modifier [Modifier] to be applied to the layout.
* @param labelTextColor [Color] to be applied to the label.
* @param description An optional description text below the label.
* @param enabled Controls the enabled state of the list item. When `false`, the list item will not
Expand All @@ -271,6 +278,7 @@ fun IconListItem(
@Composable
fun IconListItem(
label: String,
modifier: Modifier = Modifier,
labelTextColor: Color = FirefoxTheme.colors.textPrimary,
description: String? = null,
enabled: Boolean = true,
Expand All @@ -284,6 +292,7 @@ fun IconListItem(
) {
ListItem(
label = label,
modifier = modifier,
labelTextColor = labelTextColor,
description = description,
enabled = enabled,
Expand Down
Loading

0 comments on commit d6a65e2

Please sign in to comment.