-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #498 from Automattic/task/410-profile-card-and-badge
End of Year: Show profile card and badge
- Loading branch information
Showing
15 changed files
with
177 additions
and
30 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
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
27 changes: 27 additions & 0 deletions
27
...rc/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/EndOfYearLaunchBottomSheet.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package au.com.shiftyjelly.pocketcasts.endofyear.views | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.stringResource | ||
import au.com.shiftyjelly.pocketcasts.compose.bottomsheet.BottomSheetContentState | ||
import au.com.shiftyjelly.pocketcasts.compose.bottomsheet.ModalBottomSheet | ||
import au.com.shiftyjelly.pocketcasts.localization.R as LR | ||
|
||
@Composable | ||
fun EndOfYearLaunchBottomSheet( | ||
onClick: () -> Unit, | ||
) { | ||
ModalBottomSheet( | ||
showOnLoad = true, | ||
content = BottomSheetContentState.Content( | ||
titleText = stringResource(LR.string.end_of_year_launch_modal_title), | ||
summaryText = stringResource(LR.string.end_of_year_launch_modal_summary), | ||
primaryButton = BottomSheetContentState.Content.Button.Primary( | ||
label = stringResource(LR.string.end_of_year_launch_modal_primary_button_title), | ||
onClick = { onClick.invoke() } | ||
), | ||
secondaryButton = BottomSheetContentState.Content.Button.Secondary( | ||
label = stringResource(LR.string.end_of_year_launch_modal_secondary_button_title), | ||
), | ||
) | ||
) | ||
} |
69 changes: 69 additions & 0 deletions
69
...fyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/views/EndOfYearPromptCard.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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package au.com.shiftyjelly.pocketcasts.endofyear.views | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.tooling.preview.PreviewParameter | ||
import androidx.compose.ui.unit.dp | ||
import au.com.shiftyjelly.pocketcasts.compose.AppTheme | ||
import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 | ||
import au.com.shiftyjelly.pocketcasts.compose.components.TextH70 | ||
import au.com.shiftyjelly.pocketcasts.compose.preview.ThemePreviewParameterProvider | ||
import au.com.shiftyjelly.pocketcasts.compose.theme | ||
import au.com.shiftyjelly.pocketcasts.ui.theme.Theme | ||
import au.com.shiftyjelly.pocketcasts.localization.R as LR | ||
|
||
private val PromptCardCornerSize = 5.dp | ||
private val PromptCardTextColor = Color.White | ||
|
||
@Composable | ||
fun EndOfYearPromptCard( | ||
onClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Box( | ||
modifier = modifier | ||
.background(color = MaterialTheme.theme.colors.primaryUi02) | ||
) { | ||
Column( | ||
modifier = modifier | ||
.padding(horizontal = 16.dp, vertical = 8.dp) | ||
.fillMaxWidth() | ||
.clip(RoundedCornerShape(PromptCardCornerSize)) | ||
.background(color = Color.Black) | ||
.clickable { onClick.invoke() }, | ||
) { | ||
TextH30( | ||
text = stringResource(LR.string.end_of_year_prompt_card_title), | ||
color = PromptCardTextColor, | ||
modifier = modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp, bottom = 8.dp) | ||
) | ||
TextH70( | ||
text = stringResource(LR.string.end_of_year_prompt_card_summary), | ||
color = PromptCardTextColor, | ||
modifier = modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp, bottom = 16.dp) | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun EndOfYearPromptCardPreview( | ||
@PreviewParameter(ThemePreviewParameterProvider::class) themeType: Theme.ThemeType, | ||
) { | ||
AppTheme(themeType) { | ||
EndOfYearPromptCard(onClick = {}) | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ts/endofyear/storyviews/StoryFake1View.kt → ...endofyear/views/stories/StoryFake1View.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
2 changes: 1 addition & 1 deletion
2
...ts/endofyear/storyviews/StoryFake2View.kt → ...endofyear/views/stories/StoryFake2View.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
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
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