diff --git a/WordPress/src/main/java/org/wordpress/android/ui/compose/components/card/UnelevatedCard.kt b/WordPress/src/main/java/org/wordpress/android/ui/compose/components/card/UnelevatedCard.kt index b93580d186e1..afb9dcc8ed51 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/compose/components/card/UnelevatedCard.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/compose/components/card/UnelevatedCard.kt @@ -1,12 +1,16 @@ package org.wordpress.android.ui.compose.components.card +import android.content.res.Configuration.UI_MODE_NIGHT_YES import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Card -import androidx.compose.material.MaterialTheme +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @Composable @@ -16,14 +20,28 @@ fun UnelevatedCard( ) { val shape = RoundedCornerShape(10.dp) Card( - modifier = Modifier.clip(shape).then(modifier), + modifier = Modifier + .clip(shape) + .then(modifier), border = BorderStroke( width = 1.dp, - color = MaterialTheme.colors.onSurface.copy(alpha = 0.12f) + color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.12f) ), - elevation = 0.dp, + colors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.surface, + ), + elevation = CardDefaults.elevatedCardElevation(0.dp), shape = shape, ) { content() } } + +@Preview +@Preview(uiMode = UI_MODE_NIGHT_YES) +@Composable +private fun UnelevatedCardPreview() { + UnelevatedCard { + Text(text = "Preview") + } +} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/compose/styles/DashboardCardTypography.kt b/WordPress/src/main/java/org/wordpress/android/ui/compose/styles/DashboardCardTypography.kt index b0a3fa25af18..c2eee8554908 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/compose/styles/DashboardCardTypography.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/compose/styles/DashboardCardTypography.kt @@ -1,12 +1,16 @@ package org.wordpress.android.ui.compose.styles -import androidx.compose.material.ContentAlpha -import androidx.compose.material.MaterialTheme.colors +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp object DashboardCardTypography { @@ -14,7 +18,7 @@ object DashboardCardTypography { @Composable get() = MaterialTheme.typography.bodyLarge.copy( fontWeight = FontWeight.SemiBold, - color = colors.onSurface.copy(alpha = ContentAlpha.high) + color = MaterialTheme.colorScheme.onSurface ) val smallTitle: TextStyle @@ -22,7 +26,7 @@ object DashboardCardTypography { get() = MaterialTheme.typography.bodyLarge.copy( fontWeight = FontWeight.Normal, fontSize = 14.sp, - color = colors.onSurface.copy(alpha = ContentAlpha.high) + color = MaterialTheme.colorScheme.onSurface ) val subTitle: TextStyle @@ -30,32 +34,71 @@ object DashboardCardTypography { get() = MaterialTheme.typography.titleMedium.copy( fontWeight = FontWeight.Medium, fontStyle = FontStyle.Normal, - color = colors.onSurface.copy(alpha = ContentAlpha.high) + color = MaterialTheme.colorScheme.onSurface ) val detailText: TextStyle @Composable get() = MaterialTheme.typography.bodyMedium.copy( - color = colors.onSurface.copy(alpha = ContentAlpha.medium) + color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.74f) ) val largeText: TextStyle @Composable get() = MaterialTheme.typography.headlineMedium.copy( - color = colors.onSurface.copy(alpha = ContentAlpha.high) + color = MaterialTheme.colorScheme.onSurface ) val footerCTA: TextStyle @Composable get() = MaterialTheme.typography.titleMedium.copy( fontWeight = FontWeight.Medium, - color = colors.primary + color = MaterialTheme.colorScheme.primary ) val standaloneText: TextStyle @Composable get() = MaterialTheme.typography.titleMedium.copy( fontWeight = FontWeight.Medium, - color = colors.onSurface.copy(alpha = ContentAlpha.high) + color = MaterialTheme.colorScheme.onSurface ) } + +@Preview +@Composable +fun DashboardCardTypographyPreview() { + val padding = Modifier.padding(8.dp) + + Column { + Text( + text = "Title", + style = DashboardCardTypography.title, + modifier = padding + ) + Text( + text = "subTitle", + style = DashboardCardTypography.subTitle, + modifier = padding + ) + Text( + text = "detailText", + style = DashboardCardTypography.detailText, + modifier = padding + ) + Text( + text = "largeText", + style = DashboardCardTypography.largeText, + modifier = padding + ) + Text( + text = "footerCTA", + style = DashboardCardTypography.footerCTA, + modifier = padding + ) + Text( + text = "standaloneText", + style = DashboardCardTypography.standaloneText, + modifier = padding + ) + } +} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCard.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCard.kt index b03a912b5bcb..fab7e075196d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCard.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCard.kt @@ -10,8 +10,8 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Divider -import androidx.compose.material.Text +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -71,10 +71,10 @@ fun BlazeCampaignsCard( ) } else Spacer(modifier = Modifier.size(8.dp)) } - Divider( - thickness = 0.5.dp, + HorizontalDivider( modifier = Modifier - .padding(start = 16.dp) + .padding(start = 16.dp), + thickness = 0.5.dp ) Column(modifier = Modifier .clickable { blazeCampaignCardModel.footer.onClick.click() }) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCardViewHolder.kt index b2e68e7dd9d8..88b13e78f571 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeCampaignsCardViewHolder.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.ui.Modifier import org.wordpress.android.databinding.CampaignsCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2WithoutBackground +import org.wordpress.android.ui.compose.theme.AppThemeM3WithoutBackground import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BlazeCard.BlazeCampaignsCardModel import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -14,7 +14,7 @@ class BlazeCampaignsCardViewHolder(parent: ViewGroup) : MySiteCardAndItemViewHolder(parent.viewBinding(CampaignsCardBinding::inflate)) { fun bind(cardModel: BlazeCampaignsCardModel) = with(binding) { blazeCampaignsCard.setContent { - AppThemeM2WithoutBackground { + AppThemeM3WithoutBackground { BlazeCampaignsCard( blazeCampaignCardModel = cardModel, modifier = Modifier .fillMaxWidth() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeStatusLabel.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeStatusLabel.kt index 760af14e7d74..ba4b27c5e0e7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeStatusLabel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/blaze/BlazeStatusLabel.kt @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Text +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/compose/MySiteCardToolbar.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/compose/MySiteCardToolbar.kt index 7a200912c4e5..5791866f8f7b 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/compose/MySiteCardToolbar.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/compose/MySiteCardToolbar.kt @@ -13,14 +13,13 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material.ContentAlpha -import androidx.compose.material.Divider -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.MoreVert import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenuItem +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.runtime.Composable @@ -36,7 +35,7 @@ import androidx.compose.ui.unit.dp import org.wordpress.android.R import org.wordpress.android.ui.compose.components.card.UnelevatedCard import org.wordpress.android.ui.compose.styles.DashboardCardTypography -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 /** * A toolbar for MySite cards written in Compose, that tries to match behavior and positioning of cards written in XML. @@ -111,14 +110,14 @@ private fun CardDropDownMenu( Icon( imageVector = Icons.Rounded.MoreVert, contentDescription = stringResource(id = R.string.more), - tint = MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.medium), + tint = MaterialTheme.colorScheme.onSurface, ) } DropdownMenu( expanded = isExpanded, onDismissRequest = { isExpanded = false }, - modifier = Modifier.background(MaterialTheme.colors.surface.copy(alpha = ContentAlpha.high)) + modifier = Modifier.background(MaterialTheme.colorScheme.surface) ) { contextMenuItems.map { item -> when (item) { @@ -132,7 +131,7 @@ private fun CardDropDownMenu( ) } - MySiteCardToolbarContextMenuItem.Divider -> Divider() + MySiteCardToolbarContextMenuItem.Divider -> HorizontalDivider() } } } @@ -158,7 +157,7 @@ sealed interface MySiteCardToolbarContextMenuItem { ) @Composable private fun MySiteCardToolbarPreview() { - AppThemeM2 { + AppThemeM3 { MySiteCardToolbar( onContextMenuClick = {}, contextMenuItems = listOf( @@ -191,7 +190,7 @@ private fun MySiteCardToolbarPreview() { ) @Composable private fun MySiteCardToolbarInCardPreview() { - AppThemeM2 { + AppThemeM3 { UnelevatedCard( modifier = Modifier.padding(8.dp) ) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsDecoration.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsDecoration.kt deleted file mode 100644 index 7ce0aa280656..000000000000 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsDecoration.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.wordpress.android.ui.mysite.cards.dashboard - -import android.graphics.Rect -import android.view.View -import androidx.recyclerview.widget.RecyclerView -import androidx.recyclerview.widget.RecyclerView.ItemDecoration - -class CardsDecoration( - private val verticalMargin: Int -) : ItemDecoration() { - override fun getItemOffsets( - outRect: Rect, - view: View, - parent: RecyclerView, - state: RecyclerView.State - ) { - val position = parent.getChildAdapterPosition(view) - if (position < 0) return - if (position > 0) { - outRect.top = verticalMargin - } - } -} diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCard.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCard.kt index c9ed724b74fe..df582695376d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCard.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCard.kt @@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material.MaterialTheme +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.material3.TextButton @@ -20,7 +20,7 @@ import androidx.compose.ui.unit.dp import org.wordpress.android.R import org.wordpress.android.ui.compose.components.card.UnelevatedCard import org.wordpress.android.ui.compose.styles.DashboardCardTypography -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.compose.unit.Margin import org.wordpress.android.ui.compose.utils.uiStringText import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloganuaryNudgeCardModel @@ -90,7 +90,7 @@ private fun CardToolbar( painter = painterResource(R.drawable.ic_bloganuary_24dp), contentDescription = null, modifier = Modifier.size(24.dp), - tint = MaterialTheme.colors.onSurface + tint = MaterialTheme.colorScheme.onSurface ) } } @@ -99,7 +99,7 @@ private fun CardToolbar( @Preview(name = "Dark Mode", uiMode = UI_MODE_NIGHT_YES) @Composable fun BloganuaryNudgeCardPreview() { - AppThemeM2 { + AppThemeM3 { BloganuaryNudgeCard( model = BloganuaryNudgeCardModel( UiString.UiStringRes(R.string.bloganuary_dashboard_nudge_title_december), diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCardViewHolder.kt index c6492d0cecac..8322091a81e3 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/bloganuary/BloganuaryNudgeCardViewHolder.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.ui.Modifier import androidx.compose.ui.platform.ViewCompositionStrategy import org.wordpress.android.databinding.BloganuaryNudgeCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2WithoutBackground +import org.wordpress.android.ui.compose.theme.AppThemeM3WithoutBackground import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.BloganuaryNudgeCardModel import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -16,7 +16,7 @@ class BloganuaryNudgeCardViewHolder(parent: ViewGroup) : // Dispose of the Composition when the view's LifecycleOwner is destroyed setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool) setContent { - AppThemeM2WithoutBackground { + AppThemeM3WithoutBackground { BloganuaryNudgeCard( model = cardModel, modifier = Modifier.fillMaxWidth() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardCallToActionButton.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardCallToActionButton.kt index eb5fb6a1bc8a..e4644aad9608 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardCallToActionButton.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardCallToActionButton.kt @@ -1,8 +1,8 @@ package org.wordpress.android.ui.mysite.cards.dynamiccard import androidx.compose.foundation.layout.padding -import androidx.compose.material.Text -import androidx.compose.material.TextButton +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardComposable.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardComposable.kt index a12503c54d57..f9e87edf13f7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardComposable.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardComposable.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.wordpress.android.ui.compose.components.card.UnelevatedCard -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.mysite.MySiteCardAndItem import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.Dynamic.ActionSource import org.wordpress.android.ui.utils.ListItemInteraction @@ -59,7 +59,7 @@ fun DynamicDashboardCard( @Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable fun DynamicDashboardCardPreview() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", @@ -91,7 +91,7 @@ fun DynamicDashboardCardPreview() { @Preview @Composable fun DynamicDashboardCardWithFeatureAndDescriptionPreview() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", @@ -120,7 +120,7 @@ fun DynamicDashboardCardWithFeatureAndDescriptionPreview() { @Preview @Composable fun DynamicDashboardCardWithFeatureAndSubtitleAndDescriptionPreview() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", @@ -149,7 +149,7 @@ fun DynamicDashboardCardWithFeatureAndSubtitleAndDescriptionPreview() { @Preview @Composable fun DynamicDashboardCardWithNoCta() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", @@ -176,7 +176,7 @@ fun DynamicDashboardCardWithNoCta() { @Preview @Composable fun DynamicDashboardWithFeatureImageOnly() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", @@ -196,7 +196,7 @@ fun DynamicDashboardWithFeatureImageOnly() { @Preview @Composable fun DynamicDashboardCardWithTitleAndCompleteRowsPreview() { - AppThemeM2 { + AppThemeM3 { DynamicDashboardCard( card = MySiteCardAndItem.Card.Dynamic( id = "id", diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardFeatureImage.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardFeatureImage.kt index 86736c54e285..fed3b6b0f8af 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardFeatureImage.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardFeatureImage.kt @@ -15,7 +15,6 @@ import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import org.wordpress.android.ui.compose.theme.AppColor - @Composable fun DynamicCardFeatureImage(imageUrl: String, modifier: Modifier = Modifier) { AsyncImage( diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardHeader.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardHeader.kt index be2838e43c7d..5174d712af2a 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardHeader.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardHeader.kt @@ -2,7 +2,7 @@ package org.wordpress.android.ui.mysite.cards.dynamiccard import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding -import androidx.compose.material.Text +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardRows.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardRows.kt index 8bc63a86d867..7c421ff90adf 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardRows.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardRows.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material.Text +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicDashboardCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicDashboardCardViewHolder.kt index 61d0bdea08b7..7bcd5a0665d1 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicDashboardCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicDashboardCardViewHolder.kt @@ -2,7 +2,7 @@ package org.wordpress.android.ui.mysite.cards.dynamiccard import android.view.ViewGroup import org.wordpress.android.databinding.DynamicDashboardCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2WithoutBackground +import org.wordpress.android.ui.compose.theme.AppThemeM3WithoutBackground import org.wordpress.android.ui.mysite.MySiteCardAndItem import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -11,7 +11,7 @@ class DynamicDashboardCardViewHolder(parent: ViewGroup) : MySiteCardAndItemViewHolder(parent.viewBinding(DynamicDashboardCardBinding::inflate)) { fun bind(card: MySiteCardAndItem.Card.Dynamic) = with(binding) { dynamicCard.setContent { - AppThemeM2WithoutBackground { + AppThemeM3WithoutBackground { DynamicDashboardCard(card) } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/jpfullplugininstall/JetpackInstallFullPluginCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/jpfullplugininstall/JetpackInstallFullPluginCardViewHolder.kt index ae38b8098abe..5a0dbc8c5099 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/jpfullplugininstall/JetpackInstallFullPluginCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/jpfullplugininstall/JetpackInstallFullPluginCardViewHolder.kt @@ -6,7 +6,7 @@ import androidx.appcompat.widget.PopupMenu import androidx.compose.ui.res.stringResource import org.wordpress.android.R import org.wordpress.android.databinding.JpInstallFullPluginCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.jetpackplugininstall.fullplugin.onboarding.compose.component.PluginDescription import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.JetpackInstallFullPluginCard import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder @@ -20,7 +20,7 @@ class JetpackInstallFullPluginCardViewHolder( ) { fun bind(card: JetpackInstallFullPluginCard) = with(binding) { jpInstallFullPluginCardContentComposable.setContent { - AppThemeM2 { + AppThemeM3 { PluginDescription( siteString = stringResource(R.string.jetpack_full_plugin_install_onboarding_description_this_site), pluginNames = card.pluginNames, diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessage.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessage.kt index cbbad9284189..34a2cd7c5509 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessage.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessage.kt @@ -3,9 +3,8 @@ package org.wordpress.android.ui.mysite.cards.nocards import android.content.res.Configuration import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding -import androidx.compose.material.ContentAlpha -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight @@ -33,10 +32,8 @@ fun NoCardsMessage( modifier = Modifier.padding(start = 16.dp, end = 16.dp), text = uiStringText(uiString = model.title), fontSize = 22.sp, - fontWeight = FontWeight.Normal, - color = MaterialTheme.colors.onSurface.copy( - alpha = ContentAlpha.high - ), + fontWeight = FontWeight.Medium, + color = MaterialTheme.colorScheme.onSurface, textAlign = TextAlign.Center, maxLines = 2, overflow = TextOverflow.Ellipsis, @@ -46,9 +43,7 @@ fun NoCardsMessage( text = uiStringText(uiString = model.message), fontSize = 16.sp, fontWeight = FontWeight.Normal, - color = MaterialTheme.colors.onSurface.copy( - alpha = ContentAlpha.medium - ), + color = MaterialTheme.colorScheme.onSurface, textAlign = TextAlign.Center, maxLines = 2, overflow = TextOverflow.Ellipsis, diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessageViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessageViewHolder.kt index f5e25c607ab7..a8f318dbd743 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessageViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/nocards/NoCardsMessageViewHolder.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.ui.Modifier import org.wordpress.android.databinding.NoCardsMessageBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.mysite.MySiteCardAndItem import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -14,7 +14,7 @@ class NoCardsMessageViewHolder(parent: ViewGroup) : MySiteCardAndItemViewHolder(parent.viewBinding(NoCardsMessageBinding::inflate)) { fun bind(cardModel: MySiteCardAndItem.Card.NoCardsMessage) = with(binding) { noCardsMessage.setContent { - AppThemeM2 { + AppThemeM3 { NoCardsMessage( model = cardModel, modifier = Modifier .fillMaxWidth() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCard.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCard.kt index 67550687ecd5..3236ed2166d9 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCard.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCard.kt @@ -7,8 +7,8 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -59,7 +59,7 @@ fun PersonalizeCard( painter = painterResource(id = R.drawable.ic_settings_white_24dp), contentDescription = stringResource(id = R.string.personalize_card_content_description), contentScale = ContentScale.None, - colorFilter = ColorFilter.tint(MaterialTheme.colors.onSurface) + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onSurface) ) } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCardViewHolder.kt index 65b3f2f034c9..003684f0e598 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/personalize/PersonalizeCardViewHolder.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.ui.Modifier import org.wordpress.android.databinding.PersonalizeCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2WithoutBackground +import org.wordpress.android.ui.compose.theme.AppThemeM3WithoutBackground import org.wordpress.android.ui.mysite.MySiteCardAndItem import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -14,7 +14,7 @@ class PersonalizeCardViewHolder(parent: ViewGroup) : MySiteCardAndItemViewHolder(parent.viewBinding(PersonalizeCardBinding::inflate)) { fun bind(cardModel: MySiteCardAndItem.Card.PersonalizeCardModel) = with(binding) { personalizeCard.setContent { - AppThemeM2WithoutBackground { + AppThemeM3WithoutBackground { PersonalizeCard( model = cardModel, modifier = Modifier .fillMaxWidth() diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCard.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCard.kt index 05593edcbc0e..55e0debbd84c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCard.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCard.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.tooling.preview.Preview import org.wordpress.android.R import org.wordpress.android.ui.compose.components.card.UnelevatedCard import org.wordpress.android.ui.compose.styles.DashboardCardTypography -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.compose.unit.Margin import org.wordpress.android.ui.compose.utils.uiStringText import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.WpSotw2023NudgeCardModel @@ -87,7 +87,7 @@ private fun CardToolbar( @Preview(name = "Dark Mode", uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable fun WpSotw2023NudgeCardPreview() { - AppThemeM2 { + AppThemeM3 { WpSotw2023NudgeCard( model = WpSotw2023NudgeCardModel( title = UiStringRes(R.string.wp_sotw_2023_dashboard_nudge_title), diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCardViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCardViewHolder.kt index fefe18657b7a..57db4193e3cc 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCardViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/sotw2023/WpSotw2023NudgeCardViewHolder.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.ui.Modifier import androidx.compose.ui.platform.ViewCompositionStrategy import org.wordpress.android.databinding.WpSotw20223NudgeCardBinding -import org.wordpress.android.ui.compose.theme.AppThemeM2 +import org.wordpress.android.ui.compose.theme.AppThemeM3 import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.WpSotw2023NudgeCardModel import org.wordpress.android.ui.mysite.MySiteCardAndItemViewHolder import org.wordpress.android.util.extensions.viewBinding @@ -16,7 +16,7 @@ class WpSotw2023NudgeCardViewHolder(parent: ViewGroup) : // Dispose of the Composition when the view's LifecycleOwner is destroyed setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool) setContent { - AppThemeM2 { + AppThemeM3 { WpSotw2023NudgeCard( model = cardModel, modifier = Modifier.fillMaxWidth(),