Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages
This commit is contained in:
parent
4610fb2186
commit
71bc9eb4f7
|
@ -17,7 +17,6 @@ import androidx.compose.ui.text.style.TextDecoration
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* [Text] containing a substring styled as an URL informing when this is clicked.
|
||||
|
@ -95,7 +94,7 @@ fun ClickableSubstringLink(
|
|||
private fun ClickableSubstringTextPreview() {
|
||||
val text = "This text contains a link"
|
||||
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(modifier = Modifier.background(color = FirefoxTheme.colors.layer1)) {
|
||||
ClickableSubstringLink(
|
||||
text = text,
|
||||
|
|
|
@ -24,7 +24,6 @@ import mozilla.components.browser.icons.compose.Placeholder
|
|||
import mozilla.components.browser.icons.compose.WithIcon
|
||||
import org.mozilla.fenix.components.components
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Load and display the favicon of a particular website.
|
||||
|
@ -98,7 +97,7 @@ private fun FaviconPlaceholder(
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun FaviconPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
Favicon(
|
||||
url = "www.mozilla.com",
|
||||
|
|
|
@ -26,7 +26,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Default layout of a large tab shown in a list taking String arguments for title and caption.
|
||||
|
@ -171,7 +170,7 @@ fun ListItemTabSurface(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun ListItemTabLargePreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
ListItemTabLarge(
|
||||
imageUrl = "",
|
||||
title = "This is a very long title for a tab but needs to be so for this preview",
|
||||
|
@ -184,7 +183,7 @@ private fun ListItemTabLargePreview() {
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun ListItemTabSurfacePreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
ListItemTabSurface(
|
||||
imageUrl = "",
|
||||
) {
|
||||
|
@ -201,7 +200,7 @@ private fun ListItemTabSurfacePreview() {
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun ListItemTabSurfaceWithCustomBackgroundPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
ListItemTabSurface(
|
||||
imageUrl = "",
|
||||
backgroundColor = Color.Cyan,
|
||||
|
|
|
@ -22,7 +22,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Placeholder of a [ListItemTabLarge] with the same dimensions but only a centered text.
|
||||
|
@ -74,7 +73,7 @@ fun ListItemTabLargePlaceholder(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun ListItemTabLargePlaceholderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
ListItemTabLargePlaceholder(text = "Item placeholder")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Default layout of a selectable chip.
|
||||
|
@ -78,7 +77,7 @@ fun SelectableChip(
|
|||
@Preview(uiMode = UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = UI_MODE_NIGHT_NO)
|
||||
private fun SelectableChipPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
@ -95,7 +94,7 @@ private fun SelectableChipPreview() {
|
|||
@Preview(uiMode = UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = UI_MODE_NIGHT_NO)
|
||||
private fun SelectableChipWithCustomColorsPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
|
|
@ -20,7 +20,6 @@ import androidx.compose.ui.unit.Dp
|
|||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Displays a list of items as a staggered horizontal grid placing them on ltr rows and continuing
|
||||
|
@ -121,7 +120,7 @@ fun StaggeredHorizontalGrid(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun StaggeredHorizontalGridPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer2)) {
|
||||
StaggeredHorizontalGrid(
|
||||
horizontalItemsSpacing = 8.dp,
|
||||
|
|
|
@ -16,7 +16,6 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Special caption text for a tab layout shown on one line.
|
||||
|
@ -106,7 +105,7 @@ fun TabSubtitleWithInterdot(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun TabSubtitleWithInterdotPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer2)) {
|
||||
TabSubtitleWithInterdot(
|
||||
firstText = "firstText",
|
||||
|
|
|
@ -34,7 +34,6 @@ import mozilla.components.concept.base.images.ImageLoadRequest
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.components.components
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Card which will display a thumbnail. If a thumbnail is not available for [url], the favicon
|
||||
|
@ -138,7 +137,7 @@ private fun ThumbnailImage(
|
|||
@Preview
|
||||
@Composable
|
||||
private fun ThumbnailCardPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
ThumbnailCard(
|
||||
url = "https://mozilla.com",
|
||||
key = "123",
|
||||
|
|
|
@ -25,7 +25,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Base component for buttons.
|
||||
|
@ -187,7 +186,7 @@ fun DestructiveButton(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun ButtonPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.background(FirefoxTheme.colors.layer1)
|
||||
|
|
|
@ -13,7 +13,6 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
|
@ -48,7 +47,7 @@ fun TextButton(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun TextButtonPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
TextButton(
|
||||
text = "label",
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.mozilla.fenix.R
|
|||
import org.mozilla.fenix.components.components
|
||||
import org.mozilla.fenix.compose.inComposePreview
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import org.mozilla.fenix.wallpapers.Wallpaper
|
||||
|
||||
/**
|
||||
|
@ -124,7 +123,7 @@ private fun HomeSectionHeaderContent(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun HomeSectionsHeaderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
HomeSectionHeader(
|
||||
headerText = stringResource(R.string.recently_saved_title),
|
||||
description = stringResource(R.string.recently_saved_show_all_content_description_2),
|
||||
|
|
|
@ -25,7 +25,6 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Expandable header for sections of lists
|
||||
|
@ -96,7 +95,7 @@ fun ExpandableListHeader(
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun TextOnlyHeaderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
ExpandableListHeader(headerText = "Section title")
|
||||
}
|
||||
|
@ -106,7 +105,7 @@ private fun TextOnlyHeaderPreview() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun CollapsibleHeaderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
ExpandableListHeader(
|
||||
headerText = "Collapsible section title",
|
||||
|
@ -122,7 +121,7 @@ private fun CollapsibleHeaderPreview() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun HeaderWithClickableIconPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
ExpandableListHeader(headerText = "Section title") {
|
||||
Box(
|
||||
|
@ -145,7 +144,7 @@ private fun HeaderWithClickableIconPreview() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun CollapsibleHeaderWithClickableIconPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
ExpandableListHeader(
|
||||
headerText = "Section title",
|
||||
|
|
|
@ -27,7 +27,6 @@ import androidx.compose.ui.unit.dp
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.compose.Favicon
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
private val LIST_ITEM_HEIGHT = 56.dp
|
||||
|
||||
|
@ -250,7 +249,7 @@ private fun ListItem(
|
|||
@Composable
|
||||
@Preview(name = "TextListItem", uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun TextListItemPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
TextListItem(label = "Label only")
|
||||
}
|
||||
|
@ -260,7 +259,7 @@ private fun TextListItemPreview() {
|
|||
@Composable
|
||||
@Preview(name = "TextListItem with a description", uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun TextListItemWithDescriptionPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
TextListItem(
|
||||
label = "Label + description",
|
||||
|
@ -273,7 +272,7 @@ private fun TextListItemWithDescriptionPreview() {
|
|||
@Composable
|
||||
@Preview(name = "TextListItem with a right icon", uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun TextListItemWithIconPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
TextListItem(
|
||||
label = "Label + right icon",
|
||||
|
@ -288,7 +287,7 @@ private fun TextListItemWithIconPreview() {
|
|||
@Composable
|
||||
@Preview(name = "IconListItem", uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun IconListItemPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
IconListItem(
|
||||
label = "Left icon list item",
|
||||
|
@ -305,7 +304,7 @@ private fun IconListItemPreview() {
|
|||
uiMode = Configuration.UI_MODE_NIGHT_YES,
|
||||
)
|
||||
private fun IconListItemWithRightIconPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
IconListItem(
|
||||
label = "Left icon list item + right icon",
|
||||
|
@ -325,7 +324,7 @@ private fun IconListItemWithRightIconPreview() {
|
|||
uiMode = Configuration.UI_MODE_NIGHT_YES,
|
||||
)
|
||||
private fun FaviconListItemPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
FaviconListItem(
|
||||
label = "Favicon + right icon + clicks",
|
||||
|
|
|
@ -22,7 +22,6 @@ import mozilla.components.browser.state.state.createTab
|
|||
import mozilla.components.concept.engine.mediasession.MediaSession.PlaybackState
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Controller buttons for the media (play/pause) state for the given [tab].
|
||||
|
@ -59,7 +58,7 @@ fun MediaImage(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun ImagePreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
MediaImage(
|
||||
tab = createTab(url = "https://mozilla.com"),
|
||||
onMediaIconClicked = {},
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.mozilla.fenix.R
|
|||
import org.mozilla.fenix.compose.ThumbnailCard
|
||||
import org.mozilla.fenix.ext.toShortUrl
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* List item used to display a tab that supports clicks,
|
||||
|
@ -172,7 +171,7 @@ private fun Thumbnail(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun TabListItemPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
TabListItem(
|
||||
tab = createTab(url = "www.mozilla.com", title = "Mozilla"),
|
||||
onCloseClick = {},
|
||||
|
@ -187,7 +186,7 @@ private fun TabListItemPreview() {
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun SelectedTabListItemPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
TabListItem(
|
||||
tab = createTab(url = "www.mozilla.com", title = "Mozilla"),
|
||||
onCloseClick = {},
|
||||
|
|
|
@ -46,7 +46,6 @@ import org.mozilla.fenix.R.string
|
|||
import org.mozilla.fenix.compose.list.FaviconListItem
|
||||
import org.mozilla.fenix.ext.toShortUrl
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* Rectangular shape with only right angles used to display a middle tab.
|
||||
|
@ -195,7 +194,7 @@ private fun Modifier.clipTop() = this.then(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun TabInCollectionPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Column {
|
||||
Box(modifier = Modifier.height(56.dp)) {
|
||||
DismissedTabBackground(
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.mozilla.fenix.R
|
|||
import org.mozilla.fenix.components.components
|
||||
import org.mozilla.fenix.compose.ComposeViewHolder
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* [RecyclerView.ViewHolder] for displaying the Pocket feature header.
|
||||
|
@ -83,7 +82,7 @@ class PocketRecommendationsHeaderViewHolder(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun PocketRecommendationsFooterViewHolderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(modifier = Modifier.background(color = FirefoxTheme.colors.layer1)) {
|
||||
PoweredByPocketHeader(
|
||||
onLearnMoreClicked = {},
|
||||
|
|
|
@ -73,7 +73,6 @@ import org.mozilla.fenix.compose.TabSubtitleWithInterdot
|
|||
import org.mozilla.fenix.compose.inComposePreview
|
||||
import org.mozilla.fenix.ext.settings
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.roundToInt
|
||||
|
@ -579,7 +578,7 @@ fun PoweredByPocketHeader(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun PocketStoriesComposablesPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer2)) {
|
||||
Column {
|
||||
PocketStories(
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.mozilla.fenix.components.components
|
|||
import org.mozilla.fenix.compose.ComposeViewHolder
|
||||
import org.mozilla.fenix.compose.home.HomeSectionHeader
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import org.mozilla.fenix.wallpapers.WallpaperState
|
||||
|
||||
/**
|
||||
|
@ -105,7 +104,7 @@ class PocketStoriesViewHolder(
|
|||
@Composable
|
||||
@Preview
|
||||
fun PocketStoriesViewHolderPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Column {
|
||||
HomeSectionHeader(
|
||||
headerText = stringResource(R.string.pocket_stories_header_1),
|
||||
|
|
|
@ -54,7 +54,6 @@ import org.mozilla.fenix.compose.Image
|
|||
import org.mozilla.fenix.compose.inComposePreview
|
||||
import org.mozilla.fenix.home.recentbookmarks.RecentBookmark
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
private val cardShape = RoundedCornerShape(8.dp)
|
||||
|
||||
|
@ -280,7 +279,7 @@ private fun RecentBookmarksMenu(
|
|||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun RecentBookmarksPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
RecentBookmarks(
|
||||
bookmarks = listOf(
|
||||
RecentBookmark(
|
||||
|
|
|
@ -52,7 +52,6 @@ import org.mozilla.fenix.compose.button.SecondaryButton
|
|||
import org.mozilla.fenix.home.recentsyncedtabs.RecentSyncedTab
|
||||
import org.mozilla.fenix.home.recenttabs.RecentTab
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* A recent synced tab card.
|
||||
|
@ -287,7 +286,7 @@ private fun LoadedRecentSyncedTab() {
|
|||
url = "https://mozilla.org",
|
||||
previewImageUrl = "https://mozilla.org",
|
||||
)
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
RecentSyncedTab(
|
||||
tab = tab,
|
||||
onRecentSyncedTabClick = {},
|
||||
|
@ -301,7 +300,7 @@ private fun LoadedRecentSyncedTab() {
|
|||
@Preview
|
||||
@Composable
|
||||
private fun LoadingRecentSyncedTab() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
RecentSyncedTab(
|
||||
tab = null,
|
||||
buttonBackgroundColor = FirefoxTheme.colors.layer3,
|
||||
|
|
|
@ -59,7 +59,6 @@ import org.mozilla.fenix.home.recentvisits.RecentlyVisitedItem
|
|||
import org.mozilla.fenix.home.recentvisits.RecentlyVisitedItem.RecentHistoryGroup
|
||||
import org.mozilla.fenix.home.recentvisits.RecentlyVisitedItem.RecentHistoryHighlight
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
// Number of recently visited items per column.
|
||||
private const val VISITS_PER_COLUMN = 3
|
||||
|
@ -416,7 +415,7 @@ private val LazyListState.atLeastHalfVisibleItems
|
|||
@Composable
|
||||
@Preview
|
||||
private fun RecentlyVisitedPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
RecentlyVisited(
|
||||
recentVisits = listOf(
|
||||
RecentHistoryGroup(title = "running shoes"),
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.mozilla.fenix.R
|
|||
import org.mozilla.fenix.compose.ComposeViewHolder
|
||||
import org.mozilla.fenix.home.sessioncontrol.TabSessionInteractor
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* View holder for a private browsing description.
|
||||
|
@ -116,7 +115,7 @@ fun PrivateBrowsingDescription(
|
|||
@Composable
|
||||
@Preview
|
||||
private fun PrivateBrowsingDescriptionPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
PrivateBrowsingDescription(
|
||||
onLearnMoreClick = {},
|
||||
)
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.mozilla.fenix.compose.list.TextListItem
|
|||
import org.mozilla.fenix.settings.address.ext.getAddressLabel
|
||||
import org.mozilla.fenix.settings.address.ext.getFullName
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* A list of addresses.
|
||||
|
@ -61,7 +60,7 @@ fun AddressList(
|
|||
@Preview
|
||||
@Composable
|
||||
private fun AddressListPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer2)) {
|
||||
AddressList(
|
||||
addresses = listOf(
|
||||
|
|
|
@ -52,7 +52,6 @@ import androidx.compose.ui.unit.dp
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.compose.ClickableSubstringLink
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import org.mozilla.fenix.wallpapers.Wallpaper
|
||||
|
||||
/**
|
||||
|
@ -330,7 +329,7 @@ private fun WallpaperThumbnailItem(
|
|||
@Preview
|
||||
@Composable
|
||||
private fun WallpaperThumbnailsPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
WallpaperSettings(
|
||||
defaultWallpaper = Wallpaper.Default,
|
||||
loadWallpaperResource = { null },
|
||||
|
|
|
@ -43,7 +43,6 @@ import org.mozilla.fenix.compose.list.FaviconListItem
|
|||
import org.mozilla.fenix.ext.toShortUrl
|
||||
import org.mozilla.fenix.tabstray.ext.toDisplayTitle
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
private val ROUNDED_CORNER_SHAPE = RoundedCornerShape(8.dp)
|
||||
|
||||
|
@ -226,7 +225,7 @@ private fun InactiveTabsAutoClosePrompt(
|
|||
@Preview(name = "Auto close dialog dark", uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Preview(name = "Auto close dialog light", uiMode = Configuration.UI_MODE_NIGHT_NO)
|
||||
private fun InactiveTabsAutoClosePromptPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
InactiveTabsAutoClosePrompt(
|
||||
onDismissClick = {},
|
||||
|
@ -243,7 +242,7 @@ private fun InactiveTabsListPreview() {
|
|||
var expanded by remember { mutableStateOf(true) }
|
||||
var showAutoClosePrompt by remember { mutableStateOf(true) }
|
||||
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
InactiveTabsList(
|
||||
inactiveTabs = generateFakeInactiveTabsList(),
|
||||
|
|
|
@ -40,7 +40,6 @@ import org.mozilla.fenix.compose.ext.dashedBorder
|
|||
import org.mozilla.fenix.compose.list.ExpandableListHeader
|
||||
import org.mozilla.fenix.compose.list.FaviconListItem
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
import mozilla.components.browser.storage.sync.Tab as SyncTab
|
||||
|
||||
private const val EXPANDED_BY_DEFAULT = true
|
||||
|
@ -240,7 +239,7 @@ fun SyncedTabsNoTabsItem() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun SyncedTabsListItemsPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Column(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
SyncedTabsSectionHeader(headerText = "Google Pixel Pro Max +Ultra 5000")
|
||||
|
||||
|
@ -276,7 +275,7 @@ private fun SyncedTabsListItemsPreview() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun SyncedTabsErrorPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
SyncedTabsErrorItem(
|
||||
errorText = stringResource(R.string.synced_tabs_no_tabs),
|
||||
|
@ -293,7 +292,7 @@ private fun SyncedTabsErrorPreview() {
|
|||
@Composable
|
||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
private fun SyncedTabsListPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.layer1)) {
|
||||
SyncedTabsList(
|
||||
syncedTabs = getFakeSyncedTabList(),
|
||||
|
|
|
@ -144,7 +144,7 @@ private fun TypographyPreview() {
|
|||
Pair("Overline", defaultTypography.overline),
|
||||
)
|
||||
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.background(FirefoxTheme.colors.layer1)
|
||||
|
|
|
@ -29,7 +29,6 @@ import androidx.compose.ui.unit.dp
|
|||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.settings.wallpaper.WallpaperThumbnails
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
import org.mozilla.fenix.theme.Theme
|
||||
|
||||
/**
|
||||
* A view that shows content of a WallpaperOnboarding dialog.
|
||||
|
@ -125,7 +124,7 @@ fun WallpaperOnboarding(
|
|||
@ExperimentalMaterialApi
|
||||
@Composable
|
||||
private fun WallpaperSnackbarPreview() {
|
||||
FirefoxTheme(theme = Theme.getTheme()) {
|
||||
FirefoxTheme {
|
||||
WallpaperOnboarding(
|
||||
wallpapers = listOf(Wallpaper.Default),
|
||||
currentWallpaper = Wallpaper.Default,
|
||||
|
|
Loading…
Reference in New Issue