Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose About Activity conversion #5246

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

Williamrai
Copy link
Collaborator

@Williamrai Williamrai commented Jan 21, 2025

What does this do?

Converts About Activity to Compose

Phabricator:
https://phabricator.wikimedia.org/T384362

This also resolves the license screen issue.
https://phabricator.wikimedia.org/T384526

- adds HtmlText component
- adds preference for testing
@Williamrai Williamrai added the WIP Work in progress label Jan 21, 2025
- adds proper html string
- adds body and footer for the about Activity
- updates Snackbar, HtmlText
- fixes app theme issue,
- ui fixes
@Williamrai Williamrai added HOLD Will review as soon as other more pressing PRs are merged/released. and removed WIP Work in progress labels Jan 23, 2025
@Williamrai Williamrai added WIP Work in progress and removed HOLD Will review as soon as other more pressing PRs are merged/released. labels Feb 7, 2025
@Williamrai Williamrai added Ready to merge PR passed design signoff and ready to be merged. and removed WIP Work in progress labels Feb 7, 2025
),
linkInteractionListener = {
if (linkTextData.asset != null) {
println("orange: content ${linkTextData.text}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove test related println() code.

},
topBar = {
WikiTopAppBar(
title = "About",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the string reference.

)
},
topBar = {
WikiTopAppBar(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I have noticed is that it does not show the tooltip for the back button. Would it be possible to update the WikiTopAppBar for the back button (home button) for its content description for accessibility?

}

@Composable
fun AboutScreenContent(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the way you separate the layout into different sections!

},
),
painter = painterResource(R.drawable.w_nav_mark),
contentDescription = null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a clickable icon, to improve accessibility, consider adding a new string for the content description of the globe logo.

private lateinit var binding: ActivityAboutBinding
@Composable
fun AboutWikipediaScreen(
modifier: Modifier = Modifier,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like an unused parameter, can we remove it?


@Preview
@Composable
private fun AboutWikipediaImagePreview() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but do we need to keep this one?

binding = ActivityLicenseBinding.inflate(layoutInflater)
setContentView(binding.root)
setNavigationBarColor(getThemedColor(this, android.R.attr.windowBackground))
val asset = intent.getStringExtra(ASSET) ?: ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to use the "asset" string here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge PR passed design signoff and ready to be merged.
Development

Successfully merging this pull request may close these issues.

2 participants