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 language list design #5375

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

Conversation

Williamrai
Copy link
Collaborator

What does this do?
Converts LanguagesListActivity to compose

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

Williamrai and others added 12 commits February 28, 2025 12:13
- creates a new viewModel, then transfer and adapt the code from the existing ViewModel to work properly withing the Compose architecture
- adds compose ui for LanguagesListActivity
- adds search functionality
- ui/code fixes
- adds P style to Compose Typography
…th search action call back

- code/logic/ui fixes
- adds click events for list items
- adds a padding that will respect the keyboard visibility when showing no languages found text
@Williamrai Williamrai added Ready to merge PR passed design signoff and ready to be merged. Design review labels Mar 4, 2025
Williamrai and others added 3 commits March 5, 2025 12:43
# Conflicts:
#	app/src/main/java/org/wikipedia/compose/theme/WikipediaTheme.kt
# Conflicts:
#	app/src/main/java/org/wikipedia/compose/components/WikiTopAppBar.kt
Copy link
Collaborator

@cooltey cooltey left a comment

Choose a reason for hiding this comment

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

Some issues:

  1. For the package name addLanguagesList, since we are using all lower cases logic in the app, I think we can rename it to addlanguages
  2. When showing the search empty view, the search empty view should not be overlapped by the virtual keyboard. Is there a way to prevent it?

Text(
text = localizedLanguageName,
style = WikipediaTheme.typography.h3.copy(
color = WikipediaTheme.colors.primaryColor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The localized name should be Bold

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is using style="@style/H3.MaterialListTitle" in XML.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. I just checked the code an the h3 should use bold for the fontWeight.

data class LanguageListUiState(
val searchTerm: String = "",
val languagesItems: List<LanguageListItem> = emptyList(),
val error: String? = null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will you add the WikiErrorView to handle this error message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did not include this because XML did not had this. Should i include this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's fine for this PR but good for a follow-up to add it to keep a good practice.

@Williamrai Williamrai requested a review from cooltey March 14, 2025 19:59
Williamrai and others added 5 commits March 14, 2025 16:00
Williamrai and others added 6 commits March 21, 2025 09:52
* - adds a sealed interface approach to handle state
- adds a debounce for search
- code/ui fixes

* - adds coil library
- creates an image service interface and implementation
- code fixes
- updates compose view model to use simple states
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