Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
8d2040b
YiR: Pre-design scaffolding
cooltey Sep 19, 2025
0916538
Merge branch 'main' into yir-re-design
cooltey Sep 19, 2025
350cf1b
Wire up API calls and put TODOs
cooltey Sep 19, 2025
f0557c0
Put async for api calls
cooltey Sep 19, 2025
6f2b7fb
Merge branch 'main' into yir-re-design
cooltey Sep 22, 2025
42f85eb
Format for the headline/body text
cooltey Sep 23, 2025
e385bb0
Revert "Format for the headline/body text"
cooltey Sep 23, 2025
84b73de
Separate initial screen out
cooltey Sep 23, 2025
26655a5
Onboarding
cooltey Sep 24, 2025
344f904
Simplify a bit
cooltey Sep 24, 2025
43700b5
Initial thought about indivial screens
cooltey Sep 24, 2025
9d93c41
Merge branch 'main' into yir-re-design
cooltey Sep 24, 2025
cdb2548
Add temporary functions for slides
cooltey Sep 24, 2025
9cbbf1f
Review comment
cooltey Sep 24, 2025
259209c
clean up async
cooltey Sep 24, 2025
d7237fc
Fix error
cooltey Sep 24, 2025
7595e56
Consolidate routes
cooltey Sep 25, 2025
65409d7
Update a bit
cooltey Sep 25, 2025
ce28f83
Merge branch 'main' into yir-re-design
cooltey Sep 25, 2025
d4c4592
Remove survey for now and refine the finish action for onboarding and
cooltey Sep 25, 2025
18256af
Fix preview
cooltey Sep 25, 2025
1aff666
YiR: update entry point in More menu. (#5964)
dbrant Sep 25, 2025
f8c7114
YiR: Login dialog in the onboarding screen. (#5965)
dbrant Sep 25, 2025
711a974
Model class
cooltey Sep 25, 2025
1379200
use data class
cooltey Sep 25, 2025
095c7b5
Merge branch 'main' into yir-re-design
cooltey Sep 25, 2025
785e946
Create dataModel for YiR
cooltey Sep 25, 2025
20f226a
Update model
cooltey Sep 25, 2025
3fec482
Update model class and add todos
cooltey Sep 25, 2025
b2a8abb
Update query for top visited articles
cooltey Sep 25, 2025
d8d3cd2
No longer use CenterAlignedTopAppBar with W icon.
dbrant Sep 26, 2025
4266944
Merge branch 'main' into yir-re-design
cooltey Sep 29, 2025
3529736
Wire up onboarding screen to PageActivity, with result.
dbrant Sep 29, 2025
c1fa000
Merge branch 'yir-re-design' of github.com:wikimedia/apps-android-wik…
dbrant Sep 29, 2025
246b99e
Update naming and fix lint
cooltey Sep 29, 2025
45e73cf
Add two parameters for YearInReviewSlides
cooltey Sep 30, 2025
a129b12
Clean up outdated strings
cooltey Sep 30, 2025
e898995
Add filterNotNull() for slide routes
cooltey Sep 30, 2025
1f121e1
Fix translation test
cooltey Oct 1, 2025
a3ee3a7
YiR: save YiR model data to preference (#5967)
cooltey Oct 1, 2025
1e43871
YiR: Create Most visited Categories slide (#5968)
cooltey Oct 1, 2025
b16c57d
YiR: Create Your Top Articles slide (#5969)
cooltey Oct 1, 2025
8be18fc
Merge branch 'main' into yir-re-design
cooltey Oct 2, 2025
cf67139
Fix translation
cooltey Oct 2, 2025
ef1576d
YiR: Create Viewed Edits slide (#5970)
cooltey Oct 3, 2025
a323891
YiR: Add English most popular articles slide (#5971)
cooltey Oct 3, 2025
44fcdc6
Merge branch 'main' into yir-re-design
cooltey Oct 3, 2025
ecaa1a8
YiR: Add Setting to enable/disable. (#5978)
dbrant Oct 3, 2025
7988f7e
Remove duplicated preference from developer settings
cooltey Oct 3, 2025
ba82c1e
Swap donate icon with share icon and adjust the UI a bit
cooltey Oct 3, 2025
fa906ef
YiR: Create Articles Saved slide (#5972)
cooltey Oct 6, 2025
884448e
YiR: Update # of articles edited slide (#5979)
cooltey Oct 6, 2025
e6d7e04
Merge branch 'main' into yir-re-design
cooltey Oct 7, 2025
d34b05e
Fix translation
cooltey Oct 7, 2025
3adcfd2
Use year constant instead of LocalDate.
dbrant Oct 7, 2025
bba160d
YiR: Custom app icon (#5974)
dbrant Oct 7, 2025
b25e2d4
Merge branch 'main' into yir-re-design
dbrant Oct 8, 2025
f74b97c
Tweak verbiage per design.
dbrant Oct 8, 2025
98a77af
YiR: Create Reading Patterns slide (#5982)
cooltey Oct 8, 2025
52f92b4
Use localtime for queries and minor code updates
cooltey Oct 8, 2025
88b444f
Update MW info links.
dbrant Oct 8, 2025
850b6b3
Rename string items a bit
cooltey Oct 8, 2025
2bbdd56
Merge branch 'main' into yir-re-design
cooltey Oct 9, 2025
df380a6
Merge branch 'main' into yir-re-design
cooltey Oct 9, 2025
322dab9
Merge branch 'main' into yir-re-design
cooltey Oct 10, 2025
350014d
Prioritize categories that have 2+ spaces.
dbrant Oct 10, 2025
1d635a6
Merge branch 'yir-re-design' of github.com:wikimedia/apps-android-wik…
dbrant Oct 10, 2025
12b37d3
Merge branch 'main' into yir-re-design
cooltey Oct 10, 2025
1bf48b6
YiR: Create contributor slides (#5991)
cooltey Oct 14, 2025
dc91e9a
YiR: Update personalized "articles read" slides (#5988)
cooltey Oct 14, 2025
2101cdd
Fully integrate with remote config.
dbrant Oct 14, 2025
5ca7b51
Correct color.
dbrant Oct 14, 2025
c02836b
Merge branch 'main' into yir-re-design
Williamrai Oct 14, 2025
7256c1f
Fetch remote config explicitly.
dbrant Oct 14, 2025
0013a71
Unnecessary intermediate vars.
dbrant Oct 14, 2025
5306a9f
Update onboarding illustration.
dbrant Oct 14, 2025
29078a9
Merge branch 'main' into yir-re-design
cooltey Oct 14, 2025
ee1b161
YiR: add a filter for the top visited articles to show if visited > 1…
cooltey Oct 15, 2025
db3f290
Merge branch 'main' into yir-re-design
Williamrai Oct 15, 2025
65cf748
- replaces navigation left button with close button in app bar (#6003)
Williamrai Oct 15, 2025
56275b2
YiR: update local queries to accept time range to meet the feature re…
cooltey Oct 15, 2025
33ad06c
Wire up data start/end times from remote config.
dbrant Oct 15, 2025
6eacd63
Fix calculation of time spent, and explitit units naming.
dbrant Oct 15, 2025
6985a68
Merge branch 'main' into yir-re-design
dbrant Oct 15, 2025
e235b63
YiR: Share flow for individual slides
cooltey Oct 15, 2025
d844652
YiR: Wire up actual total enabling/disabling based on configuration. …
dbrant Oct 15, 2025
3ac20ef
Merge branch 'yir-re-design' into yir-share-function-update
cooltey Oct 15, 2025
4bea0de
Adjust paddings
cooltey Oct 15, 2025
534718b
Adjust screenshot
cooltey Oct 15, 2025
2f19cb4
Update parameters for modifier
cooltey Oct 16, 2025
a9b0d8e
Update style of Donate button.
dbrant Oct 16, 2025
e373872
Correct divider color.
dbrant Oct 16, 2025
f6603c1
Don't actually need a BottomAppBar.
dbrant Oct 16, 2025
ef9221c
Merge branch 'yir-re-design' of github.com:wikimedia/apps-android-wik…
dbrant Oct 16, 2025
71f3890
Improve naming and thread allowDonate throughout.t
dbrant Oct 16, 2025
08b77c5
Reinstitute rounded corner clipping.
dbrant Oct 16, 2025
3aeaa75
YiR: update app articles viewed times screen
cooltey Oct 16, 2025
72deb14
Merge branch 'main' into yir-re-design
cooltey Oct 16, 2025
96c4f22
- ensures bottom bar is drawn above the navigation bar (#6013)
Williamrai Oct 16, 2025
5d1f187
Merge branch 'yir-re-design' into yir-share-function-update
cooltey Oct 16, 2025
7116643
Lint
cooltey Oct 16, 2025
17faca6
Lint again
cooltey Oct 16, 2025
9870d40
Adjust paddings
cooltey Oct 16, 2025
d2dc8c0
Update strings and naming
cooltey Oct 16, 2025
69ba262
Update subject and hashtag
cooltey Oct 17, 2025
f1fedf6
Merge branch 'main' into yir-re-design
dbrant Oct 17, 2025
270f077
Complete integration with isAccessible from remote config.
dbrant Oct 17, 2025
22530f9
Merge branch 'yir-re-design' into yir-share-function-update
cooltey Oct 17, 2025
8301688
Remove header override
cooltey Oct 17, 2025
eb3fa27
Merge branch 'main' into yir-share-function-update
cooltey Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wikipedia.yearinreview

import android.content.Context
import androidx.compose.foundation.Image
import android.graphics.drawable.Animatable
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -28,6 +28,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import coil3.asDrawable
import coil3.compose.SubcomposeAsyncImage
import coil3.compose.SubcomposeAsyncImageContent
import coil3.request.ImageRequest
Expand All @@ -50,7 +51,6 @@ sealed class YearInReviewScreenData(
open class StandardScreen(
allowDonate: Boolean = true,
val animatedImageResource: Int = 0,
val staticImageResource: Int = 0,
val headlineText: Any? = null,
val bodyText: Any? = null,
showDonateInToolbar: Boolean = true
Expand Down Expand Up @@ -84,11 +84,22 @@ sealed class YearInReviewScreenData(
aspectRatio: Float) {
SubcomposeAsyncImage(
model = ImageRequest.Builder(context)
.data(if (screenCaptureMode) staticImageResource else animatedImageResource)
.data(animatedImageResource)
.allowHardware(false)
.build(),
loading = { LoadingIndicator() },
success = { SubcomposeAsyncImageContent() },
success = {
val drawable = it.result.image.asDrawable(context.resources)
val animatable = drawable as? Animatable
animatable?.let { animation ->
if (screenCaptureMode) {
animation.stop()
} else if (!animation.isRunning) {
animation.start()
}
}
SubcomposeAsyncImageContent()
},
onSuccess = { isImageResourceLoaded?.invoke(true) },
contentDescription = stringResource(R.string.year_in_review_screendeck_image_content_description),
modifier = Modifier.fillMaxSize()
Expand Down Expand Up @@ -128,7 +139,6 @@ sealed class YearInReviewScreenData(
class ReadingPatterns(
allowDonate: Boolean = true,
animatedImageResource: Int = 0,
staticImageResource: Int = 0,
headlineText: Any? = null,
bodyText: Any? = null,
val favoriteTimeText: String,
Expand All @@ -137,7 +147,6 @@ sealed class YearInReviewScreenData(
) : StandardScreen(
allowDonate,
animatedImageResource = animatedImageResource,
staticImageResource = staticImageResource,
headlineText = headlineText,
bodyText = bodyText,
)
Expand All @@ -149,22 +158,11 @@ sealed class YearInReviewScreenData(
val showDonateButton: Boolean = false
) : StandardScreen(
allowDonate = allowDonate,
animatedImageResource = R.drawable.launcher_foreground_yir25,
headlineText = headlineText,
bodyText = bodyText,
showDonateInToolbar = !showDonateButton
) {
@Composable
override fun HeaderContents(context: Context,
screenCaptureMode: Boolean,
isImageResourceLoaded: ((Boolean) -> Unit)?,
aspectRatio: Float) {
Image(
modifier = Modifier.size(200.dp),
painter = painterResource(R.drawable.launcher_foreground_yir25),
contentDescription = null
)
}

@Composable
override fun BottomButton(context: Context, onButtonClick: () -> Unit) {
if (showDonateButton) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package org.wikipedia.yearinreview

import android.graphics.Bitmap
import android.graphics.BlurMaskFilter
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -28,10 +26,7 @@ import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
Expand All @@ -52,19 +47,16 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.asAndroidBitmap
import androidx.compose.ui.graphics.layer.drawLayer
import androidx.compose.ui.graphics.nativeCanvas
import androidx.compose.ui.graphics.rememberGraphicsLayer
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextLinkStyles
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
Expand Down Expand Up @@ -104,13 +96,15 @@ fun YearInReviewScreenDeck(
CreateScreenShotBitmap(
screenContent = pages[pagerState.currentPage]
) { bitmap ->
val googlePlayUrl = context.getString(R.string.year_in_review_share_url) + YearInReviewViewModel.YIR_TAG
val bodyText = context.getString(R.string.year_in_review_share_body, googlePlayUrl, context.getString(R.string.year_in_review_hashtag))
ShareUtil.shareImage(
coroutineScope = coroutineScope,
context = context,
bmp = bitmap,
imageFileName = "year_in_review",
imageFileName = YearInReviewViewModel.YIR_TAG,
subject = context.getString(R.string.year_in_review_share_subject),
text = context.getString(R.string.year_in_review_share_url)
text = bodyText
)
startCapture = false
}
Expand Down Expand Up @@ -182,7 +176,9 @@ fun YearInReviewScreenDeck(
contentPadding = PaddingValues(0.dp),
) { page ->
YearInReviewScreenContent(
innerPadding = paddingValues,
modifier = Modifier
.padding(paddingValues)
.verticalScroll(rememberScrollState()),
screenData = pages[page]
)
}
Expand Down Expand Up @@ -287,7 +283,6 @@ fun CreateScreenShotBitmap(
screenContent: YearInReviewScreenData,
onBitmapReady: (Bitmap) -> Unit
) {
val shadowColor = WikipediaTheme.colors.primaryColor
val graphicsLayer = rememberGraphicsLayer()
var isImageLoaded by remember { mutableStateOf(false) }

Expand All @@ -300,14 +295,15 @@ fun CreateScreenShotBitmap(

Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.drawWithContent {
graphicsLayer.record {
[email protected]()
}
drawLayer(graphicsLayer)
}
.background(color = WikipediaTheme.colors.paperColor),
.background(color = WikipediaTheme.colors.paperColor)
.padding(vertical = 8.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
Expand All @@ -316,79 +312,43 @@ fun CreateScreenShotBitmap(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(bottom = 40.dp),
.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Icon(
painter = painterResource(R.drawable.ic_wikipedia_b),
tint = WikipediaTheme.colors.primaryColor,
contentDescription = stringResource(R.string.year_in_review_navigate_left),
contentDescription = stringResource(R.string.app_name_prod),
modifier = Modifier
.height(32.dp)
.width(50.dp)
.height(20.dp)
.width(31.dp)
)
}

YearInReviewScreenContent(
innerPadding = PaddingValues(0.dp),
modifier = Modifier
.padding(0.dp),
screenData = screenContent,
screenCaptureMode = true,
) { isLoaded -> isImageLoaded = isLoaded }

Card(
shape = RoundedCornerShape(10.dp),
colors = CardDefaults.cardColors(
containerColor = WikipediaTheme.colors.paperColor
),
modifier = Modifier
.width(312.dp)
.padding(top = 36.dp)
.drawBehind {
/* Manually creating card shadow for render compatibility with graphicsLayer.toImageBitmap() */
val paint = Paint().asFrameworkPaint().apply {
color = shadowColor.copy(alpha = 0.15f).toArgb()
maskFilter = BlurMaskFilter(
20f,
BlurMaskFilter.Blur.NORMAL
)
}
drawContext.canvas.nativeCanvas.drawRoundRect(
0f,
0f,
size.width,
size.height,
16f,
16f,
paint
)
}
) {
Row(
horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.Start),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(start = 12.dp, end = 16.dp, top = 12.dp, bottom = 11.dp)

) {
Image(
painter = painterResource(R.drawable.globe),
contentDescription = stringResource(R.string.year_in_review_globe_icon)
)
Text(
text = "#WikipediaYearInReview",
color = WikipediaTheme.colors.progressiveColor,
style = MaterialTheme.typography.titleSmall
)
}
isLoaded -> isImageLoaded = isLoaded
}

Text(
modifier = Modifier.padding(top = 32.dp),
text = processString(R.string.year_in_review_hashtag),
color = WikipediaTheme.colors.primaryColor,
style = MaterialTheme.typography.bodyLarge.copy(
fontWeight = FontWeight.Medium
)
)
}
}

@Composable
fun YearInReviewScreenContent(
innerPadding: PaddingValues,
modifier: Modifier = Modifier,
screenData: YearInReviewScreenData,
screenCaptureMode: Boolean = false,
isOnboardingScreen: Boolean = false,
Expand All @@ -397,7 +357,7 @@ fun YearInReviewScreenContent(
when (screenData) {
is YearInReviewScreenData.StandardScreen -> {
StandardScreenContent(
innerPadding = innerPadding,
modifier = modifier,
screenData = screenData,
screenCaptureMode = screenCaptureMode,
isOnboardingScreen = isOnboardingScreen,
Expand All @@ -416,20 +376,16 @@ fun YearInReviewScreenContent(
@Composable
private fun StandardScreenContent(
modifier: Modifier = Modifier,
innerPadding: PaddingValues,
screenData: YearInReviewScreenData.StandardScreen,
screenCaptureMode: Boolean = false,
isOnboardingScreen: Boolean = false,
isImageResourceLoaded: ((Boolean) -> Unit)? = null,
) {
val scrollState = rememberScrollState()
val headerAspectRatio = 3f / 2f
val context = LocalContext.current
Column(
verticalArrangement = Arrangement.Top,
modifier = modifier
.padding(innerPadding)
.verticalScroll(scrollState)
) {
screenData.Header(context, screenCaptureMode, isImageResourceLoaded, headerAspectRatio)
Column {
Expand Down Expand Up @@ -562,7 +518,6 @@ fun PreviewScreenShot() {
screenContent = YearInReviewScreenData.StandardScreen(
allowDonate = true,
animatedImageResource = R.drawable.year_in_review_puzzle_pieces,
staticImageResource = R.drawable.year_in_review_puzzle_pieces,
headlineText = "Over 3 billion bytes added",
bodyText = "TBD"
)
Expand All @@ -579,7 +534,6 @@ fun PreviewStandardContent() {
YearInReviewScreenData.StandardScreen(
allowDonate = true,
animatedImageResource = R.drawable.year_in_review_puzzle_pieces,
staticImageResource = R.drawable.year_in_review_puzzle_pieces,
headlineText = "Over 3 billion bytes added",
bodyText = "TBD"
)
Expand All @@ -600,7 +554,6 @@ fun PreviewReadingPatternsContent() {
YearInReviewScreenData.ReadingPatterns(
allowDonate = false,
animatedImageResource = R.drawable.year_in_review_puzzle_pieces,
staticImageResource = R.drawable.year_in_review_puzzle_pieces,
headlineText = "You have clear reading patterns",
bodyText = "",
favoriteTimeText = "Afternoon",
Expand Down
Loading
Loading