-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into issue/21444-personalization-accessibility
- Loading branch information
Showing
22 changed files
with
129 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 52 additions & 9 deletions
61
WordPress/src/main/java/org/wordpress/android/ui/compose/styles/DashboardCardTypography.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,104 @@ | ||
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 { | ||
val title: TextStyle | ||
@Composable | ||
get() = MaterialTheme.typography.bodyLarge.copy( | ||
fontWeight = FontWeight.SemiBold, | ||
color = colors.onSurface.copy(alpha = ContentAlpha.high) | ||
color = MaterialTheme.colorScheme.onSurface | ||
) | ||
|
||
val smallTitle: TextStyle | ||
@Composable | ||
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 | ||
@Composable | ||
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 | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardsDecoration.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...n/java/org/wordpress/android/ui/mysite/cards/dynamiccard/DynamicCardCallToActionButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.