-
Notifications
You must be signed in to change notification settings - Fork 59
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
Added filter icon and navigation on click #2744
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2744 +/- ##
=========================================
+ Coverage 64.5% 65.4% +0.9%
+ Complexity 1075 1051 -24
=========================================
Files 218 221 +3
Lines 9635 9838 +203
Branches 1897 1809 -88
=========================================
+ Hits 6218 6441 +223
- Misses 2234 2293 +59
+ Partials 1183 1104 -79
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f7f1f77
to
0c274ce
Compare
onTitleIconClick = {}, | ||
onFilterIconClick = {}, |
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.
Can we have one-click action with different event types?
Implement event wrapper
sealed class ToolbarClickEvent {
object FilterData : ToolbarClickEvent()
object Navigate: ToolbarClickEvent()
}
Update function parameter
fun TopScreenSection(
modifier: Modifier = Modifier,
title: String,
searchText: String,
searchPlaceholder: String? = null,
toolBarHomeNavigation: ToolBarHomeNavigation = ToolBarHomeNavigation.OPEN_DRAWER,
onSearchTextChanged: (String) -> Unit,
onClick: (ToolbarClickEvent) -> Unit,
) {
Invoke event
IconButton(onClick = { onTitleIconClick (ToolbarClickEvent.Navigate) } )
Finally update the logic to switch between the different click events.
@allan-on as the author of the issue, can you please review a build of this against the expected output in the issue, thank you! |
IMPORTANT: Where possible all PRs must be linked to a Github issue
Fixes #2760
Engineer Checklist
strings.xml
file./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the project's style guideCode Reviewer Checklist
strings.xml
file