-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
base: main
Are you sure you want to change the base?
Conversation
- 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
- renames some classes
- adds a padding that will respect the keyboard visibility when showing no languages found text
# Conflicts: # app/src/main/java/org/wikipedia/compose/theme/WikipediaTheme.kt
# Conflicts: # app/src/main/java/org/wikipedia/compose/components/WikiTopAppBar.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some issues:
- For the package name
addLanguagesList
, since we are using all lower cases logic in the app, I think we can rename it toaddlanguages
- 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?
app/src/main/java/org/wikipedia/language/addLanguagesList/AddLanguagesListActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/wikipedia/language/addLanguagesList/AddLanguagesListScreen.kt
Outdated
Show resolved
Hide resolved
Text( | ||
text = localizedLanguageName, | ||
style = WikipediaTheme.typography.h3.copy( | ||
color = WikipediaTheme.colors.primaryColor, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
app/src/main/java/org/wikipedia/language/addLanguagesList/AddLanguagesViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/wikipedia/language/addLanguagesList/AddLanguagesViewModel.kt
Outdated
Show resolved
Hide resolved
data class LanguageListUiState( | ||
val searchTerm: String = "", | ||
val languagesItems: List<LanguageListItem> = emptyList(), | ||
val error: String? = null, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
# Conflicts: # app/src/main/java/org/wikipedia/compose/components/SearchTopAppBar.kt # app/src/main/java/org/wikipedia/compose/components/WikiTopAppBarWithSearch.kt
* - 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
What does this do?
Converts LanguagesListActivity to compose
Phabricator:
https://phabricator.wikimedia.org/T386528